sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e606ac0e756b4078c36a497ea19db00e9ce5d68b45cd5522c4012eccf243a64e
MATLAB
11,330
428
function [x,fval,exitflag,output]=fminsearchcon(fun,x0,LB,UB,A,b,nonlcon,options,varargin) % FMINSEARCHCON: Extension of FMINSEARCHBND with general inequality constraints % usage: x=FMINSEARCHCON(fun,x0) % usage: x=FMINSEARCHCON(fun,x0,LB) % usage: x=FMINSEARCHCON(fun,x0,LB,UB) % usage: x=FMINSEARCHCON(fun,x0,LB,UB,A,b...
8cdf56496338afe3d1bfac30a4fb5821970bf9c308de5cc29546d44df4628bfa
MATLAB
11,335
468
% hungarian() - Solve the assignment problem using the Hungarian method. % % Usage: >> [C,T]=hungarian(A) % % Inputs: % A - a square (correlation/distance/cost) matrix. % C - the optimal assignment (closest row/col pairs) % T - the total (minimized) cost of the optimal assignment. % % Author: Niclas Borlin, 199...
202bf97e0bf01393a4c9de8717479ae76084e92088da89105b5bf3dafbf4af4e
MATLAB
11,339
235
function options = NoRMCorreSetParms(varargin) % Struct for setting the NoRMCorre algorithm parameters. Any parameter that is % not set gets a default value % Author: Eftychios A. Pnevmatikakis % Simons Foundation, 2016 Names = [ % dataset info 'd1 ' % number of rows 'd2 ...
edfc152b06adbff0511a664268b0ac739d68a955a7517a937f79dfd711c2d064
MATLAB
11,362
246
%% set up main variables for analyses a = spm_read_vols(spm_vol('SPECT_output_group_loading_coeff_.nii')); size(a); %tells you the dimensions of a, in this case it's a subject ... % by component matrix of 213 x 53 %you can save it as a txt file as follows: save("loadings.txt","a","-ascii") %we c...
21a350ab7f6340402855bd6128f07c9297c85f7180fcc341c41d336cbb44d2e6
MATLAB
11,375
241
%This script takes output from coherence calculation function and exports %into a table that can be imported in R %Inputs: Cell array of animal IDs, cell array of filter names, cell array %of run states (options: 'runall' 'runthresh' 'nonrun' 'all' %'diff_runVSnon' 'diff_threshVSnon'), seg (= to size of bins used...
195641303e8bddcfd95ceb3e3b35e58e00a5d299919ab0a6760ced535f5a29a5
MATLAB
11,377
216
function bz_PlotRippleStats(maps,data,stats,varargin) %bz_PlotRippleStats - Plot descriptive stats for ripples (100~200Hz oscillations). % % USAGE % % bz_PlotRippleStats(maps,data,stats,<options>) % % Use the ouputs of <a href="matlab:help RippleStats">RippleStats</a> as input parameters. Using cell arrays of %...
50beb0e4a612284b2406dfe72b81a134f848836f50ed3ac8c9c9035be77e0143
MATLAB
11,390
269
% pop_rejkurt() - rejection of artifact in a dataset using kurtosis % of activity (i.e. to detect peaky distribution of % activity). % % Usage: % >> pop_rejkurt( INEEG, typerej) % pop-up interative window mode % >> [OUTEEG, locthresh, globthresh, nrej] = ... % = pop_rejkurt( INEEG,...
d7010aead7c12c10822dd945000c1e68ec0d136bff567952ca528e907646a667
MATLAB
11,398
337
function V = run_variance(subject_ids, paths, mesh_path, nirsmodel_path, layout_mat, opts) %RUN_VARIANCE Estimate within-subject GLM beta variability using block-resampling. % % V = fnirspower.pipeline.run_variance( ... % subject_ids, paths, mesh_path, nirsmodel_path, layout_mat, ...) % % Description % -...
7a32b8f6fb3093b8aa000557a30936db439d4ba372694863f9cf733835411f85
MATLAB
11,400
245
function spectralevents_vis(specEv_struct, timeseries, TFRs, tVec, fVec) % SPECTRALEVENTS_VIS Conducts basic analysis for the purpose of % visualizing dataset spectral event features and generates spectrogram % and probability histogram plots. % % SPECTRALEVENTS_VIS(specEv_struct,timeseries,TFRs,tVec,fVec) % % In...
43c3b32cf1c97613b4762c79764b8eefd23e0526785f2ee1f8020f4c9b3958fb
MATLAB
11,407
289
function varargout = channel_ar_gui(varargin) % CHANNEL_AR_GUI MATLAB code for channel_ar_gui.fig % CHANNEL_AR_GUI, by itself, creates a new CHANNEL_AR_GUI or raises the existing % singleton*. % % H = CHANNEL_AR_GUI returns the handle to a new CHANNEL_AR_GUI or the handle to % the existing singleton...
84fc13a524156ce0182bf03f3b4b2b0b16dd57172343708622831b8a36df3403
MATLAB
11,413
341
function [map,stats] = Map(v,z,varargin) %Map - Map z on (x,y) where x, y and z are time-varying variables (samples). % % Compute a continuous map, where one time-varying variable z is represented % as a function of one or two time-varying variables x and y. The variable z % can either be a point process (typically...
e33a8f3cbce2760f9ccb72225c06bebd00b67375c46a00d4cc94942edbf51409
MATLAB
11,413
233
function [belowThreshFlag3D, fractionFlagMat3D, avgPval, coefMat4D] = explainIndCellsMvrgWithRand(testResults, spekLabelBase, smLabelBase, sigThreshInput) %EXPLAININDCELLSMVRGWITHRAND calculate significances for multivariate regression results of randomized data of individual cells % %SYNOPSIS: [belowThreshFlag3D, fra...
b35f204a250b2a6993431e68c097c10697c8e1b204769951550a3c9353a93dc5
MATLAB
11,426
312
% ==================================== %% Help % ==================================== % % CBIG_language_prediction % % This script generates full (all-run) individual-specific brain parcellations % for NIH subjects with known language task laterality (L/B/R), then computes % the language laterality index (LI) for each ...
0ceca20eebeda33c3292ba54a99c039d2806a49975a2285f8128e4fb529886ab
MATLAB
11,427
276
function varargout = ea_vatsettings_dembek(varargin) % EA_VATSETTINGS_DEMBEK MATLAB code for ea_vatsettings_dembek.fig % EA_VATSETTINGS_DEMBEK, by itself, creates a new EA_VATSETTINGS_DEMBEK or raises the existing % singleton*. % % H = EA_VATSETTINGS_DEMBEK returns the handle to a new EA_VATSETTINGS_DEMB...
d0748a2936e867459ec2beffbf533f85d527e57a58237b6ba689798d4f433e36
MATLAB
11,432
266
function CFA_CheckData % uiwait(msgbox({'Currently, it only used for two conditions:',... % '1. Data after regrouped but before normalization.',... % '2. Data after normalization.'})) PG = uigetdir(pwd,'Check Data'); % PGout = uigetdir(pwd,'Result Picture directory'); [pth nam ext] = fileparts(PG); PGout = [pth...
b41b8517eaf316c541743b5a19b2eaf1eef3c444fc5b4755fe15e0f699809c0f
MATLAB
11,435
314
function ea_create_tpm_darteltemplate(mute) if exist([ea_space,'TPM.nii'],'file') && ~ea_checktpmresolution && exist([ea_space,'.tpm'],'file') return end if ~exist('mute','var') answ=questdlg('Lead Neuroimaging Suite needs to generate some files needed for the process. This only needs to be done once but will ...
fb099b8f931e997fed8d261fee45fe3de64d0b8391aac581a560c982413640e9
MATLAB
11,440
233
function options = NoRMCorreSetParms(varargin) % Struct for setting the NoRMCorre algorithm parameters. Any parameter that is % not set gets a default value % Author: Eftychios A. Pnevmatikakis % Simons Foundation, 2016 Names = [ % dataset info 'd1 ' % number of rows ...
32d9bdf00f8884bb4867eaca94052d52f663075161415e63ba2178728ebe94c5
MATLAB
11,455
325
% jader() - blind separation of real signals using JADE (v1.5, Dec. 1997). % % Usage: % >> B = jader(X); % >> B = jader(X,m); % % Notes: % 1) If X is an nxT data matrix (n sensors, T samples) then % B=jader(X) is a nxn separating matrix such that S=B*X is an nxT % matrix of estimated source signals. % 2)...
d2c262fb2f302a5d092be68aa18b5c31fb61189b5f6e1cf1d1641c593701f9b9
MATLAB
11,458
265
function ClincFreq_ClinWeiLocationStat(INDIR,OutWeiLocdir,SetUpPara,Para,VolLab,ClincWei) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; Dvol = sum(D)'; Dvole = sum(D,2); IgV = Para.IgP; indexs = find(Dvole>=(size(D,2)*IgV/100)); Dmasked = zeros(V.dim); Dmasked(index...
a26189c7981c22ce6db5c30955e71eaef21f7c2f9b225f0dccf3fa56ca16496d
MATLAB
11,460
297
function [EMGFromLFP] = bz_EMGFromLFP(basePath,varargin) % USAGE % [EMGCorr] = bz_EMGCorrFromLFP(basePath) % % INPUTS % basePath - string combination of basepath and basename of recording % example: '/animal/recording/recording01' % % (Optional) % 'restrict' ...
fdef93abe9ad8bb79e727c9f4260c30a76dbb5246be5708877b3344d603ebbb1
MATLAB
11,473
333
function [specslope,spec] = bz_PowerSpectrumSlope(lfp,winsize,dt,varargin) %[specslope] = bz_PowerSpectrumSlope(lfp,winsize,dt) calculates the %slope of the power spectrum, a metric of cortical state and E/I balance %see Gao, Peterson, Voytek 2016; Waston, Ding, Buzsaki 2017 % %INPUTS % lfp a buzcode-formatt...
e81d2755f1c36dd89e78f8334ea4c479c9ddb2b2b19063fd9fd07b8f0a9128b6
MATLAB
11,485
239
function vw = videoWriter(url, varargin) % videoWriter class constructor % Creates a object that writes video files. We use a plugin % architecture in the backend to do the actual writing. For example, % on Windows, DirectShow will typically be used and on Linux, the % ffmpeg library is often used. %...
43215141b13cb31b2409b9f65c4735a04d3fc942daacfee1f2cdf28c1a0eff14
MATLAB
11,493
253
function [Cmn,Phimn,Smn,Smm,f,ConfC,PhiStd,Cerr] = coherencyc_unequal_length_trials( data, movingwin, params, sMarkers ) % This routine computes the average multi-taper coherence for a given set of unequal length segments. It is % based on modifications to the Chronux routines. The segments are continuously structu...
10c024244f93cbd6feb9feda6dc43e4986479e342d57f5f02c4a3992de9dfe4d
MATLAB
11,505
283
function [output, Greg] = dftregistration_min_max(buf1ft,buf2ft,usfac,min_shift,max_shift,phase_flag) % function [output Greg] = dftregistration(buf1ft,buf2ft,usfac); % Efficient subpixel image registration by crosscorrelation. This code % gives the same precision as the FFT upsampled cross correlation in a % small fra...
828807356ab1a9da046083cae465eb2b975ddafd72ecc7e23cf12b015c5b5f1b
MATLAB
11,506
323
%%***************************************************************************** %% sqlp: solve an semidefinite-quadratic-linear program %% by infeasible path-following method. %% %% [obj,X,y,Z,info,runhist] = sqlp(blk,At,C,b,OPTIONS,X0,y0,Z0); %% %% Input: blk: a cell array describing the block diagonal structu...
55f20514883c4272e78459091c96de5ab99953d54404b62a035ab29a18c657f4
MATLAB
11,510
249
classdef KTUEAImpedanceFile % Plots a graphical representation of the impedance data collected by % Cerebus and saved in a text file. % % Usage: % % plotImpedances(mapfile) % % WHERE: % % mapfile: Is the mapfile structure obtained with mapfileLoader % function that maps the electrode...
80093b1a0ef4ae4443b50ad923583e45214a831669882fc3489e9a8a883bc81c
MATLAB
11,526
396
function [VertPos, CellList] = make_voronoi_pbc_fast(cx, cy) % MAKE_VORONOI_PBC_FAST Build a periodic Voronoi tessellation from a set % of cell-center seed points, to use as the initial vertex-model geometry. % % [VertPos, CellList] = MAKE_VORONOI_PBC_FAST(cx, cy) computes the % Voronoi diagram of the seed points ...
44aa4cff512e16521a337d6a174e44f674dfb50c3543413cdf9c8777ca5e0993
MATLAB
11,529
269
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% demo_eigenmode_analysis.m %%% %%% MATLAB script to demonstrate how to use surface eigenmodes to analyze %%% fMRI data. In particular, the script demonstrates how to %%% (1) reconstruct a task fMRI spatial map, %%% (2) reconstruct a resting...
f96c2ba52b7261f95aade541df90cbae5876606006e93f691eccbc1b6d50ad91
MATLAB
11,532
383
function stackview(hr,showfun) if nargin == 1, showfun = @(x) imagesc(x,[0 1]); end; [ds.maps cmap] = compMesoParams(hr); ds.img = ds.maps(:,:,:,4); ds.hr = hr; dirs = load('dwidirections'); ds.dirs256 = [dirs.dirs256 -dirs.dirs256]; ds.modelstruc = evalin('base','modelstruc'); proto.ten = hr.user.bTensor; pr...
915c34e3e00921f575da9f14968babcedf7ea2ffdf285a43ef180b0782e932c0
MATLAB
11,548
358
%%****************************************************************** %% ops: %% %% Z = ops(X,operand,Y,alpha); %% %% INPUT: X = a matrix or a scalar %% or a CELL ARRAY consisting only of matrices %% operand = sym, transpose, triu, tril, %% real, imag, sqrt, abs, ...
ceb77f9a2d01130690b9f5d4cd0b20ffb43a2b424d58a1a7fd3338f60c82865c
MATLAB
11,554
267
function [probMotionType,motionChar,errFlag] = summarizeDiffAnRes(tracks,... minTrackLen,probDim,diffAnalysisRes,extractType) %SUMMARIZEDIFFANRES calculates motion type probabilities and motion characteristics from diffusion analysis % %SYNOPSIS [probMotionType,motionChar,errFlag] = summarizeDiffAnRes(tracks,... % ...
580c69d531f8f4c99a1144464f1cbde005e61c8373c25882e7e2d8f7505cb54e
MATLAB
11,563
277
classdef KTUEAMapFile % UEAMAPFILE -- Defines a class that contains information on a UEA % electrode array using CMP files provided by Blackrock Microsystems. % % To load a CMP file type 'MapName = UEAMapFile' where MapName is the name % of the variable that will be created and will contain the map class. % % ...
78e0e25e7957dd98dd21c78c60d6260dd4c170cad9beaaf715d7a4b7009a236e
MATLAB
11,582
346
function [map,stats] = Map(v,z,varargin) %Map - Map z on (x,y) where x, y and z are time-varying variables (samples). % % Compute a continuous map, where one time-varying variable z is represented % as a function of one or two time-varying variables x and y. The variable z % can either be a point process (typically...
c14b918a842d27d41ede050dcbb7f5a36522c03bea8357ac109ae9ed1b2e8c0a
MATLAB
11,608
232
function HispeedTrials = assignTrialsToVideos(videoDir) % Check if the correct directory was chosen % The user has to pick the overall 'videos' folder, not a hispeed folder if ~exist(videoDir,'dir') error('The given folder doesn''t exist.') elseif ~endsWith(videoDir,'videos') error('Incorrect directory. \n%s'...
c3d792be74c98c07f1333c310fb20f56f69ea4d9d8d411a8f75a47a16ec5917f
MATLAB
11,612
356
function [c, s, kernel, iter] = deconvCa(y, kernel, smin, fit_gt, debug_on, sn, maxIter, theta, lambda) %% deconvolve calcium traces to infer spike counts %% inputs: % y: 1*T vector, observed calcium traces % kernel: struct variable with two fields {'fhandle', 'pars', nMax}. kernel % deterines the convolution ke...
3e961141a5cd5bc78153a3b67f0438d951744981d9e2017304ee3d2cc5fb059b
MATLAB
11,627
348
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color addpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') %% ======================= step 1 for disposal all data %% input data step05_retest_00_init; step01_CBFandCCSImaps_00_init; %% compute cosine si...
46e3836275aee650b1887bcea2b376909acf5293e49601a188ddf835b3eb5922
MATLAB
11,643
301
%% Simulate geometric and hybrid response, optimal stimulus % hybrid connectivity has one FNP clear; clc; % Load model parameters loadparam; % Optimal stimulation (stimulus placed at source of FNP) stim.stimR = hetparam_het.a; % Compute timestep and grid spacing dx = topology.L / topology.Nx; dt = topology.T / topol...
74e349ffd087a1e1a7c9d09aa2e444a97160a28489d33766c389394dbd618e57
MATLAB
11,644
280
function [a, r2, out_a, out_l] = dfa(ts, n_min, n_max, n_length, plotOption) % [a, r2, n_bp, n, n10, F,F10, F_fit, n_fit, Xave, Yave, logF_fit] = dfa20200727(ts, n_min, n_max, n_length, plotOption) % Inputs - ts, input time series % n_min, minimum box size (default n_min = 10) % n_max, maximum box ...
3635b6957717fe017c3d62ec986f3d2f490ef81496e0b415207f05f7598ff620
MATLAB
11,654
276
function [parameters] = LoadParameters(filename) %LoadParameters - Load parameters from an XML file. % % USAGE % % parameters = LoadParameters(filename) % % filename parameter file name % -or- % basePath where the parameter file baseName.xml lives % Copyright (C) 2004-2011 by Mic...
bf8567e826aba54c26f7e05a137bc2fbe5477d102c4e5e94002ad109cd11092d
MATLAB
11,662
221
function PlotRippleStats(r,m,d,s,varargin) %PlotRippleStats - Plot descriptive stats for ripples (100~200Hz oscillations). % % USAGE % % PlotRippleStats(ripples,maps,data,stats,<options>) % % Use the ouputs of <a href="matlab:help RippleStats">RippleStats</a> as input parameters. Using cell arrays of % repea...
c8a873117b5494b7aa2718cfce084a03229334a3dd991a3022af9640a546a1b4
MATLAB
11,688
320
% function testscript(pname,direction,movingwin,segave,params,fscorr) % % This script runs a sequence of analysis steps using the test % data contained in data. The data consists of a single tetrode % recording from macaque area LIP during a memory saccade experiment % a la Pesaran et al (2002). The data is already sep...
b6086796be32c4010a55f919a5d98f533462739d57bcecfa10c08fa8cf4d782a
MATLAB
11,705
375
function [ cvx_optpnt, mode ] = geo_mean_cone( sx, dim, w, mode ) %GEO_MEAN_CONE Cones involving the geometric mean. % GEO_MEAN_CONE(N), where N is a positive integer, creates a column vector % variable X of length N and a scalar variable Y, and constrains them to % satisfy GEO_MEAN(X) >= Y and X >= 0. That i...
6d95c999e1a89a917fc104c880d14865e8b82def04cd540fbb5ffebe4df1021a
MATLAB
11,729
219
%% refitElec - refits a previously extracted corse electrode model using % ptimal oblique samplingto increase accuracy and enable % automatic contact localisation. Intital refitting % ("2nd pass" is followed by a final "3rd pass" to % calibrate the point of origin...
16897bc28957f205c3e16967ff2f596ea6d90ee9f949343e54a83412d9fedb4b
MATLAB
11,743
265
function movieData = condColocPt2Pt2BlobWrapper(movieData, paramsIn) %CONDCOLOCPT2PT2BLOBWRAPPER applies colocalization method described in condColocPt2Pt2Blob to a MovieData file % % movieData = condColocPt2Pt2BlobWrapper(movieData, paramsIn) % % Applies colocalization method described in condColocPt2Pt2Blob to three...
0fa324bb76eff9d1352d6358575b73a89d223ab5406f078ef8fa58cecd53fa23
MATLAB
11,752
367
function runstim_THINGS(T_Trl) global Par %global parameters Par.Mouserun = 0; dasusemouse( 0 ); preloaded_pics = 40; ncount = 4; monkey = 'monkeyF'; % cogstd('sPriority','high') LOG.fn = 'runstim_THINGS'; DateString = datestr(now,'yyyymmddHHMMSS'); % get date-timestamp ds_yyyymmdd = DateString(1:8)...
671d8d911f2f32b4e9db69721ee2d5513d8b3f65d6302b925714632aca05bb3e
MATLAB
11,755
367
function runstim_THINGS(T_Trl) global Par %global parameters Par.Mouserun = 0; dasusemouse( 0 ); preloaded_pics = 40; ncount = 4; monkey = 'monkeyN'; % cogstd('sPriority','high') LOG.fn = 'runstim_THINGS'; DateString = datestr(now,'yyyymmddHHMMSS'); % get date-timestamp ds_yyyymmdd = DateString(1:8)...
4646484dcd0001b46060cd2959815e2a2b3e7a120dda6dd3cd76eae09a183e5e
MATLAB
11,756
315
% eeg_getepochevent() - Return dataset event field values for all events % of one or more specified types % Usage: % >> epochval = eeg_getepochevent( EEG ); % >> epochval = eeg_getepochevent( EEG, 'key', 'val'); % % Inputs: % EEG - Input dataset % % Optional inputs: %...
cfaa04a3c8620f9bf42aa863a846c6dc198d48be5e58c7c4af01da86503e3903
MATLAB
11,759
367
function runstim_THINGS(T_Trl) global Par %global parameters Par.Mouserun = 0; dasusemouse( 0 ); preloaded_pics = 40; ncount = 4; monkey = 'monkeyN'; % cogstd('sPriority','high') LOG.fn = 'runstim_THINGS'; DateString = datestr(now,'yyyymmddHHMMSS'); % get date-timestamp ds_yyyymmdd = DateString(1:8)...
b310bb22b22bbd884006eea0b61ebb49eb9ae5615e3b3947fd66bc67f98617f3
MATLAB
11,769
316
%% prep_4_apply_signatures_and_save.m % % % *USAGE* % % This script % % # calls a_set_up_paths_always_run_first, then loads DAT/DATA_OBJ*/DATA_OBJ_CON* % from image_names_and_setup.mat/data_objects*.mat/contrast_data_objects.mat % if not already in the workspace % # calculates selected CANlab signature responses fo...
6ad3b84f69d4fd9fa98776e7ba42b69c8c3ba8a4fc8982cccca0243ba45d5fb9
MATLAB
11,772
228
function [fibsvalBin_proj, fibsvalSum_proj, fibsvalMean_proj, fibsvalPeak_proj, fibsval5Peak_proj, fibcell_proj, connFiberInd_proj,fibsvalBin_magn, fibsvalSum_magn, fibsvalMean_magn, fibsvalPeak_magn, fibsval5Peak_magn, fibcell_magn, connFiberInd_magn, totalFibers] = ea_discfibers_native_calcvals(vatlist, cfile, space,...
57381e012ee54e3704390f450e8b235b8d782c22707a6bbf2ad94db0a6c84668
MATLAB
11,773
314
% ==================================== %% Help % ==================================== % % CBIG_test_MSHBM_esfmri_inhomo % % This script replicates the electrostimulation-evoked network inhomogeneity % analysis from Lim 2026. Network labels are iterated directly as 1:15. % % PREREQUISITES: % Run CBIG_test_MSHBM_esfmri...
bfccd7cb76594a39b213d250f7e1ff90600a1e0bb852152928b68fbded7b5524
MATLAB
11,779
328
function bz_MakeXMLFromProbeMaps(probemaplist, basepath,basename,plugorder,defaults) %MakeXMLFromProbeMaps - Generate a .xml file to accompany .dat files for a %recording in the neuroscope/klusters/ndmanager system. Uses a library of %probe map layouts. % % USAGE % % MakeXMLFromProbeMaps(basepath,basename,ProbeFil...
1bc21c0dfa44639e64fe05d91b65bd97618fd1db8873cede051ba5a27a9cfad2
MATLAB
11,787
283
function [output, Greg] = dftregistration_min_max(buf1ft,buf2ft,usfac,min_shift,max_shift,phase_flag) % function [output Greg] = dftregistration(buf1ft,buf2ft,usfac); % Efficient subpixel image registration by crosscorrelation. This code % gives the same precision as the FFT upsampled cross correlation in a % small...
ac58c2628b6b51f06cc45da315f1aafe0802064c9464a254cf50c13a5d9c8957
MATLAB
11,813
301
function tracksReform = groupSegmentsComptracksAfterReformation( tracksIn) %groupSegmentsComptracksAfterReformation will rearrange compTracks to %have only the segments that interact % % SYNOPSIS tracksReform = groupSegmentsComptracksAfterReformation( tracksIn) % % INPUT % tracksIn : compTracks af...
39bc2a930e91182f1849121a86734c83a7db17fa7c96f00c62ca41f61a9403e6
MATLAB
11,836
394
function [c,lags] = ea_xcorr(x,varargin) %XCORR Cross-correlation function estimates. % C = XCORR(A,B), where A and B are length M vectors (M>1), returns % the length 2*M-1 cross-correlation sequence C. If A and B are of % different length, the shortest one is zero-padded. C will be a % row vector if A is a ro...
be383da42883ec32f447d45a392c879136e0fb56091ecaad906f280c15f43762
MATLAB
11,840
253
function [I,Ihat,cvs,val_struct]=ea_unifiedmapping_crossval(viz,explorer,strategy,iterations,posthoccorrect,customconfig) if ~exist('customconfig','var') customconfig=[]; end switch explorer.multitractmode case 'Split & Color By Group' if ismember(strategy(1:6),{'Custom','Import'}) ea_erro...
bf679bd000dd4387dbd40425652ba2d7151901b4a9c22bf3eaf3f4425b9c3b8d
MATLAB
11,852
228
function [fibsvalBin_proj, fibsvalSum_proj, fibsvalMean_proj, fibsvalPeak_proj, fibsval5Peak_proj, fibcell_proj, connFiberInd_proj,fibsvalBin_magn, fibsvalSum_magn, fibsvalMean_magn, fibsvalPeak_magn, fibsval5Peak_magn, fibcell_magn, connFiberInd_magn, totalFibers] = ea_unifiedmapping_native_calcvals(vatlist, cfile, sp...
752456f9df8752125d7cd82bfc6fd02fe528480bffe88e5585de2a633caf14be
MATLAB
11,856
273
% pop_jointprob() - reject artifacts in an EEG dataset using joint % probability of the recorded electrode or component % activities observed at each time point. e.g., Observing % large absoluate values at most electrodes or components % is im...
c85323246075a3dbfcae5c1d7b5bb12f243c20e568fb579138d3b36df2c1ce96
MATLAB
11,860
339
%%***************************************************************************** %% HSDsqlp: solve an semidefinite-quadratic-linear program %% by infeasible path-following method on the homogeneous self-dual model. %% %% [obj,X,y,Z,info,runhist] = %% HSDsqlp(blk,At,C,b,OPTIONS,X0,y0,Z0); %% %% Input: blk: a cel...
98a04130b420f983b3d8cc27494c4e3dc37343b98d6e97b4ae1e757877455daa
MATLAB
11,874
278
function ea_perform_lc(options) % This function is the main execution function of LEAD-DBS Connectome. % __________________________________________________________________________________ % Copyright (C) 2014 Charite University Medicine Berlin, Movement Disorders Unit % Andreas Horn % BIDS fix: Ensure options.prefs ha...
537d6f7b01cce88da8aec5ce9ac3c67d4dbbe029c9a60fb7e84d3de9b0921696
MATLAB
11,877
212
close all %% NK1R Figures % tmpfix=zeros(size(dyn1l1p0a_nk1r_bioall.tt)); tmpfix(502:901)=1; tmpfixS=zeros(size(dyn1l1p0aS_nk1r_bioall.tt)); tmpfixS(502:601)=1; tmpfixL=zeros(size(dyn1l1p0bL_nk1r_bioall.tt)); tmpfixL(502:1501)=1; figure(1), clf, subplot(231), plotmsd4(dyn1l1p0a_nk1r_bioall.tt,mean(dy...
0cfcab17839192057b78b81d730ab137cb5aa7488b30db9d3859a1fa6619b40c
MATLAB
11,884
197
function [signal, ref_section] = RFT_clean_asr(signal,cutoff,windowlen,stepsize,maxdims,ref_maxbadchannels,ref_tolerances,ref_wndlen,usegpu,useriemannian,maxmem) % Run the ASR method on some high-pass filtered recording. % Signal = clean_asr(Signal,StandardDevCutoff,WindowLength,BlockSize,MaxDimensions,ReferenceMaxBadC...
93f0b2df5c896a638cb4efb533c9c22a2eccb5f3eca98ec8749fc8c07d095b15
MATLAB
11,928
317
%% LaBGAScore_mrs_run_osprey_GE.m % % % *USAGE* % % This script runs Osprey analysis of mrs data organized according to % standard LaBGAS file organization by calling, for each voxel, that % study's own renamed copy of the Osprey jobfile template % (LaBGAScore_mrs_osprey_jobfile_GE.m or, if nr_sess = 1, % LaBGAScore_mr...
659d330a641fefcaedd23bbcc79560ae373fdfe57085b100b924ff8465e63656
MATLAB
11,948
321
classdef Grid < uix.Box %uix.Grid Grid % % b = uix.Grid(p1,v1,p2,v2,...) constructs a grid and sets parameter % p1 to value v1, etc. % % A grid lays out contents from top to bottom and left to right. % % See also: uix.HBox, uix.VBox, uix.GridFlex % Copyright 2009-2016 The ...
0d7b4bc1da607d437ab5eb833081b3e0eb078870303d83cfb001ba2a30ad6982
MATLAB
11,951
391
function uTest_FilterM(doSpeed) % Unit test: FilterM % This is a routine for automatic testing. It is not needed for processing and % can be deleted or moved to a folder, where it does not bother. % % uTest_FilterM(doSpeed) % INPUT: % doSpeed: If ANY(doSpeed) is TRUE, the speed is measured. Optional. % OUTPUT: % On...
6f9634ab922c1b9304bde5f4003a16dee37dbbe12b6be3b0d57f31f0f6fdfd0d
MATLAB
11,957
317
%% LaBGAScore_mrs_run_osprey_Philips.m % % % *USAGE* % % This script runs Osprey analysis of mrs data organized according to % standard LaBGAS file organization by calling, for each voxel, that % study's own renamed copy of the Osprey jobfile template % (LaBGAScore_mrs_osprey_jobfile_Philips.m or, if nr_sess = 1, % LaB...
569dc242a698d1a3876ddbaf951ae9fd6a5a6427c644eba587dd4853b0f2fa49
MATLAB
11,976
278
% std_figtitle() - Generate plotting figure titles in a cell array % % Usage: % >> celltxt = std_figtitle(key1, val1, key2, val2); % % Inputs: % 'subject' - [string] Subject name % 'datatype' - [string] data type (For example 'erp') % 'chanlabels' - [cell array or string] channel names % 'compnames'...
1e574a3ebd969519b01241b752de62b6f5390a30f9998ec00b9a47404df15181
MATLAB
11,982
340
% run combineFlies.m first to get 'leftall', 'leftmeans', 'rightall', % 'rightmeans' for n= 1:8 fn = fieldnames(leftall{n}); for f = 1:numel(fn) summarymeanL(f,n) = mean(mean(leftall{n}.(fn{f})(:,27:52))); summarymeanR(f,n) = mean(mean(rightall{n}.(fn{f})(:,27:52))); % summarym...
7cd780b2d103f1a71e9e5794ec7bf7fc46a522ede76c40952280f07a59a9f3cf
MATLAB
11,985
470
function z = xmltools( arg, out_file, varargin) % XMLTOOLS - tools for managing xml data sets % - if arg is a string : arg is an XML file to convert into MATLAB struct % - if arg is a variable : it is a MATLAB struct to write into XML, to stdout if out_file is not given % use : % z = xmltools('filename.xml')...
91c1f89352997a733c7717c3f3027d414c62ef304f740578123a5868600cccd3
MATLAB
11,992
438
function [varargout] = rdir(rootdir,varargin) % RDIR - Recursive directory listing % % D = rdir(ROOT) % D = rdir(ROOT, TEST) % D = rdir(ROOT, TEST, RMPATH) % D = rdir(ROOT, TEST, 1) % D = rdir(ROOT, '', ...) % [D, P] = rdir(...) % rdir(...) % % % *Inputs* % % * ROOT % % rdir(ROOT) lists the specified files. % RO...
fa69b579f7cf533cf3eb53f19bc629b3d58362ae93bd3fb8c5c09a4c72882d5b
MATLAB
12,008
320
% function testscript(pname,direction,movingwin,segave,params,fscorr) % % This script runs a sequence of analysis steps using the test % data contained in data. The data consists of a single tetrode % recording from macaque area LIP during a memory saccade experiment % a la Pesaran et al (2002). The data is alread...
6969edd57f09ca998cdda57a4717858a5c0a27de43b596a4f021507cb8268f1c
MATLAB
12,015
331
function File = GetFullPath(File, Style) % GetFullPath - Get absolute canonical path of a file or folder % Absolute path names are safer than relative paths, when e.g. a GUI or TIMER % callback changes the current directory. Only canonical paths without "." and % ".." can be recognized uniquely. % Long path names (>259...
68e93adca9be7dba1dde039054a14004c85c00973ac7b44d7a80d218281d6617
MATLAB
12,024
290
function varargout = ea_subcorticalrefine(varargin) % EA_SUBCORTICALREFINE MATLAB code for ea_subcorticalrefine.fig % EA_SUBCORTICALREFINE, by itself, creates a new EA_SUBCORTICALREFINE or raises the existing % singleton*. % % H = EA_SUBCORTICALREFINE returns the handle to a new EA_SUBCORTICALREFINE or t...
c61be55588d4af9648d2dcfe953df288b1438d126e30ffb238ad549016497d6d
MATLAB
12,031
355
function [x, y] = lap(cc, NONLINK_MARKER, extendedTesting, augmentCC, noLinkCost) %LAP solves the linear assignment problem for a given cost matrix % % A linear assignment tries to establish links between points in two sets. % One point in set A can only link to one point in set B and vice versa. % The cost associ...
59ea4f8d00244231582f0f5991f53879f946e367e07fecc89cb9c4067f8c6dad
MATLAB
12,037
321
% eeg_getdatact() - get EEG data from a specified dataset or % component activity % % Usage: % >> signal = eeg_getdatact( EEG ); % >> signal = eeg_getdatact( EEG, 'key', 'val'); % % Inputs: % EEG - Input dataset % % Optional input: % 'channel' - [integer array] read only specifi...
1b1b67e3f4785fe9f0e24e03aef806d83d196625900bfad49446d1fde97dafa9
MATLAB
12,041
334
function hcb=colorbarf(cout,H,loc) % COLORBARF Display color bar for a filled contour plot. % ========================================================================= % colorbarf Version 1.5 19-Feb-2001 % % Usage: % colorbarf(cout,H,[loc]) % % Example: [cout,H,cf]=contourf(peaks); % colorbarf...
645697d2226560ac9a771e86f3ed99687ca1b3d6819aef2c5b17e93844b2c93f
MATLAB
12,065
268
ccc; RAWDATAPATHs = dir("..\MAT Data\raw\**\7-10Freq Active\**\*.mat"); % Date filter DATESTRs = {'cc20220520', 'cc20220706', 'cc20220801', 'cc20221014', 'cc20221015', ... 'xx20220711', 'xx20220812', 'xx20220820', 'xx20220822', 'xx20220913'}; RAWDATAPATHs = RAWDATAPATHs(contains({RAWDATAPATHs.name}, DATE...
2e0fcdf9f8d26bec277916e281698cabea9ff3e5a3812d9fab679a2231e62966
MATLAB
12,075
308
function mixtures = generateMixtures(targets,interferers,varargin) %GENERATEMIXTURES Generate arrays of mixtures from targets and interferers. % % MIXTURES = IOSR.BSS.GENERATEMIXTURES(TARGETS,INTERFERERS) generates an % array of MIXTURE objects using SOURCE objects TARGETS and INTERFERERS. % Each mixture object ...
6f961ee56b00528084db619a0b0e1e3e471c9585b54a23dbd4e15dffce91a8ea
MATLAB
12,094
238
% std_clustread() - this function has been replaced by std_readdata() for % consistency. Please use std_readdata() instead. % load one or more requested measures % ['erp'|'spec'|'ersp'|'itc'|'dipole'|'map'] % for all components of a specified clus...
33ab0b86a505b897c5d7dd35ef7bdfea7eb09d6486e896fb56c5b491e795fb63
MATLAB
12,150
414
%% Create and plot design matrices %% % Create and plot your own design matrix easily using CANlab tools! % Note: This also requires SPM software functions % % These functions are useful for design simulations. They use the following % core functions, which may also be useful to use separately if you are % doing simul...
f2d8c86085d4c0bb1b9b61628e2750ac434fa131b2f891af4c1f605ba67abc01
MATLAB
12,164
297
%% Create raster_data.mat files for The Neural Decoding Toolbox % For each unit the code depends on a particular file, with three % variables: raster_data, raster_labels, and raster_site_info % raster_data: matrix as [num_trials x num_time_points] % time points could be bins of milliseconds with either a spike (= 1) or...
5861afa8853acfa7a93ae7352708d45891432826cef9ff21b221ef7f4374819d
MATLAB
12,184
387
% envproj() - plot envelopes of projections of selected ICA component % projections against envelope of the original data % % Usage: >> [envdata] = envproj(data,weights,compnums); % >> [envdata] = envproj(data,weights,compnums, ... % title,limits,chanlist,compn...
4093c82e5cf1b8868cad4a290fc4c55505b051bba835d175c0fd720fef6ea572
MATLAB
12,186
279
% mtimesx does a matrix multiply of two inputs (single, double, or sparse) %****************************************************************************** % % MATLAB (R) is a trademark of The Mathworks (R) Corporation % % Function: mtimesx % Filename: mtimesx.m % Programmer: James Tursa % Version: 1.1...
05bfd20ebb222ae1b5487d5fac630ce5aa6319fc46c8f5226ce8ed5ea6258c2b
MATLAB
12,206
381
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')); end %% ======================= step 1 ...
61ece73e909536fd0c92573eab9822b88c03d9fc7bc15721e9652568720f24d3
MATLAB
12,226
331
%% Calculate Cross SCF of p over ensemble of hybrid connectivities clear; clc; % Load model parameters loadparam; dx = topology.L / topology.Nx; dt = topology.T / topology.Nt; N = 100; num_connectomes = 10; % Create bins of dr and dt dist_bin_array = 0:0.02:0.2; delay_bin_array = 0:0.002:0.02; num_...
a133d087169eb5072e089a25ca657d13df651b0f42aa65fd8cc9fedb126bad8e
MATLAB
12,246
348
% Name: Robert Kim % Date: 04-04-2026 % Email: robert.f.kim@gmail.com % S6.m % Description: Script to analyze the weights of the trained models to understand the effect of lesioning. Used for Fig. S6 in the paper. clear; clc; % Add parent folder to MATLAB path for any helper functions used by this script addpath(ful...
fd0797cc6b0f76530cb49820fb00226dfe5781895471d54ae0e14c9eaed804b0
MATLAB
12,246
275
% F04_B.m % Manuscript Fig 4b: MB task-specific functional correspondence. % Input tables are read from manuscript_figure_source_data/data/main_text_source_data.xlsx. clear all ROI={"Dorsal", "Lateral","Ventral"} %% read dataTables Fig4b=read_main_text_source_table("fig4b_points"); Fig4b_noiseCeiling=read_main_text_so...
70e367a031ccc10687e72c6800064beb6a8a2b21cff08ad6bddbf927ee26c292
MATLAB
12,259
304
classdef fastBSpline %fastBSpline - A fast, lightweight class that implements %non-uniform B splines of any order % %Matlab's spline functions are very general. This generality comes at %the price of speed. For large-scale applications, including model %fitting where some components of the mode...
f33b276b5061ef68337fbb8c60bf0c1227db2bfab3d23fedba76e3c332a3f351
MATLAB
12,275
396
function editor(tree) %XMLTREE/EDITOR A Graphical User Interface for an XML tree % EDITOR(TREE) opens a new figure displaying the xmltree object TREE. % H = EDITOR(TREE) also returns the figure handle H. % % See also XMLTREE if ~isempty(getfilename(tree)) title = getfilename(tree); elseif ~isempty(inputname(1)...
29c2c0819ca0196f8fc6583b6db89fdf7ab419b30ee9758e7f31fba6693a94fe
MATLAB
12,293
175
function [hessian_mat, sorted_eigenvalues, sorted_eigenvectors] = get_qvm_hessian(V,C,KP,P0,KA,A0,strain) % GET_QVM_HESSIAN Build the vertex-model energy Hessian and return its % eigen-decomposition, under Lees-Edwards (sheared) periodic boundary % conditions. % % [hessian_mat, sorted_eigenvalues, sorted_eigenvector...
70c3e53c6f085f8526cb4ca0d6bb56d0e10599d6f5981fa4643867e37dd43b28
MATLAB
12,304
304
function res = saveastiff(data, path, options) % options.color % : true or FALSE % : If this is true, third dimension should be 3 and the data is saved as a color image. % options.compress % : 'no', 'lzw', 'jpeg' or 'adobe'. % Compression type. % 'no' : Uncompressed(Default) % 'lzw' :...
f775a52578e0b9fd2f4d5409e57eeb79c8ba88638f038245a8f532e6b6407530
MATLAB
12,314
324
function [label_matched, table_matched] = ... CBIG_gwMRF_match_yeo2011(alex_annot, yeosplit_annot, hemi, network_name, k, p, reorder_idx) % [label_matched, table_matched] = ... % CBIG_gwMRF_match_yeo2011(alex_annot, yeosplit_annot, hemi, network_name, k, p, reorder_idx) % % This function match the Schaefer20...
88a81d873687d267b984d4f1851039771f9e688a9ee81405f8b1a3c8621200a0
MATLAB
12,328
282
% pop_editoptions() - Edit memory-saving eeglab() options. These are stored in % a file 'eeg_options.m'. With no argument, pop up a window % to allow the user to set/unset these options. Store % user choices in a new 'eeg_options.m' file in the % ...
f80c2b65abb4b290e80c9953608d84301ed54681c671d2764f8698d01d81a1db
MATLAB
12,328
392
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function [img,hdr] = load_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB) if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var') error('Usage: [img,hdr] = ...
df91007486a3e700fa35ddb3dc4f42db7ecf766001ac26ac34494dff5170f59b
MATLAB
12,340
401
function options=ea_handles2options(handles) % main function converting GUI handles to options struct used in % ea_autocoord & ea_write (i.e. the main lead batch functions). %% some manual options that can be set: options.endtolerance=10; % how many slices to use with zero signal until end of electrode estimate. optio...
8d2ecae1cbf67a51cb100648e37a3b67fca4b21116c781c8b4282f6fda456fc0
MATLAB
12,376
311
% trtyps = {'OFneg90';'OFneg45';'OFzero';'OFpos45';'OFpos90'; % 'AFneg90';'AFneg45';'AFzero';'AFpos45';'AFpos90'; % 'OFAFneg90';'OFAFneg45';'OFAFzero';'OFAFpos45';'OFAFpos90'}; % trtyps = {'one';'two';'three';'four';'five';'six';'seven';'eight';'nine';'ten';'eleven';'twelve';... % 'thirteen';'fourteen';'f...
04e47f142b0252cd3b9956bc9154f78cf9bdced8845494ae0a2b775c28b0773b
MATLAB
12,415
177
function dE2_mat = get_dE2_mat_vm_LE(V,newC,K_A,K_P,A0,P0,strain) % GET_DE2_MAT_VM_LE Assemble the full Hessian (second derivative) matrix % of the vertex-model energy with respect to vertex positions, under % Lees-Edwards (sheared) periodic boundary conditions. % % dE2_mat = GET_DE2_MAT_VM_LE(V, newC, K_A, K_P, A0,...
38ff5ecca84dbdc2f8175803bd10a05f056963087c9bd9313373bf071d3e43d9
MATLAB
12,418
401
function editor(tree) %XMLTREE/EDITOR A Graphical User Interface for an XML tree % EDITOR(TREE) opens a new figure displaying the xmltree object TREE. % H = EDITOR(TREE) also returns the figure handle H. % % This is a beta version of <xmltree/view> successor % % See also XMLTREE %___________________________________...
8c20da63c91534e883a614d799c8be93ac11c46fe9f465950873e46ba2105661
MATLAB
12,430
278
% F04_A.m % Manuscript Fig 4a: MB task-to-stream assignment. % Input tables are read from manuscript_figure_source_data/data/main_text_source_data.xlsx. clear all close all ROI={"Dorsal", "Lateral","Ventral"} %% read dataTables Fig4a=read_main_text_source_table("fig4a_points"); Fig4a_noiseCeiling=read_main_text_source...
228fbf51eb90100cb420a12fc8ffa4ddfe0c74452b2e82b737b99a191b59c900
MATLAB
12,460
467
function z = xmltools_ss( arg, out_file, varargin) % xmltools_ss - tools for managing xml data sets % - if arg is a string : arg is an XML file to convert into MATLAB struct % - if arg is a variable : it is a MATLAB struct to write into XML, to stdout if out_file is not given % use : % z = xmltools_ss('...