sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4ef33ffc366264db5242c077e477fd9ed5f56a8a3643fa7fb01af37592390c27
MATLAB
3,138
158
function fmri_spm_volumes(infile,outdir,varargin) % This function reads VNMR EPI data and writes volumes in separate NIfTI % files for SPM analysis % if nargin<2 error('Too few input arguments') end % Defaults if infile(end)==filesep infile = infile(1:end-1); end [fp,fn,fe] = fileparts(infile); if strcmpi(fn,'fi...
e499d2b4b3867fa3bb3c09d554fe402649474da933defa7c3e19f79dd67d1532
MATLAB
3,139
84
function [map,thismanyhits] = heatmap3ct(traceOrig,DFForZ,camtime,timeFP_frames,startFr,endFr,lowRes) trace=round(traceOrig/lowRes); %reduce tracking resolution %% correct non-tracked epochs by carrying forward last measurement % Cleversys assigns -1 to non-tracked frames j=1; traceC=trace; for j=1:length(trace); ...
8e4ea7e805cd6a0637b503c4f221f6a04ed6411c5c359382c06ebcd6209bc924
MATLAB
3,141
117
%% Sriram Summary OKR BETWEEN ANIMALS %% Load File clear;clc; try load('diffData.mat') T = readtable('diffData.xlsx'); catch warning('No diffData File Found!') return end color = T.color; conditions = unique(T.condition); %% For Each Condition for i = 1:length(conditions) A = figure(i);clf...
c60cf5960b9b63cdb3780cb9320aab0802ef8b73b651034fd656f39605f57224
MATLAB
3,142
97
function [maskErode,maskLargest,maskThreshold] = create_mask_erode(dataMagnitude,radiusDisk,percentileThresh) % [maskErode,maskLargest,maskThreshold] = create_mask_erode(dataMagnitude,radiusDisk,percentileThresh) % %================================= % PURPOSE %================================= % % creates a new mask fr...
d69f95c75528280ec220b0345a9df9892ea1f2b42b7fc074031f32efe5c1689a
MATLAB
3,145
92
function plotFFTSetupON( obj, varargin ) % PLOTFFTSETUPON % Plot setup ON LFP recording fourier transform % % Syntax: % PLOTFFTSETUPON( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optional) ax Axis where to plot. % * rec Index of re...
5b80211375521f246ea3740db6b2ebd2d12c2f1b11b112b60a4b5f6bddeea0b3
MATLAB
3,146
73
% This demo shows how to use the software described in our IJCV paper: % Selective Search for Object Recognition, % J.R.R. Uijlings, K.E.A. van de Sande, T. Gevers, A.W.M. Smeulders, IJCV 2013 %% fprintf('Demo of how to run the code for:\n'); fprintf(' J. Uijlings, K. van de Sande, T. Gevers, A. Smeulders...
6960fdd6ea71f553447dd5bb670993d084b193cd751f1c9eb83ade59df1c4988
MATLAB
3,147
98
% This example creates a square module with optodes. It then uses MOCA's % automated createLayout() function to overlay the module over the ROI. % Once this probe is generated, this demo shows how to toggle individual % modules on/off, how to translate the probe relative to ROI, and how to % rotate individual modules....
7df5d4e7db265cd65652ca9714290c17e049e53779a06135c005821177e8bb6f
MATLAB
3,148
102
% plotAllKernels.m % % Function to plot all kernels, where those relating the same variables in % the same direction are plotted on the same subplot. I.e. the yaw % velocity forward kernel for left, right, sum, and diff. Also shows % variance explained. Produces 1 plot, with subplots. % Requires the structs generate...
943dca7f447de1b28382bf93c3d9a83a54dfaf5def94d563c978e6905da7e884
MATLAB
3,149
87
% computeMeansStdErrsFictracOpto.m % % Helper function for computeAvgFictracOpto_1Fly() that takes in cell array % of stimulation reps and returns 2 cell arrays of the same size, one with % the mean and one with the standard error across reps % % INPUTS: % reps - cell array of size # NDs x # durations, where each e...
e9f62e14b106d92e7ff15240d2a8a209d0b1aa63353a66a4c5483c5dc8def90b
MATLAB
3,150
110
function [] = classificationGenerator() if ~isdeployed disp('loading path') %for IU HPC addpath(genpath('/N/u/brlife/git/vistasoft')) addpath(genpath('/N/u/brlife/git/encode')) addpath(genpath('/N/u/brlife/git/jsonlab')) addpath(genpath('/N/u/brlife/git/spm')) addpath(genpath('/N/u/brlife/...
c06f6cadb7ef766b6772cd62d12f0e3c8771eecc9e55f4ca888b5232fcff2ad8
MATLAB
3,151
74
function [I Q F]=motif4struct_wei(W) %MOTIF4STRUCT_WEI Intensity and coherence of structural class-4 motifs % % [I Q F] = motif4struct_wei(W); % % Structural motifs are patterns of local connectivity. Motif frequency % is the frequency of occurrence of motifs around a node. Motif intensity % and coherence...
c0bcbf5108068638375adb06d6e2689945f947de10c15205c7cf9f9792632383
MATLAB
3,151
97
function [ mynii ] = MYnii( vol, varargin ) %MYNII Usage: MYnii(inputvolume). Replaces nifti function, output .mat .dir .dims .voxelsize .data % MYnii opens .gz files if needed. Accepted input is .nii, .hdr, .dcm (no % mat available) and .PAR or .REC (no mat available). If anything is % given after the vol, a par...
c7d6a80bb818b91f1f2ba5fa7a274fef9437aa53682f4e4266ccaa6813a554ab
MATLAB
3,151
84
% This script assigns coil position, dIdt (for % electric field), I0 (for magnetic field), and displays the resulting % head-coil geometry. It may be be executed several times to adjust the % coil position % % Copyright SNM/WAW 2017-2020 addpath('../../../../FMM3D/matlab'); %% Define dIdt (for ele...
8c2f73ec07f45b62b294911f2b9602cc9eca54cd675acf262bceae87472cb4b9
MATLAB
3,152
77
function [ x, u, energy ] = fcn_optimalControlContinuous( A, B, rho, x0, xT, T ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This function solve the optimal control problem where % min_u \int_0^T ||x_T-x(t)||^2+\rho ||u(t)||^2 dt % s.t. dx(t)/dt = A x(t) + B u(t), x(0) = x_0, x(T) = x_T % % ...
c5c18080d09dc990f19c296494026e5144a5076d95e21b52b2fbf4a5a28fd643
MATLAB
3,152
81
%% TOPOPLOT_MODELESTIMATES % This script creates topoplots based on the model estimates of each % channel. % % INPUT: % - summary/*/*_channels.csv: summary output table from R containing model % estimates of each channel for the given condition % % OUTPUT: % - topoplots of the model estimates for each of the conditions...
a3042e1fccbd1733ec7348d8c48d5430eacb918fa78274b5c9667fa116653b5f
MATLAB
3,153
86
% segments data from each block into trials from 1s before onset % to 10s after onset % and saves it in scr_epo_all.mat % additionally creates single trial plots so that one can check data % quality function skin_conductance_epoch(cfg) interval = [-1 10]; % trial interval in s relative to heat onset raw_file_path = f...
b7182e3dfa2c8ae749d222732036648d16e9e71eb119d380432f0d1cc54b90b3
MATLAB
3,153
75
% This script assigns coil position, dIdt (for % electric field), I0 (for magnetic field), and displays the resulting % head-coil geometry. It may be be executed several times to adjust the % coil position % % Copyright SNM/WAW 2017-2020 addpath('../../../../FMM3D/matlab'); %% Define dIdt (for ele...
0123454e6d48ff1dfc51e9f644d59622a2d9c9b184103dff23e5162a968620a2
MATLAB
3,154
92
function plotFFTSetupOFF( obj, varargin ) % PLOTFFTSETUPOFF % Plot setup OFF LFP recording fourier transform % % Syntax: % PLOTFFTSETUPOFF( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optional) ax Axis where to plot. % * rec Index o...
022650d27f5fa7b4fdf19af16509211c9ca802b04bd3b49f6e697e9ad69745a1
MATLAB
3,154
82
% mglContextStash: Set aside the mgl state and config, to reactivate later. % % $Id$ % usage: contextName = mglContextStash(newName) % by: ben heasly % date: 09/07/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Set aside the mgl state and config, ...
47976026880f73876dbd73563f150ce4f074c96dbec710d1b94782bdbbb9ce5b
MATLAB
3,157
82
function data = read_artinis_oxy3(filename, header, begsample, endsample, chanindx) % reads Artinix oxy3-files into fieldtrip format % use as % header = read_artinis_oxy3(filename) % or % event = read_artinis_oxy3(filename, read_event) % where read_event is a boolean. If 'true', the function returns events. % If...
6938c0adc473701aefcd02257872be6947c710150989ae6b52f56d7864fa4ba8
MATLAB
3,157
96
function [coeffs,mean_data,initialProjection,threshold]=find_dir_subspace(pars,optimW,I_ramp,colour_dir) %% find_dir_subspace defines a common subspace for trajectories across different directions % INPUTS % % pars: parameters of the simulation set on MCtx_RNN_SOC_common_parameters % %optimW: Weights of the network % ...
b0bd78d85ce022a84357462b6eed3baa7a1fe5a80280ea3df6a34cef359c3e9f
MATLAB
3,158
98
function [startstop]=find_startstop_v1(data, events, rot_tra, run, ID, varargin) % FIND_STARTSTOP_V1 % This function detects the timepoints when a participant starts and stops % when walking. This was defined as an increase/decrease in horizontal % pelvis velocity over a threshold of 0.3 m/s after a start/stop signal...
9938389d6a9d5bee6c7846c1078421e1ec675da6191311a615bfefd487b9ee84
MATLAB
3,159
86
% segments data from each block into trials from 1s before onset % to 10s after onset % and saves it in scr_epo_all.mat % additionally creates single trial plots so that one can check data % quality function skin_conductance_epoch(cfg) interval = [-1 10]; % trial interval in s relative to heat onset raw_file_path = f...
c65f9db41e478ebe0e82211e73dfa995dafabde94cbba5f3cab036fc6bbff473
MATLAB
3,162
118
% Script to compute mean MePD output on the Kp x c_{ie} par. space clearvars; clc; addpath("C:/Users/kn356/OneDrive - University of Exeter/Desktop/StandardMATLAB") load("rainbow_cmap.mat") load("par.mat") par.d=0.05; time_vector = 0:0.1:5e+3; %% p1 = [1.6 , 14]; p2 = [0, 65]; n = 150; % Define the parameter ...
a46f5b3728ead1a2a594e6ec592949e22567327f6539a2ea4e3fb7c62e2664de
MATLAB
3,164
113
function polarPlotVectorsGender(File) % open up csv file containin the gain and phase [~, ~, array] = xlsread(File); [row, col] = size(array); rLimits = [0, .62]; myfig = figure(); % does this file contain gender information? if col > 4 gen = true; else gen = false; end % cycle through each entry and plot t...
da399dda73548ab1781bc7608f418eac339c2e7f82060f02e7c0a4d91ec32bf2
MATLAB
3,168
82
function plotCrossCorrVarChronic( obj, varargin ) % Cross-correlation and cross-variance of chronic LFP recordings % % Syntax: % PLOTCROSSCORRVARCHRONIC( obj, ax ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % % Example: % PLOTCROSSCORRVARCHRONIC( obj...
e074f8b9bd83560a3e2a4cae348bb726ccffbbf8508ae762532395e7e020863c
MATLAB
3,171
115
% Script to extract pdf curves for S, T and <S> vs T % Author: Keshav Srinivasan, March 2023 %% Parameters tsteps = 1e8; % Number of time steps of the time-series vector d = 25; % Range of k (time-bin) %Initalize variables S = zeros(tsteps/10,d); T = zeros(tsteps/10,d); counts = zeros(1,d); p = 1; % The subsampl...
5275da27f3338307162b24025d625fd7c81183794618e397ab055dc325b5ce5a
MATLAB
3,174
96
% getAlignedLegStepsContfromBouts.m % % Helper function for saveContLegStepParamCond_bouts() that takes in % indices of yaw velocity peaks (peak, start, and end) and returns the % continuous leg step parameter values aligned to the velocity peak % To allow averaging over different bouts and the inconsistent frame r...
11e3bc3280be9f8ed66a74af9bb5e8575d74a45a7acb5d8a4a0aa3086aa47429
MATLAB
3,175
91
% Coupling of the KNDy network model with MePD outputs function dx = KNDy(t,x,par) %% KNDy model parameters d1 = par.d1; % Dyn degradation rate d2 = par.d2; % NKB degradation rate d3 = par.d3; % Firing rate reset rate k1 = par.k1; % Maximum Dyn secretion rate k2 = par.k2; % Maximum NKB secretion rat...
13009e4d9fa123e471a2b11f6a333c926b7e9ce64e803d69e51824e9ca4419df
MATLAB
3,176
94
data_path = '/Users/celia/Documents/two_context_data'; % change this load(fullfile(data_path, 'ratemaps-2021_12_1_12_34_49_K1_d4.mat')) minTrial = 4; animals = length(extractfield(ratemaps.data, 'animal')); within = cell(length(animals),3); across = cell(length(animals),3); rmDay = cell(length(animals), 3); for a = 1...
9dc9ec659b11f2f9b5c61d4e55c01ac1b933e1a32d30e24ef96adf6d1d0cbb66
MATLAB
3,178
66
% VL_AIB Agglomerative Information Bottleneck % PARENTS = VL_AIB(PCX) runs Agglomerative Information Bottleneck % (AIB) on the class-feature co-occurrence matrix PCX and returns a % vector PARENTS representing the sequence of compressed AIB % alphabets. % % PCX is the joint probability of the occurrence of t...
f093d7f5e6d5c3dd581375b3569d687a92a910529c704059b3ac317425bace07
MATLAB
3,179
109
function vars = alignmentMethod_Saccade_APP(app, vars) disp('Calculating Alignment Based on Saccade Overlap...') %% Prep badSpots_vid = vars.sacLoc_vid; alignmentWindow = [-3 3]; alignmentSlots = alignmentWindow(1)*vars.samplerate_Magnet:alignmentWindow(2)*vars.samplerate_Magnet; rr = 1; for i = alignmentSlots if...
98ac09731ff1ec6591b7f8614068762248abfc9895e8b113a59dec86dc9b42b7
MATLAB
3,180
55
clear file=dir('ACC*uncertain*.mat'); k=1; for jj=1:length(file) load(file(jj).name) gotrial=find(outcome(:,1)==1|outcome(:,1)==2|outcome(:,1)==5);%Go trial,hit/miss/ro %delte first trial gotrial(find(gotrial<=1))=[]; nogotrial=find(outcome(:,1)==3|outcome(:,1)==4);%Nogo trial,cr/fa nog...
f9f7c59e0e346275598f5f98cb0f3ffdc7a0070a04f3e521b11d1f82a15c4103
MATLAB
3,180
113
classdef My_util_dagnn properties end methods(Static) % ------------------------------------------------------------------------- function layers = simpleFindLayersOfType(net, type) % ------------------------------------------------------------------------- layers = find(cellfun(@(x)strcmp(x.type, type)...
0e83b9b6d49c252b9b67f38921e65a74a4abe7ab64745fd568bffc2120504dc4
MATLAB
3,182
93
% uSelectROIs.m % % Function for the user to select the ROIs and background threshold for a % single time series. Calculates raw signal (mean pixel intensity) in each % ROI and performs background subtraction. % % INPUTS: % none, but prompts user for trial folder with preprocessed imaging data % % OUTPUTS: % non...
7cc3c224645054812076afe0e7a303de4daa93ed97250c3f53dd6e3c9eb99e8c
MATLAB
3,182
81
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [R] = compute_stats_stability_bfo180_sim_curves_days123(analysisSettings, analysisResultsGroupAverages) SessionsToGroups = load_sessions_to_groups_table(analysisSettings); SessionsToGroups(~ismember(SessionsToGroups....
7619fc31039283b02337170cd9775645329468af63e4b81245031ed192b93f88
MATLAB
3,183
84
function cnn_batch_info_disp(train_opts, work_info_batch) batch_ds_info=work_info_batch.ref.ds_info; img_size_str=my_gen_array_str(batch_ds_info.img_size); img_size_str_input=my_gen_array_str(batch_ds_info.img_size_input); img_size_str_aug=my_gen_array_str(batch_ds_info.img_size_aug); f...
a0748ac00b99278b22710ec845687fd2d3469cc0c4c5a325186b86b2586236b3
MATLAB
3,183
60
function Tracks = load_labview_tracks(folder_name, parameters) if exist([folder_name, filesep, 'labview_tracks.mat'], 'file') == 2 && exist([folder_name, filesep, 'timestamps.mat'], 'file') == 2 loaded_variable = struct2cell(load([folder_name, filesep, 'labview_tracks.mat'])); Tracks = [loaded_varia...
d832be0d02596337cc17b0149cd112dc1b2b741f33719a30b33cabe1f09180cb
MATLAB
3,186
83
function handle = restack_dataplots( handle, dataplots ) % restack_last_plot Ternary plot restacking % % This function accepts a ternary axes "handle" and another scalar or % vector structure "dataplots" which contains a field "object" or "obj" % which is the specific handle of the plot to stack (e.g. % dataplo...
6b0180a2c3c4fe9ea53194335e11ae9342f09ae34b61e77087a282d5efad1a77
MATLAB
3,188
82
function averageTimeframe(results, name, opt) all_participants = fieldnames(results); experiments = opt.experiments; for experiment = experiments experiment = experiment{1}; aoi_names = opt.aois.(matlab.lang.makeValidName(experiment)).names; nb_aois = length(aoi_names.voronoi) ...
2056e15c59d51fc17d474856bb1899914047a54e4984f20821b1d0069fc38d77
MATLAB
3,190
109
% loadKernelYScaleYLabels.m % % Function to load y scales and y labels for kernel plotting, for when % behavioral velocity units are all deg/s or for both mm/s and deg/s % % INPUTS: % whichEphys - string for which ephys variable (spikeRate or medFiltV) to % return y scales and labels for % degPerMM - 0 if usi...
e3ce95138be484a1f54bdb73fad13def9dc9723afdfbad47ff7d6fc61686dafe
MATLAB
3,190
78
% mglMetalFinishBatch: await results from a completed command batch. % % usage: [results, batchInfo]= mglMetalFinishBatch(batchInfo) % by: ben heasly % date: 01/12/2024 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Returns the Mgl Metal to its normal state %...
9258743995144eea0e6aaaa39039fc979da867149a3a349eb0d691304d8374c4
MATLAB
3,191
81
function mltp_compute_bfo_180_ac(obj, session) outputFolder = fullfile(session.getAnalysisDirectory(), obj.Config.placemaps.outputFolder); % Allow the function to run so that other functions do not break, % but give a warning. if session.getNumTrialsToUse() < 2 warning('This function requires ...
7ed6edb8654b33fc59395292c07eb17af03ba212e9a378923df50958aee7d2a8
MATLAB
3,192
81
function status = fillGroupsInformation( obj, data ) % Fill groups information % % Syntax: % status = FILLGROUPSINFORMATION( obj, data ); % % Input parameters: % * data - data from json file(s) % % % Example: % status = FILLGROUPSINFORMATION( obj, data ); % % Available at: https://github.com/NCN-Lab/DBScope % Fo...
d22f58165ae15fa033da5a96a8d1ff6770dc2d54d82e6621f10ae82efd48b4a3
MATLAB
3,193
73
clear; tbl_dir = pwd; tbl_name = fullfile(tbl_dir,'S3_Data.xlsx'); [~, sheetNames] = xlsfinfo(tbl_name); groupStr = {'Young','Old'}; condStr = {'Correct','Incorrect'}; %% Fig.3B, require https://www.mathworks.com/matlabcentral/fileexchange/23661-violin-plots-for-plotting-multiple-distributions-distributionplot-m rainc...
bba3dc3dc37dd41263b45e483cb5f7e9b77a7ca1952b717b2b164b58cddf2fcb
MATLAB
3,196
103
function [st3, rez] = standalone_detector(rez, spkTh) % Detects spikes across the entire recording using generic templates. % Each generic template has rank one (in space-time). % In time, we use the 1D template prototypes found in wTEMP. % In space, we use Gaussian weights of several sizes, centered % on (x,y) posit...
365a994d665173ca38e90db2a50d2df067b7c0f0c6ee57d79b3a9b419c72c888
MATLAB
3,197
115
% windows() - Symmetric window functions % % Usage: % >> h = windows(t, m); % >> h = windows(t, m, a); % % Inputs: % t - char array 'rectangular', 'bartlett', 'hann', 'hamming', % 'blackman', 'blackmanharris', 'kaiser', or 'tukey' % m - scalar window length % % Optional inputs: % a - scalar or vector wi...
e1ddeb7c922a7b7ee7fbfbe4c160c1eda201c6006728694971cd4b83cd5add2c
MATLAB
3,197
83
%% Burst Network Starting clear all clc % Load file to compute BNL index and to identify the compartments [filename, pathname] = uigetfile({'*.mat'},'Select NetworkBurstDetectionFile with all electrodes'); if isequal(filename,0) return else col = ['gray ' 'green ' 'red ' 'cyan ' 'yellow ' 'violet ' 'blue ']; ...
d39c3fc76738aed49c7fda640ffd7cdc6288897bc26138479b3b042df7b7e8ee
MATLAB
3,198
104
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This function reads in the excel files and then plots them since they % were previously plotted in Excel. This is so that a reviewer doesn't have % to plot them manually. Makes Figure S15A (mfr). close all clear all clc % Paths r...
e2563ebc29e50a1c96712f97f888ee3b395e224e0a6e7fa37c54d28849b21c2f
MATLAB
3,198
105
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This function reads in the excel files and then plots them since they % were previously plotted in Excel. This is so that a reviewer doesn't have % to plot them manually. Makes Figure S15B (pfr). close all clear all clc % Paths r...
86d6921bee73807afe48dd2a8da5596dfbc60ca4f9595833f096d66f5078fe3e
MATLAB
3,199
95
function [zValues,zCosts,zGuesses,inConvHull,meanMax,exitFlags] = ... findTDistributedProjections_fmin(data,trainingData,... trainingEmbedding,parameters) %findTDistributedProjections_fmin is called by runEmbbedings to find the %optimal emb...
5709e917b1e5d3f0b1daab563f0f2a4830b3f99df3638b452b9815cd0b06ad72
MATLAB
3,200
131
function plot_motion_1d(FD,n,FD_TR,time_min) [r c]=size(FD); if r==n FD=FD'; end raw_FD=FD; th_min=floor(time_min*60/FD_TR); FD(FD<=th_min)=0; FD_sorted=FD; ticks=size(FD,1); fds=linspace(0,0.5,ticks); survivors=sum(FD>0,2); neighbors=(-3:3)*.5; %lapsed time in minutes n_neighbors=length(neighbors); ths=time_min+n...
dde0a3a59005d5fe8cf08f12388a7802bf36efc86eacda7fc6aa05625e2f03a6
MATLAB
3,201
73
% mglContextActivate: Activate mgl state and config previously stashed by mglContextStash. % % $Id$ % usage: swappedOutName = mglContextActivate(toActivateName, swappedOutName) % by: ben heasly % date: 09/07/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % p...
25c6767c496099426a482fa9a441f747b81e35b40838142a70b787afb8cc3fde
MATLAB
3,202
90
% isPreSyn.m % % Function that returns whether each element of a source neuron list is % presynaptic to at least x elements of a target neuron list % % INPUTS: % sourceNeurons - single string or cell array of presynaptic neurons, by % name % targetNeurons - single string or cell array of potential postsynapt...
85de9b53ecfff099a9200e2b8ddaea54fc80fc94d90173409f8ba586d0f798b6
MATLAB
3,204
97
function [edge_usage,percent_usage] = fcn_get_edge_usage(L) %FCN_GET_EDGE_USAGE calculate edge usage in shortest paths % % [edge_usage,percent_usage] = fcn_get_edge_usage(L) takes as input a % cost matrix and returns the number of times an edge {i,j} was % traversed across all shortest paths and the fraction ...
e50fb11440ffeed7a92b7fe5fffc7c9dc0a6d057ee2efc20fe4ada69ebaaa8d2
MATLAB
3,204
75
function newRect = OffsetRect(oldRect,x,y) % newRect = OffsetRect(oldRect,x,y) % % Offset the passed rect matrix by the horizontal (x) % and vertical (y) shift given. You can also pass in column vectors x and y % with e.g., n different "shifts" and the function will return n copies of % oldRect, each shifted by one of ...
252b6133b892980bff9fc5004935fac328ea60c55def68e1dfbb699d9217408a
MATLAB
3,206
102
function [ guessA , guessb ,loglikes] = hmm_training( seqs,pi,guessA,guessb,info ) %% Train Hidden Markov Models (HMMs) using the Baum-Welch algorithm. %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % - seqs: Emission sequences for training. % - pi: Initial state probabilities. % - guessA...
c5a03eaf90884b44949cd4aa61fe4d42792bc9e4b2f53e31b41beb4285fcc5f7
MATLAB
3,207
129
function generate_productjson(fg_classified) tract_info = cell(length(fg_classified), 2); fibercounts = zeros(1, length(fg_classified)); possible_error = 0; num_left_tracts = 0; num_right_tracts = 0; for i = 1 : length(fg_classified) name = fg_classified{i}.name; num_fibers = length(fg_classified{i}.fibers); ...
c8763d500dc05d755875650b170b9508b85eace7431b8ab18ddeec25b7821a4d
MATLAB
3,208
120
function [x, f, cost] = beads(y, d, fc, r, lam0, lam1, lam2) % [x, f, cost] = beads(y, d, fc, r, lam0, lam1, lam2) % % Baseline estimation and denoising using sparsity (BEADS) % % INPUT % y: Noisy observation % d: Filter order (d = 1 or 2) % fc: Filter cut-off frequency (cycles/sample) (0 < fc < 0.5) %...
1428405e6b94ecc483baf2990bd203127c4ac789a584e88455765453341472c6
MATLAB
3,209
120
function [SepParticles,markers] = ParticleSeparation(MnonConv,minMarkerSize,Convthresh) % Ultimate Erosion of Convex Shapes (UECS) based particle separation of non convex particles % based on the discribtion of % Park, C. and Ding, Y. (2021) Data Science for Nano Image Analysis, Springer Nature, Cham, Switzerla...
26a438960c6885947bd02be21fdfa8fc696418505c9477cbf391fe24aec0367b
MATLAB
3,209
99
function [hdr, dat] = read_mpi_ds(dirname) % READ_MPI_DS reads all DAP files from a directory containing files or % alternatively a single DAP file and returns it in a simplified FieldTrip % format. The analog channels and spike channels are both returned in a % continuous format. % % Use as % [hdr, dat] = read_mpi_...
036cf9c5894236c6e733910291951b110a2a90f2cc56dac4b6f4ecf83a362530
MATLAB
3,215
81
classdef SpikeEventSeries < types.core.ElectricalSeries & types.untyped.GroupClass % SPIKEEVENTSERIES Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detecte...
3b079d34aa17b8cf008885468cebd9b2424d38719947d34eea73fc03e546304f
MATLAB
3,215
69
function axon_params = check_axon_params(axon_params) % axon_params = check_axon_params(axon_params) % % This function checks the elements of the struct axon_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - axon_params - Struct co...
1b5fbbeacbdf0ce6693a9c0f220c181e8d7da4fbde2c5631a1dfee45a016705a
MATLAB
3,218
100
%% Script to obtain centiles by PE diagnosis (suspected, definite, and clinical) % Copyright (C) 2023 University of Seville % Written by Natalia García San Martín (ngarcia1@us.es) % This file is part of Neurobiology Centiles Psychosis toolkit. % % Neurobiology Centiles Mapping toolkit is free software: % y...
5daf2b9f4e2912d889056b44a3bedc1f1a05bca53f1da956ccdd339645ef49cc
MATLAB
3,218
100
function [file] = read_ctf_ascii(filename); % READ_CTF_ASCII reads general data from an CTF configuration file % % The file should be formatted like % Group % { % item1 : value1a value1b value1c % item2 : value2a value2b value2c % item3 : value3a value3b value3c % item4 : value4a value4b v...
165b1fbb616cae416726d679f77dc1abf1e9d34ab57d01589cdf84dcb705133f
MATLAB
3,219
81
% poorly written, please forgive! commonSpikes = ones(1, length(data.default(2,:))); % this removes the NOT common spikes, reset justTimes to contain running % list of common spikes. If a spikes doesn't exist in a particular file, it % will be removed. justTimes = data.default(2,:); length(justTimes) commonSpikes ...
e36be88bbe3faea71c6b7a3fb29549c2a9293e15cf0b1155a1b4f9c7e4821814
MATLAB
3,219
107
function [A,W] = gretna_R2b_MST(Original,Stype,Ttype,Thr) %========================================================================== % This function is used to threshold a weighted matrix into a binary matrix % and weighted matrix by identifying the minimum spanning tree subgraph % first, followed by adding new conne...
ff7da9489aeabc751e7faac9cdb5b3ccfcb1cac98ce9f8497f2f107acb3f8c6d
MATLAB
3,220
98
function [dat] = read_wdq_data(filename, hdr, begsample, endsample, chanindx) % READ_WDQ_DATA reads data from wdq files % % Use as % [dat] = read_wdq_data(filename, hdr, begsample, endsample, chanindx) % or % [dat] = read_wdq_data(filename, hdr, 'lowbits') % Copyright (C) 2011, Jan-Mathijs Schoffelen % % This file ...
9b202355d0743f5ae709599a80333e0d693fa18dea182fe6816d5ebca00511d5
MATLAB
3,222
103
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [T] = get_bestaligned_registered_rotated_maps(BestAligned, MapsData, registeredCellName, doNormalization) cdata = BestAligned(ismember(BestAligned.registeredCellName, registeredCellName),:); numSessions = size(cdata...
5bee8a36711f8183b6b2eca4eaa6f086fd4a4e685f7ee581f4170255e179e86a
MATLAB
3,223
124
% % Adaptive Edge Weighting for Label Propagation % % INPUT % X: d (features) times n (instances) input data matrix % param: The structure variable containing the following field: % max_iter: The maximum number of iteration for gradient descent % k: The number of nearest neighbors % sigma: Initial width par...
0397c119868ad0fea4127a87a04b901036f8bcf9510355117175da8de7702723
MATLAB
3,224
96
function trainTree( opts, stream, ftrs, labels, treeInd ) % Train a single tree in forest model. % finalize setup treeDir = [opts.modelDir '/tree/']; treeFn = [treeDir opts.modelFnm '_tree']; % TODO: comment to prevant loading pre-compute tree if(exist([treeFn int2str2(treeInd,3) '.mat'],'file')) fprintf...
f62d114bacd7a7caa70558d54c64a77fe0d99cf3e940844a77a9ba54798f6ef0
MATLAB
3,226
71
% This script computes the induced surface charge density for an % inhomogeneous multi-tissue object in an external time-varying magnetic % field due to a coil via a BEM/FMM iterative solution with accurate % neighbor integration % % Copyright SNM/WAW 2017-2020 %% Parameters of the iterative solution...
dfdaa112048c19fa8175e5ed70fec5cc7cf5b7af7c467ccf2214c54c137797cb
MATLAB
3,227
85
outputFolder = 'output'; if ~isfolder(outputFolder) mkdir(outputFolder); end fid = fopen(fullfile('output', 'coherency_table.csv'), 'w'); fprintf(fid, '%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s\n', 'animal', 'day', 'contextA', 'contextB', 'trialA', 'trialB', 'digA', 'digB', 'animalSessionCellName', 'isStable', 'b...
000f9472c774de0e908070ce391187bfe08e58b16f9a1761ec81cbe4240e87dd
MATLAB
3,229
79
function [result] = ml_egomaps_batch_compute_with_egotable(... pop_cell_activation, ... RADIUS_CM, EGOMAPS_CM_PER_BIN, EgoTable) % This code processes more than ones cells activity and doesnt make any % plots, but can with a callback with simple changes needed. numCells = size(pop_cell_activation,2...
c07e397bc92c793bdaa77771e7e8b2e77851c9fa02a5a253dda70e57e5971e49
MATLAB
3,230
110
function remain = assignopts (opts, varargin) % assignopts - assign optional arguments (matlab 5 or higher) % % REM = ASSIGNOPTS(OPTLIST, 'VAR1', VAL1, 'VAR2', VAL2, ...) % assigns, in the caller's workspace, the values VAL1,VAL2,... to % the variables that appear in the cell array OPTLIST and that match % the ...
d033be21ec17322ef81f7a7dbb1e484bf500c58e2adbd2ea52bbb788ea1f06a7
MATLAB
3,233
88
%% stable/reverse/restable clear % file=dir('ACC*-stable*.mat'); file=dir('ACC*-restable*.mat'); % file=dir('ACC*-reverse*.mat'); nn=0;Cellid=[]; p=strfind(file(1).name,'-'); populationname=file(1).name(p(1)+1:p(2)-1); k=1; for j=1:length(file) load(file(j).name); label=str2num(file(j).name(4:5)); ...
e7c84ab7d89da2876ff288af1d1e1b24c8f63d02a29d6e129eb526f45b8f2355
MATLAB
3,233
96
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [T] = get_bestaligned_registered_rotated_maps_all(BestAligned, MapsData, doNormalization) T = []; k = 1; registeredCellNames = unique(BestAligned.registeredCellName); for iCell = 1:length(registered...
726debbe67c8b9020501843eedfeee22689824a7ea43c01a399b168d15445094
MATLAB
3,234
92
classdef network_project_superclass2 % superclass for all network project stuff. Not meant to be used directly. properties (Constant) % location of relevant folders Directory = 'C:\Users\Durian Lab\Documents\MATLAB\Continuous_Network/' % experiments run ExperimentFol...
be27f2d90bcb95712648f9eb872a8c89f96466fe4b7f1e97134d6c1e42f1b996
MATLAB
3,234
124
% % Adaptive Edge Weighting for Label Propagation % % INPUT % X: d (features) times n (instances) input data matrix % param: The structure variable containing the following field: % max_iter: The maximum number of iteration for gradient descent % k: The number of nearest neighbors % sigma: Initial width par...
4d326bf0e12f757ed96e407fecc9c427059f7a08b28c069d736037d15ee04dc5
MATLAB
3,236
80
function thermalNoiseRemoval(filein, name, ofolder) % Make sure that the following has been done: % - you have downloaded the most current nonlocal mppca repo from github % (https://github.com/NYU-DiffusionMRI/mppca_denoise) % - you have FSL installed and know where its Matlab functions are located % - you have set up...
d9ce0e6f2c2b3b8460efd197727118a22efb8848a541a36fe879e81cf19f796d
MATLAB
3,239
79
function [ LFP_filtdata ] = applyFilt_ordered( obj, LFP_ordered, fs, filterType, order, varargin ) % This function returns the filtered data given the parameters that define % the desired filter. % % Use with streaming recordings of LFPs; % Sampling Frequency for Streaming = 250Hz. % % Depending on the type of the filt...
f115cb4e68039f4329d62a4b9b80cdda0ff664b585a0e24c964d74429b1f8712
MATLAB
3,240
77
function [DATA_and_MARKER_binned, info] = binning_and_cutting(DATA, MARKER, bin, condition, marker, m_time, p_time,info,str_save_append) %% Function to bin spike times and event markers for each neuron and trial %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % - DATA: Raw spike data % - M...
f4b67f53cd89dc68f4ddd18cda55cf937866897f10e573b70e626c8c1fe1b1d1
MATLAB
3,240
73
function [cnmf, pcaica, suite2p, est] = correlateAllSegmentations(cnmf, pcaica, suite2p, est, neur_act2, varargin) % [cnmf, pcaica, suite2p, est] = correlateAllSegmentations(cnmf, pcaica, suite2p, est, neur_act2, varargin) % % Function to pair the components from different segmentation algorithms % % 2018 - Adam Charl...
26e447281fcbe892a33a93d68cdccbee08a05cb7ce9be0710e78477e8eec775d
MATLAB
3,241
127
function [estParams, LL] = fastfa(X, zDim, varargin) % % [estParams, LL] = fastfa(X, zDim, ...) % % Factor analysis and probabilistic PCA. % % xDim: data dimensionality % zDim: latent dimensionality % N: number of data points % % INPUTS: % % X - data matrix (xDim x N) % zDim - number of factors % % OUTPUT...
50e4dcfa2ad171ab0c7856d02f0e15b9db8fdfb2237278031136be6875db8a0c
MATLAB
3,243
105
function [fid, sens, label, sens_label] = read_zebris(Fname_zeb,skip) % Reads Zebris files: % fiducials locations, and % either sensor file or headshape file or both % % FORMAT [fid, sens, label] = read_zebris(Fname_zeb,skip) % Input: % Fname_zeb - Zebris ASCII file containing sensor locations (mm) % ...
a58850b7a4354c713360a6bc938ad04149a948a2a0f1383db9348f25997f3daf
MATLAB
3,244
96
function corra = corrH(Var,LFP,Fs,elec) % compute corr Head*Var. % for now - corra.plot - node.o * var % LFP is expected to hold the nose var, when called from corrHead % var is the frames vector of tuning var. % LFP % globals; % CORRPAR.lags = [-500, 500]; %ms % CORRPAR.maxF = 100; %Hz. low-pass filtered...
c062552f6e9732e9851a1ad880249e4cfed2605697533895c25ef2f36f9e8309
MATLAB
3,246
81
function mltp_make_trial_position_plots_raw(obj, session) if obj.isVerbose() fprintf('Making position plots\n'); end % Make the folder if it does not exist folder = fullfile(session.getAnalysisDirectory(), obj.Config.trial_nvt_position_plots_folder); ...
2cbbc8929ef0c5800a9149689d4368d20ee57cd1eb383113177a3a069d1bcc9a
MATLAB
3,247
85
clear cd ./stable-cuelight % C1S2:loop;C1S3:go cue;C1S4:go judge;C1S5:no gocue;C1S6:nogojudge; % C1S7:go Hit;C1S8:go miss;C1S9:no go CR;C1S10:airpuff;OUT1:reward;OUT2:airpuff; % C1S11:light on;C1S12:light off control=dir('C*.mat');%control inhibit=dir('I*.mat');%inhibition performence=[]; for ii=1:length(contro...
778f4b81a8faa5e01e0452adc8d193de58cb17e1343f6c7fe33dfd78921f50ec
MATLAB
3,248
106
% % Draw hop plot in function of time. % % PARAMETERS % $network % $type "full" or "split" % % INPUT FILES % dat/hopdistr_time.$type.$statistic.$network % dat/hopdistr_time_runtime.$type.$statistic.$network % dat/stepsi.$network (full only) % dat/steps.$network.mat (split only) % % OUTPUT FILES % plot/hopdistr_tim...
80ea69ee6d6d69b71bf5fb4ee6cab42a527826fe0dc114ab6e3cab3b413a91bd
MATLAB
3,248
86
function [On Ar] = reorder_mod(A,M) %REORDER_MOD Reorder connectivity matrix by modular structure % % On = reorder_mod(A,M); % % This function reorders the connectivity matrix by modular structure and % may hence be useful in visualization of modular structure. % % Inputs: A, connectivity m...
291e8941ee15f9644c76263c6d163c067dc820151e857966c394ccf8bb2d3b99
MATLAB
3,253
58
%% fs = filesep; handles.fs = fs; %% Defaults to calculate connectotyping handles.connectotyping_settings.default_frames=60; % set the number of random frames included to connectotype, subjects with fewer frames will be excluded from this environment handles.connectotyping_settings.repetitions=10; % if a participant ha...
80a4db437ea890ef32bb4861dd9754e621038817b46cc251352b6432d204a88a
MATLAB
3,253
77
f_fin = OPT_S.f_fin.*SC.mask_f_cam; FOV.max_ramp_y = FOV.max_ramp; FOV.max_ramp_x = FOV.max_ramp; ramp_max = max(FOV.max_ramp_x,FOV.max_ramp_y); n_big_area = round(ramp_max/SC.dx*2); N_big_area = 2*n_big_area+1; %% settings ramps_big_fov_x = (-FOV.max_ramp_x :FOV.d_ramp :FOV.max_ramp_x); ramps_big_fov_y = (-FOV.max_ram...
17faaa69feb3f78d5d31792f57867848df4b7f54454e55346cdabd9792d37695
MATLAB
3,257
131
function J = vl_imarray(A,varargin) % VL_IMARRAY Flattens image array % J=VL_IMARRAY(A) creates a mosaic J from the array of images A. A % can be either a M*N*K array, storing one gray-scale image per % slice, or a M*N*3*K or M*N*K*3 array, storing a true color RGB % image per slice. The function returns an im...
6d974eb34878d740532a065f5ad8deb07c49992fef3aedb27082618cd6801fd2
MATLAB
3,258
94
classdef OpticalChannel < types.core.NWBContainer & types.untyped.GroupClass % OPTICALCHANNEL An optical channel used to record from an imaging plane. % REQUIRED PROPERTIES properties description; % REQUIRED (char) Description or other notes about the channel. emission_lambda; % REQUIRED (single) Emission wav...
c9e94341304ced997d35f13c52d593cd32b2f909ea5a3fc5f490483866e4cc26
MATLAB
3,258
132
% % Apply a spectral transformation to a central matrix. % % PARAMETERS % d (r*r) Central matrix % curve Name of curve to apply % values Parameters of the curve % % RESULT % d_new (r*r) New central matrix % function [d_new] = curve_apply(d, curve, values, data_decomposition) r = size(d,1); pivot = pivotize(data...
222d97171a2ba88f6afe790e3a401b1c88d6e52916501f6c5bd43abfbc991502
MATLAB
3,259
96
function vl_plotss(ss, varargin) % VL_PLOTSS Plot scale space % VL_PLOTSS(SS) plots the scale space SS. SS is a structure % with the following members: % % ss.firstOctave:: % The index of the first octave in the scale space. % % ss.lastOctave:: % The index of the last octave in the scale space. % % ss...
5da65af5d06ff5fd532394fc1c11d346a2c33a2857ad0576dde183d0e5081338
MATLAB
3,259
101
% getFANCcontributions.m % % Function to read in output of csvFancChangeLog function (in R), to get % user contributions to all neurons in specified folder. Each neuron is a % single CSV file % Returns table of users, user affiliations, user IDs, number of edits, % number of neurons % % INPUTS: % changeLogFolderP...
93a4affb6a0ec15039b5043ff1817bedabbbab5a04d6994688bbbbcc8040513b
MATLAB
3,259
93
function [state, B, A] = denss(X_or_state, parameters) % Main DSS algorithm % [state, B, A] = denss(X or state) % [state, B, A] = denss(X or state, [params]) % [state, B, A] = denss(X or state, {param1, 'value1', param2, 'value2', ...}) % X Mixed signals % state Existing or new algorithm s...
f83474d947a54f11547e159e1ce3361e5b12c2fc9ddf40d7b3121989a41adaa4
MATLAB
3,259
95
% getAlignedLegXYfromBouts.m % % Helper function for saveLegStepParamCond_bouts() that takes in indices of % yaw velocity peaks (peak, start, and end) and returns the leg X and Y % positions aligned to the velocity peak % To allow averaging over different bouts and the inconsistent frame rate, % interpolate to speci...
fe2a832b61e0b725b6277397d36d7bd93ca3b0afe41c26ee32bcddbceb6486e6
MATLAB
3,260
108
%firws() - Designs windowed sinc type I linear phase FIR filter % % Usage: % >> b = firws(m, f); % >> b = firws(m, f, w); % >> b = firws(m, f, t); % >> b = firws(m, f, t, w); % % Inputs: % m - filter order (mandatory even) % f - vector or scalar of cutoff frequency/ies (-6 dB; % pi rad / sample) % % O...