sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
7ac03944fde52c5706bf4df5ced5143d5c63018f0b720235adea39379f77751a
MATLAB
12,468
164
function [warped] = warp_apply(M, input, method); % WARP_APPLY performs a 3D linear or nonlinear transformation on the input % coordinates, similar to those in AIR 3.08. You can find technical % documentation on warping in general at http://bishopw.loni.ucla.edu/AIR3 % % Use as % [warped] = warp_apply(M, input, met...
d02df8a7914de1de21fcde8b167799107c2f41faa7c0b61a7d53979cac445dc3
MATLAB
12,486
319
%% Using the atlas object for Region of Interest (ROI) analyses %% About the atlas object % An atlas-class object is a specialized subclass of fmri_data that stores % information about a series of parcels, or pre-defined regions, and in % some cases the probalistic maps that underlie the final parcellation. % % Some ...
0d2142f72f0436c76c04c0f643e4ba53d6a707b7e17515e0145940a163d56fad
MATLAB
12,505
366
% THIS SCRIPT RUNS BETWEEN-PERSON CONTRASTS % Assuming that groups are concatenated into contrast image lists. % Requires DAT.BETWEENPERSON.group field specifying group membership for % each image. % -------------------------------------------------------------------- % USER OPTIONS % USER OPTIONS % This is a standard...
e558b9d7743c84d7ffef11e87ad89f09f4edcc45879eead99d5f3412c96c5410
MATLAB
12,526
308
function [h,p,cr,ca] = TestRemapping(control,repeat,test,varargin) %TestRemapping - Test if firing fields remap (or shift) between two conditions. % % To test for random remapping between a control and a test condition, we % first estimate for each place cell the absolute field shift between the two % conditions, a...
ab91db1ec571956064f7eee1da67f73bd2ca2376aced29ff1c177f6e60c13c98
MATLAB
12,535
326
function [PCmean,PCstd,PCmax,PCmin,N] = perceptualCentroid(x,fs,varargin) %PERCEPTUALCENTROID Perceptual spectral centroid % % PCMEAN = IOSR.AUDITORY.PERCEPTUALCENTROID(X,FS) calculates the spectral % centroid of signal X, sampled at FS, with respect to mel-frequency. % % The algorithm first calculates the sp...
3058c08cb2da063950adaa5b0ad9447a4a3a8bc14adc8797fcb23ca18dfd92fc
MATLAB
12,554
317
function [M_final,shifts_g,template,options,col_shift] = normcorre_batch_even(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a...
852c25c2e9bb63980eb6db9b5c2c424657a549a91d7df29df23c148d5e65822e
MATLAB
12,573
102
%EEGLAB group processing (STUDY) functions (studyfunc folder): % <a href="matlab:helpwin compute_ersp_times">compute_ersp_times</a> - Computes the widest possible ERSP/ITC time window,... % <a href="matlab:helpwin neural_net">neural_net</a> - Computes clusters using Matlab Neural Net toolbox. % <a href="...
124347a9ddc7bc279cda02447bb011acb8e5c41b0f503438207ed79b491b0bc7
MATLAB
12,575
344
function [placeFieldStats] = bz_findPlaceFields1D(varargin) % [placeFieldStats] = bz_findPlaceFields1D(firingMaps) % Find place fields from 1D firing maps. Reads the output of bz_firingMapAvg % % INPUTS % % ========================================================================= % Properties Values % ...
3906bcc1fd4143880aca26ca05339ce0094dc4852596b027b4343213c5dbf452
MATLAB
12,582
106
%Miscelaneous functions not used by EEGLAB graphic interface (miscfunc folder): % <a href="matlab:helpwin abspeak">abspeak</a> - Find peak amps/latencies in each row of a single-epoch data matrix... % <a href="matlab:helpwin arrow">arrow</a> - Draw a line with an arrowhead. % <a href="mat...
63cf8dbdeba9d8486500f64316312af0f782c4dced374ddd5a6ba4480c3a84e8
MATLAB
12,583
342
%% 3-D volume visualization %% About volume visualisation % % Creating 3-D renderings of brain data and results can help localize brain % activity and show patterns in a way that allows meaningful comparisons % across studies. % % The CANlab object-oriented tools have methods built in for rendering % volume data on br...
6cbfc7f5ecb8c5a476666cc07f414d20e33f87c03e81554919cfd3fd533a4c22
MATLAB
12,593
229
% pop_importevent() - Import events into an EEG dataset. If the EEG dataset % is the only input, a window pops up to ask for the relevant % parameter values. % % Usage: >> EEG = pop_importevent( EEG ); % pop-up window mode % >> EEG = pop_importevent( EEG, 'key1', 'value1', ...); % % Gr...
33b9d34c7b426f4304e30f09c34c7a989d5bc787c11aebe455012f6219c9543d
MATLAB
12,606
251
% pop_autorej() - perform automatic artifact epoch detection and rejection % % Usage: % >> [EEG, rmepochs] = pop_autorej( EEG, 'key', 'val'); % % Inputs: % EEG - input EEG structure where epochs have been extracted. % % Optional inputs: % 'threshold' - [float] Threshold limit for detection of extremely la...
36d11472992187de25107e11421ed473eac9fd028ed5ed414adf308100764cf1
MATLAB
12,609
314
classdef ea_sweetspot < handle % ROI class to plot niftis on lead dbs resultfig / 3D Matlab figures % example: % figure; pobj.openedit=1; ea_sweetspot([spm('dir'),filesep,'toolbox',filesep,'OldSeg',filesep,'grey.nii'],pobj); a=light; axis('off','equal') % A. Horn properties (SetObservable) ...
47d670848d7ab089fb3fb02b185685c32dd69bd205ec312c82bad6b1c59933da
MATLAB
12,610
321
function varargout = ea_normsettings_ants(varargin) % EA_NORMSETTINGS_ANTS MATLAB code for ea_normsettings_ants.fig % EA_NORMSETTINGS_ANTS, by itself, creates a new EA_NORMSETTINGS_ANTS or raises the existing % singleton*. % % H = EA_NORMSETTINGS_ANTS returns the handle to a new EA_NORMSETTINGS_ANTS or t...
6cdf2c00344f04e3ca4cbc6b9bf2a40d8215b3c940956310ec8ccbc7dfebc32e
MATLAB
12,624
379
function ConvertPhyKilo2Neurosuite(basepath,basename,ks_basepath,varargin) % Converts Phy1 and kilosort1 or Phy2/kilosort2 output files into % klusters-compatible fet,res,clu,spk files. assumes a 16bit .dat, % .xml file is present in "basepath" (home folder) and that they are named % basename.dat and basename.xml...
2196911718444332d1bdac055effb6d270d0f292e43794d04f5fae29c2985fb5
MATLAB
12,629
314
classdef ea_sweetspot_hemi < handle % ROI class to plot niftis on lead dbs resultfig / 3D Matlab figures % example: % figure; pobj.openedit=1; ea_sweetspot_hemi([spm('dir'),filesep,'toolbox',filesep,'OldSeg',filesep,'grey.nii'],pobj); a=light; axis('off','equal') % A. Horn properties (SetObservable...
51f1c2e598902b3dd88baa1a6ea067a4cb1fdc3a8ce6a19ae6ad8db86f444fdd
MATLAB
12,644
294
%% Create schematic of correlation plot clear; clc; % Load model parameters loadparam; % Compute grid spacing dx = topology.L / topology.Nx; fig = figure; fig.Position = [100, 100, 520, 500]; ax = gca; set(ax, 'color', 'white'); axis off; hold on; xticks([]); yticks([]); xlim([0 topology.L]); ylim([0 topology.L]);...
933cd1a01615748ac74251eff842d9a1d1e279f9115069334f15032bc98d2d2f
MATLAB
12,652
329
% pop_saveset() - save one or more EEG dataset structures % % Usage: % >> pop_saveset( EEG ); % use an interactive pop-up window % >> EEG = pop_saveset( EEG, 'key', 'val', ...); % no pop-up % % Inputs: % EEG - EEG dataset structure. May only contain one datase...
c0fce2601a79a45ed2374ca579608132718a610a2aafe4a84ccd54ba8c82a0bf
MATLAB
12,657
454
function shim = cvx_sdpt3( shim ) % CVX_SOLVER_SHIM SDPT3 interface for CVX. % This procedure returns a 'shim': a structure containing the necessary % information CVX needs to use this solver in its modeling framework. global cvx___ if ~isempty( shim.solve ), return end if isempty( shim.name ), fname = 's...
deebda29b4590210dfa40ff71d0440d309fb6e9f7d3ee9d7d9214c39631ea164
MATLAB
12,675
258
function eps2pdf(source, dest, crop, append, gray, quality, gs_options) %EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, de...
9aa834c244bf849801ac806013bb20f252cdae8a2937aa7afaa889a51745f71a
MATLAB
12,680
326
function X = palm_miscread(filename,useniiclass,tmppath,precision) % Read various scalar data formats based on the file extension. % % X = palm_miscread(filename,useniiclass,tmppath,precision); % % filename : File to be read. % useniiclass : True/False. Use the NIFTI class when reading % NIFTI files. I...
509d18a131d5d345c131723bbf99f2b06447e1e263a1e92dde9567717f4c5ff6
MATLAB
12,698
341
function [coords_mm,trajectory,markers] = ea_refinecoords(options) %% Refine the fiducial markers following TRAC/CORE reconstruction % Last Revision: 18/05/2018 % Thushara Perera (c) 2018 Bionics Institute % Input: % - lead dbs options struct % Output: % - refined reconstruction is saved to file using ea_save_r...
92d3f36c605a7dfa93dc36c07621774db61628fa62bce9263a181ed715cd14e9
MATLAB
12,719
330
function [M_final,shifts_g,template,options,col_shift] = normcorre_batch_even(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a 3D % ...
f14d0dee3fae4589f9d01754bbd766e1f78de55d6693a4b60e5293427d03ef07
MATLAB
12,743
323
% std_pac() - Compute or read PAC data (Phase Amplitude Coupling). % % Usage: % >> [X times logfreqs ] = std_pac(EEG, 'key', 'val', ...); % Inputs: % EEG - an EEG dataset structure. % % Optional inputs: % 'components1'- [numeric vector] components in the EEG structure used % for spec...
5910f90c5eaf4072ef6f9fd680a95348a0cfab972de38a5581ff083b2bf241d2
MATLAB
12,748
267
function cm_data=viridis(m) cm = [[ 0.26700401, 0.00487433, 0.32941519], [ 0.26851048, 0.00960483, 0.33542652], [ 0.26994384, 0.01462494, 0.34137895], [ 0.27130489, 0.01994186, 0.34726862], [ 0.27259384, 0.02556309, 0.35309303], [ 0.27380934, 0.03149748, 0.35885256],...
7486d84073dd8f8bd5c0f50b9fcfef5d3af887fca937d94e009287a8ba47e70c
MATLAB
12,752
308
function varargout = ea_oss2optimizePAM(varargin) % Wrapper for OSS-DBS simulations. % By Butenko and Li, konstantinmgtu@gmail.com if nargin==2 S=varargin{1}; options=varargin{2}; elseif nargin==3 S=varargin{1}; options=varargin{2}; hFigure=varargin{3}; elseif nargin==1 && ischar(varargin{1}) % ret...
97ea68040889512f672a1aa45e159ce0c307004b6a97927272f301960de1b03b
MATLAB
12,773
265
function [pCompareTtestR,pCompareTtestL,outlierIndx1,outlierIndx2] = compareSigIndCellsMVRG(testResults1,testResults2,pSigTtest1,pSigTtest2,spekLabelBase, smLabelBase) %COMPARESIGINDCELLSMVRG compares multivariate regression results for two %groups of cells, each population % %SYNOPSIS: [pCompareTtestR,pCompareTtestL,...
4f77ecd7cfc873113af68d2ed685cf6bca9e08eaba92d1c0edb1a6a1f12fc463
MATLAB
12,803
425
function SANDIinput = investigate_exchange_effectes_NEXI_SANDI_RicianNoise_forGUI(SANDIinput, fig_axes) %% Investigate the effect of exchange. Create sythetic signal using a modified NEXI model, made of NEXI + spherical compartment % Read the input delta = SANDIinput.delta ; smalldel = SANDIinput.smalldel ; sigma_SHr...
8cb77114033a1c5d1b9741dc4c83c1420b42c7e02c5e7db9d210db1ad34c6aa5
MATLAB
12,812
373
function [x y pos trials map mapping] = getBehavEvents_with_Z(pos,bins) if pos(1,1) == 0 & size(pos,2) < 6 %% old code for LED tracking pos = [pos(:,2:5),pos(:,1)]; % assumes colomns 1/2 and 3/4 match scatter(pos(:,1),pos(:,2),'.r') hold on scatter(pos(:,3),pos(:,4),'.b') axi...
1db016ea4fe002b6fa0f99779ed6108e7f0b589c97c6ac5849a9056e1042ce8a
MATLAB
12,819
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 %___________________________...
cf74f26bc9c99424054e0442a86ceff2679db2753298bc3412a833917c627677
MATLAB
12,833
368
function R = LaBGAScore_dep_report(repodir, varargin) % % % *USAGE* % % Generates the dependency documentation for a repository: which external % functions each script calls, which repository each of those lives in, and % where static analysis could not give a definite answer. % % Writes three files into the repository...
0378f7a88952837357e4790bd90d9f3b8ce2740f8f0d745b0c69e15b60cbba79
MATLAB
12,861
278
% Name: Robert Kim % Date: 05-11-2023 % Email: robert.f.kim@gmail.com % visualize_cebra.m % Description: Plot CEBRA-3D trajectories for a chosen two-layer one-modality % (instr) RNN. Reads <cebra_dir>/<model_prefix>_*_cebra.mat (e.g. intact, % I->I lesioned, I->E lesioned, etc.) and renders one trace per trial in % 3-D...
804fb072045296d5cf58df94211da28a4cb17755e3f8f2e656a4699ccb6fb993
MATLAB
12,889
266
function DECODING_RESULTS = create_confusion_matrices_and_MI(cv, YTe, all_predicted_labels, DECODING_RESULTS) % A method to create confusion matrices for the zero-one loss and normalized rank results. % A confusion matrix is a matrix in which the columns express the true class label % and the rows express the pred...
af7578deae2e58adc86da3c0416c553f9712697788c31c092612aaa0e80951a2
MATLAB
12,890
317
function [X,Z,eCm,eCx,Y,imov,ifix,isdiscrete,istwotail] = palm_misspart(M,C,meth,my,mm,mcar,rmethod) % Partition the model for missing data, generating all the sub-models % that can later be subjected to NPC. % % Usage: % [X,Z,eCm,eCx,Y,Pidx,isdiscrete] = palm_misspart(M,C,meth,my,mm) % % Inputs: % M : Design ...
dfd659f423c2b93b21e2ff610d58df76691f0835466ee65f4e2367185a54f560
MATLAB
12,894
380
function [SleepScoreMetrics,StatePlotMaterials] = ClusterStates_GetMetrics(... basePath,SleepScoreLFP,motion,overwrite,varargin) %StateID(LFP,thLFP,EMG,sf_LFP,sf_EMG,figloc,WSEpisodes) % Detailed explanation goes here % %This function calucates the metrics for state scoring (EMG, Slow Wave %Power, Theta). It uses...
e2b0c2a96dc90af69342b6989c8984a74881b9d3ddeb07536ee1e315a8cabb80
MATLAB
12,907
361
% This version was derived from the original version by Pestilli and Caiafa. % Copyright (2015), Franco Pestilli (Indiana Univ.) - Cesar F. Caiafa (CONICET) % email: pestillifranco@gmail.com and ccaiafa@gmail.com % https://github.com/francopestilli/life available under % https://github.com/francopestilli/life/blob/mast...
12f325fea8c23d58fcf70239084c64b16ec32d414d6a35747559c8b3b88f80a9
MATLAB
12,931
275
function [positionDecodingBayesian] = bz_positionDecodingBayesian(varargin) % USAGE % [] = bz_positionDecodingBayesian() % % INPUTS % % spikes % % behavior % % plotting % % saveMat % % OUTPUTS % % positionDecodingBayesian cellinfo struct with the following fields % .UID % ...
9ad208a1b5f458f717b3cf7dbb6bca8ea7cc0d22eeb3ba4f366bba97a07e5931
MATLAB
12,952
336
function [RPVrate, RPVfraction, overestimateBool, estimatedTauR] = fractionRPviolations(theseSpikeTimes, theseAmplitudes, ... tauR, param, timeChunks, RPV_tauR_estimate) % JF, get the estimated fraction of refractory period violation for a unit % for each timeChunk % ------ % Inputs % ------ % theseSpikeTimes: nSpi...
0e527de818718f611f0d7d440b9c30c66534d4bc730ced8b3142a61d7931dc81
MATLAB
12,958
339
% eegplotgold() - display EEG data in a clinical format % % Usage: % >> eegplotgold('dataname', samplerate, 'chanfile', 'title', yscaling, range) % % Inputs: % 'dataname' - quoted name of a desktop global variable (see Ex. below) % samplerate - EEG sampling rate in Hz (0 -> default 256 Hz) % 'chanfile' - file of ...
e9253f3066129e50558f517b2ca1ab6568e08fefffe46a1cfe4e70e372527a3f
MATLAB
12,967
276
function [pSigTtest, outlierIndx, randResult, mvrgCoefStruct] = explainIndCellsMVRG(testResults, spekLabelBase, smLabelBase, sigThreshInput) %EXPLAININDCELLSMVRG displays multivariate regression results for individual cells and pick out outlier cells % %SYNOPSIS: [pSigTtest, outlierIndx, randResult, mvrgCoefStruct] = e...
3469b7b0755fa778687cd60ae2a05c2115b335cd3d5fc599af01ee6e5e1d7b52
MATLAB
12,974
415
function ea_segment_electrode(~,~,options,resultfig,onoff) directory=[options.root,options.patientname,filesep]; if options.native switch options.subj.postopModality case 'MRI' elnii = options.subj.coreg.anat.postop.ax_MRI; case 'CT' elnii = options.subj.coreg.anat.postop.CT...
1566900ac8bc8fda9b07ad28130a87bd7fae33e61e8def71e66e15121d172044
MATLAB
12,978
272
function res = FBmodel7(gust_res,p_PFNd,p_PFNv,p_PFNpc,p_PFNa,inits,heatmaps,plt) % This function will generate sinusoidal bumps in an eight-column space for % the compass/EB and in the PB and FB (for PFNs). It takes parameters % previously determined from fitting for timecourses of PFN calcium % intensity and b...
36661b76bd1ff942b32be06318c404ed354139c28056b5d5e5be34fee1068a54
MATLAB
12,991
291
% pop_reref() - Convert an EEG dataset to average reference or to a % new common reference channel (or channels). Calls reref(). % Usage: % >> EEGOUT = pop_reref( EEG ); % pop up interactive window % >> EEGOUT = pop_reref( EEG, ref, 'key', 'val' ...); % % Graphic interface: % "Compute averag...
ace619b752f3f888aea1b956c9869a382024b75819d44ba15044b47add6f9980
MATLAB
13,038
396
% phasecoher() - Implements inter-trial amp/coherence using Gaussian wavelets. % Returns same data length as input frames. % Plots results when nargin>6. Outputs have flat ends % at data indices [1:halfwin] and [frames-halfwin:frames]. % Usage: % >> [amps,cohers ] = pha...
6a79fd504c3a12003bf2eebe151465568bdac338a1f665a28af0febb3d026dee
MATLAB
13,043
343
function [d_min, varargout] = p_poly_dist(xp, yp, xv, yv, varargin) %p_poly_dist Find minimum distances from points to a polyline or to a % closed polygon. % % Description: % Compute the distances from each one of a set of np points p(1), p(2),... % p(np) on a 2D plane to a polyline or a closed polygon. Polyline is %...
698f74e9d83d9feb184df47ffb84a4e905686ff9e012dde61223fd7c9b1d2f7a
MATLAB
13,047
434
function [gridness, phi_v_cor, auto_corr, d] = Gridness2(self, cel, varargin) % Calculates the original gridness score of 'cel'. Continuizes all epochs. % % ARGUMENTS % % cel 1x2 vector indicating tetrode index and cell index % % RETURNS % % gridness a number indicating gridness score % period...
baf137104c9d853a8b9b210b9235000dd335a20244772bbe15ac190110104aa9
MATLAB
13,049
283
function [sigRes] = multiCompareAnovaIndCellsMVRG(testResultCellArr,pSigTtestArray,outlierIndxArr,spekLabelBase, smLabelBase, displSpacing) %MULTICOMPAREINDCELLSMVRG: compares multivariate regression results for multiple groups of cells by ANOVAN, sorted by motion types and SM property % %SYNOPSIS: [sigRes] = multiCom...
d4ffdc1242e2d31e5034309a14fd1b29bbf7232b9a7c7042500510332eb8eae1
MATLAB
13,049
282
% inputgui() - A comprehensive gui automatic builder. This function helps % to create GUI very quickly without bothering about the % positions of the elements. After creating a geometry, % elements just place themselves in the predefined % locations. It is especial...
f78d8c00d4d8e210b68d40b09a3e3defceaf9cc69cb461056d26156ecb6844a1
MATLAB
13,069
431
% binica() - Run stand-alone binary version of runica() from the % Matlab command line. Saves time and memory relative % to runica(). If stored in a float file, data are not % read into Matlab, and so may be larger than Matlab % can handle owing to memory limitations. % Usa...
15030fcc199b5ea9e34d3747f6e6a3fb59d01306dbc2128562b3550b7c0d0698
MATLAB
13,077
313
function alltrialstimecourse_multi(headpath,fileexpnum) %use this one when the data has been analyzed before and saved. %compare adjacent ROIs for activity differences cd('extracted2') savefilename=strcat(fileexpnum,'_analysis2'); load(savefilename); cd(headpath); %make a picker in here to select the ROI you want to l...
f68a4230d4eb184418d085c885f106813c28ff4e907496922c06b614b3fb8a8c
MATLAB
13,086
271
function [ results ] = plot_pass_index( varargin ) import CMBHOME.PASS_INDEX.*; ip = plot_pass_index_parser(varargin{:}); p = pass_index_parser(varargin{:}); for i = fields(p.Results)' eval([i{1} ' = p.Results.' i{1} ';']); end for i = fields(ip.Results)' eval([i{1} ' = ip.Results.' i{1} ';']); end for i = f...
68e86c2c2023a8b3a3ce4821f7829519fed5a121b330b67c72076bf98992ad33
MATLAB
13,145
348
% metaplottopo() - plot concatenated multichannel data epochs in a topographic or % rectangular array. Uses a channel location file with the same % format as topoplot(), or else plots data on a rectangular grid. % % Usage: % >> axes = metaplottopo(data, 'key1', 'val1', 'key2', 'val2') % %...
0bcdb58e35bdf1189ce56761fd58b81d3231cedf6c7bfef30409b61c53ac1f0c
MATLAB
13,148
288
function [soAll, soSummary, params] = fun_slow_oscillations(data, chans, srate, varargin) % Slow-oscillation detection. Automatically detects slow oscillaiton events on % multi-channel EEG data and returns each detected event plus their % parameters. % % Required inputs: % % data: A channel x timepoints array, filtered...
1dc007e15fea8c924a860df99a7d4cc14546d8b6019bf0acbf71bef6e5bc02e0
MATLAB
13,176
330
% plotcurve() - plot curve(s) with optional significance highlighting. % % Usage: >> plotcurve(times, data, 'key1', 'val1', 'key2', val2' ...); % % Required inputs: % times - [float] vector of time indices % data - [float] data array, size of [n x times]. If n>1 several % curves are plotted (unless 'plot...
a8b68eb3dca3ad5035bdbde9a49a5be80de9e0d4a5bbbf4a7c5c6acf08bc3af4
MATLAB
13,183
295
function [settings,fibersFound] = ea_prepare_fibers(options, S, settings, outputPaths, source_i) % Preprocess fibers: warp to native (if neccesary), remove those far away % from the stimulating contacts and too short to allocate axons. % By Butenko and Li, konstantinmgtu@gmail.com arguments options % Lead-DBS ...
e1a50f102a06dd25ed0b879f32645e742dcf760528ac2a9de88219444f535907
MATLAB
13,209
365
function CVerr = cvglmnet(x,y,family,options,type,nfolds,foldid,parallel,keep,grouped) %-------------------------------------------------------------------------- % cvglmnet.m: cross-validation for glmnet %-------------------------------------------------------------------------- % % DESCRIPTION: % Does k-fold cros...
81b33106804b4eae31fd33e190aeb478fc5d207b707cd62042f175d96311ec3e
MATLAB
13,216
292
function M_final = apply_shifts(Y,shifts,options,td1,td2,td3,col_shift) % apply shifts using fft/cubic or linear interpolation % INPUTS % Y: Input data, can be already loaded in memory as a 3D % tensor, a memory mapped file, or a pointer to a tiff stack % shifts: calc...
f8dc6a1d91bfb4d4dfcfea62e231ab105946cac1092b4960d458cb4ef3f377c0
MATLAB
13,227
357
function obj=stat_smooth(obj,varargin) % stat_smooth Display a smoothed estimate of the data with % optional 95% bootstrapped confidence interval % % Arguments given as 'name,value pairs: % - 'method': Which method to use for the smoothing. Available methods are: % - 'eilers' (method from Eilers 2003, defau...
7dc649462581a864f7c223f7e258eb85009bfe1f9184f8e0eeabdded3196ce97
MATLAB
13,235
306
function M_final = apply_shifts(Y,shifts,options,td1,td2,td3,col_shift) % apply shifts using fft/cubic or linear interpolation % INPUTS % Y: Input data, can be already loaded in memory as a 3D % tensor, a memory mapped file, or a pointer to a tiff stack % shifts: calculated ...
87ad8840f795d3c5eb9105673a04b340f69f0c7cef6bb85918e5ed0e5da21780
MATLAB
13,236
257
% std_dipoleclusters - Plots clusters of ICs as colored dipoles in MRI % images (side, rear, top and oblique angles possible) % % std_dipoleclusters(STUDY,ALLEEG,'key1',value1, 'key2',value2, ... ); % % Inputs: % STUDY - EEGLAB STUDY set % ALLEEG - vector of the EEG datasets included in the STUD...
d1db81a4674f145d661dedc3f063d161a8f75953d77d50c6023ef713faee3e6f
MATLAB
13,240
159
function summary_stats = load_summary_stats(disorder) % % Usage: % summary_stats = load_summary_stats(disorder) % % Description: % Outputs summary statistics for a given disorder (author: @saratheriver) % % Inputs: % disorder ({'22q', 'adhd', 'anorexia', 'antisocial', 'asd', 'bipolar', 'depression', 'epilepsy',...
1c9f4ac5d5a0d88faeb70651eaf95344e49863c71322c6aaca1fb340a58bac44
MATLAB
13,268
320
% makehtml() - generate .html function-index page and function help pages % composed automatically from formatted Matlab function help messages % % Usage: % >> makehtml(list, outputdir); % >> makehtml(list, outputdir, 'key1', val1, 'key2', val2, ...); % % Input: % list - (1) List (cell arra...
37b05b35a9bf8cdf9c74b6a3c224e952c3c92d50b11bc47aefacb7a64da848d2
MATLAB
13,269
370
%% a01_EphyReplot_acrossSU_SM.m % Read "mXX_SU_population_rwX.mat" % for IPS analysis %%%%% Version History % v2: 02/15/2024 % - support different reward condition % v1: 01/20/2025 % - read NEV file and plot all units together in each single trial % Liang-Yin clear all; close all; %% Parameters path2data = p...
81c89a267e6d6b1302a9c1eeda57a4a4914850a1da90c2592f8cd6c384dafbc2
MATLAB
13,274
333
function ea_ptspecific_atl(options) if startsWith(options.atlasset, 'Local atlas: ') % manually installed atlas coded with this prefix by lead-dbs. return end troot=[options.earoot,'templates',filesep]; aroot=[ea_space(options,'atlases'),options.atlasset,filesep]; proot=[options.root,options.patientname,filesep];...
4d42f9cfea22076b75a0561ec6b12a8c52102b233ce60bcc6bdf9e7647e6d048
MATLAB
13,301
389
function fit = fit_meta_d_mcmc(nR_S1, nR_S2, mcmc_params, fncdf, fninv, name) % fit = fit_meta_d_mcmc(nR_S1, nR_S2, mcmc_params, s, fncdf, fninv) % % Given data from an experiment where an observer discriminates between two % stimulus alternatives on every trial and provides confidence ratings, % fits meta-d' using MCM...
c880fde2bf54024533426aef6da0631599db77a9d2bfd885147476b65dad5452
MATLAB
13,310
395
%% e1_corr_patterns.m % % % *USAGE* % % This script calculates, thresholds, and plots correlation maps % between all pairwise combinations of condition or contrast images using % the searchlight approach, calling the CANlab function % searchlight_correlation() under the hood % % Run this script headless from the Li...
584c5b5a7cc5ee401b391116050c178317966b74e7728cbf342e3842524a3e6c
MATLAB
13,313
310
%% a_set_up_paths_always_run_first.m % % % *USAGE* % % Always run this first before you run any other CANlab_help_examples % second-level script. This script % % # runs LaBGAScore_prep_s0_define_directories (if rootdir/githubrootdir are % not already in the workspace) to set study-specific root/code/github % direct...
704feff08301e4a8ed49cce78e341446c7f02cdb5cf375f00c774235e236e9d5
MATLAB
13,315
231
% Computational model of visual-vestibular interaction in Purkinje cells of % the primate cerebellar nodulus and ventral uvula (NU), and the code that % generates panels B-D of Figure 4 of the paper cited below. % % ------------------------------------------------------------------------- % CITATION % -----------...
5e67cf8bbfc53b99eb95b70c48fc4626c1d6c30cebdada1cb3c5e9f1f61c62f4
MATLAB
13,319
284
function prefs = ea_prefs_default(patientname) % determine preferences here. For filenames, the variable 'patientname' can % be used in string-handling. This variable will be a string with the same name as the patient % folder. if nargin == 0 patientname = ''; end % load loaded prefs (-> prefs.lp) try load([e...
921bd02e82d050bd2e0a458ff3658b1a0c924064ef2396d11845044a608b50a0
MATLAB
13,344
360
%%***************************************************************************** %% sdpt3: solve an semidefinite-quadratic-linear program %% by infeasible path-following method on the original problem %% or the 3-parameter homogeneous self-dual model. %% %% [obj,X,y,Z,info,runhist] = sdpt3(blk,At,C,b,O...
fecc7ed64595794fbe57f34b87ba915534c5d0338dfc9ba75c8b0debeb674341
MATLAB
13,363
385
% eeg_topoplot() - plot scalp map % % eeg_topoplot( vals, chanlocs, 'key', 'val'); % % Input: % vals - values, one per channel % chanlocs - channel structure, same size as vals % % Optional inputs: % 'colormap' - colormap. Possible colormaps are 'blueredyellow', ... % 'yellowredblue', 'bluere...
dfd02efc2f6a5808819b2ba67ed0df8e86254caaea653199e1a52afb84419b17
MATLAB
13,365
365
function saveas(this,filename,format) % Save GIfTI object in external file format % FORMAT saveas(this,filename,format) % this - GIfTI object % filename - name of file to be created [Default: 'untitled.vtk'] % format - optional argument to specify encoding format, among % VTK (.vtk,.vtp), Collada (...
d7871dc974b8347dd4845e19b85c4a193d5e56262f4b2157d4d628a241db74b6
MATLAB
13,381
357
% pop_loadbci() - import a BCI2000 ascii file into EEGLAB % % Usage: % >> OUTEEG = pop_loadbci( filename, srate ); % % Inputs: % filename - file name % srate - sampling rate % % Outputs: % OUTEEG - EEGLAB data structure % % Author: Arnaud Delorme, CNL / Salk Institute, 9 July 2002 % % See...
62f99e1ef98febdaa91d17a974951e62cb8081c214d9c1001a6f8691b71e1eb5
MATLAB
13,410
295
%% prep_1_set_conditions_contrasts_colors.m % % % *USAGE* % % This script defines DAT.conditions, DAT.contrasts, DAT.colors (and % optionally DAT.between_condition_cons) - the core design specification % consumed by every later script - and saves them, together with DSGN and % standard paths, to image_names_and_setup.m...
dcd26637b16829b03f073915eba7230681ff02a499b5d29a2df80db6a7f074fd
MATLAB
13,413
320
function ea_unified_draw(obj,vals,fibcell,usedidx) %for cv live visualize %function draw(obj,vals,fibcell) % re-define plainconn (since we do not store it) %this is all based on which tool is selected %match draw tool with field name if strcmp(obj.drawTool,'sweetspotmapping') flag2tool = 'sweetspotmapping'; if ...
abde970d7ddb17686a8f04e8f9d091b324dd25cf0231f5d642c4dabbe2c65aa0
MATLAB
13,419
404
% timefrq() - progressive Power Spectral Density estimates on a single % EEG channel using out-of-bounds and muscle activity rejection % tests. Uses Matlab FFT-based psd(). % Usage: % >> [Power,frqs,times,rejections] = timefrq(data,srate,subwindow); % >> [Power,frqs,times,rejections] = .....
becb60034b187582d603034941ae0059835149b792a9780e5eab95eb3074f3ce
MATLAB
13,447
423
function cs_fmri_conseed_matrix(dfold,cname,sfile,cmd,writeoutsinglefiles,outputfolder,exportgmtc) tic % if ~isdeployed % addpath(genpath('/autofs/cluster/nimlab/connectomes/software/lead_dbs')); % addpath('/autofs/cluster/nimlab/connectomes/software/spm12'); % end if ~exist('writeoutsinglefiles','var') ...
7ab24aa7844f5a837e62215531e4213272dc8e74d9768c95ae906f4b9aa321a0
MATLAB
13,479
463
%% 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...
8fadfab20c7be5e19221550c435084a36a534124f99fea3445dd2a5dff70ff1b
MATLAB
13,500
315
function [output, Greg] = dftregistration_min_max_3d(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 ...
b5815924071ab970d1b68b7c503012d7130a3ba79fa59e92a04ab4ba5721e9ca
MATLAB
13,501
359
function bz_ConcatenateDats(basepath,deleteoriginaldatsbool,sortFiles) % bz_ConcatenateDats - Concatenate raw .dat files found in a session folder % - for intan type recordings % % ALGORITHM OUTLINE: looks for .dat files in a folder (or in subfolders) to % concatenate together. The concatenation happens via system c...
4c48985c52b54db4bbf8f655b61be14cb07ea1cf755d33182fb4f42ee713310f
MATLAB
13,559
252
function outputStruct = runSmactinAggMovExplain(tassm,matchindx,smactinFlag, propSpk, propSm, ... maxNumPropVect, mvrgAggMatFlag, cutOffInput, outlierParam, spekLabelBase, smLabelBase, sigThreshInput) %RUNSMACTINAGGMOVEXPLAIN takes data matrices of SM - speckles pairs, perform MVRG on them, and report statistical s...
aa3770796174e51709edec0b5dae5e2ecdaf9412550cbd8accf76a5b56eb9904
MATLAB
13,571
411
function [ results ] = infieldness(varargin) % Reflects how "in field" an animal is along its trajectory. % % ARGUMENTS % cel n x 2 vector like [tetrode index, cell index]. If % unassigned, uses self.cel. If has more than one cell, % all returns are as cell arrays with...
1cecfe6747bdf449bd33b52f34e54f2de5d1a9442b099c15cb2e2a6031e810b0
MATLAB
13,593
442
function dimord = getdimord(data, field, varargin) % GETDIMORD % % Use as % dimord = getdimord(data, field) % % See also GETDIMSIZ if strncmp(field, 'avg.', 4) field = field(5:end); % strip the avg data.(field) = data.avg.(field); data = rmfield(data, 'avg'); end if ~isfield(data, field) error('field "%s" ...
957477b6b2967ce6bc6490fb3e8590431a05178d9220198f0c90f97dea890c99
MATLAB
13,607
436
% ------------------------------------------------------------------------- % Downloaded 10.08.2018 from: % http://www.columbia.edu/~bsm2105/type2sdt/archive/index.html % Author: Brian Maniscalco % Contact: brian@psych.columbia.edu % 10.08.2018: OKF added calculation for type 1 c to the results % NOTE FROM ...
b7ec97a71d082781dbbe5084845fb2bb29aad270fd686ba2978f666d5f6315fb
MATLAB
13,641
460
function maps = computeParameterMaps(ftr,M); idxmask = ftr.user.S2(:,:,:,2)>0; % kernel for gathering values withtin original DWI-voxel osamp = (ftr.trackParam.params.p_wid); osamp = osamp/M; st = max(ceil(osamp/2),1); ker = ones(osamp,osamp,osamp); %ker = ker /...
a40df6faae07294ca5c3ba39e678dc4eddec0b476916df50e87b01dc92bfc0ca
MATLAB
13,646
333
% pop_resample() - resample dataset (pop up window). % % Usage: % >> [OUTEEG] = pop_resample( INEEG ); % pop up interactive window % >> [OUTEEG] = pop_resample( INEEG, freq); % >> [OUTEEG] = pop_resample( INEEG, freq, fc, df); % % Graphical interface: % The edit box entitled "New sampling rate" contains the fre...
4d8b80c93d52d290a7c99c1e3afb989d3556db192de1d1ee570a6c0f2e76f860
MATLAB
13,648
267
function [pval ClusNum] = Clinc_permtest_heatnum(DATtemp1,DATtemp2,NUM1,NUM2,Lab,V,VoxelDirPermcluster,Dmasked) % Lab: 1 voxel, 2 ROI pths = which('Clinc_permtest.m'); [pth,fil,nam] = fileparts(pths); if Lab==1 % if isempty(dir([pth,filesep,'permtest_clust'])) mkdir([pth,filesep,'permtest_clust']); els...
7b4108dbde1e76458659c3df0263b6a3bb0653dd57a28b6798c4e41fd6398e62
MATLAB
13,654
454
function clustered = direcClus_fix_bessel_bsxfun(x,k,d,noruns,lambda,p,mInit,epsilon,flagCorStop, max_iter, assignment_flag) % clustered = DirClus(x,k,d,noruns,lambda,p,mInit,epsilon,flagCorStop) % % NOTE: This is a modified version of Danial Lashkari's original code direcClus.m, % which can be found here: % ...
9436a13e12c6972a4cd63dd4c029ed06abd9bf175516dba53e44acd4f2f9fbdc
MATLAB
13,668
372
% pop_mergeset() - Merge two or more datasets. If only one argument is given, % a window pops up to ask for more arguments. % Usage: % >> OUTEEG = pop_mergeset( ALLEEG ); % use a pop-up window % >> OUTEEG = pop_mergeset( ALLEEG, indices, keepall); % >> OUTEEG = pop_mergeset( INEEG1, INEEG2, keepa...
750b771c4462a1e0c45f132f5542ba3428d390f5d71f3ab725dc01fbd1d2dba9
MATLAB
13,675
320
function [ hListbox, jListbox, jScrollPane, jDND, permOrder] = reorderableListbox( ... varargin ) %REORDERABLELISTBOX Create reorderable listbox. % REORDERABLELISTBOX, by itself, creates a listbox in the current figure % whose contents can be reordered by clicking and dragging items, and % returns a handle to...
b3edf26e8ad79933eb9d6d96f18f3a0870b028736b29ca09f6583e1c9344ffd6
MATLAB
13,688
302
function [PL]=ea_calc_vatstats(resultfig,options,hmchanged) % Calculate VAT stats (atlas intersection and volume) % Stimulation information w.r.t the VTA will also be stored in stats. % __________________________________________________________________________________ % Copyright (C) 2014 Charite University Medicine Be...
b46617d84cf5ef054d3a4d69ba3191ca6a24bd6290e6ce9f89005e5b3bc88669
MATLAB
13,729
369
classdef ea_roi < handle % ROI class to plot niftis on lead dbs resultfig / 3D Matlab figures % example: % figure; pobj.openedit=1; ea_roi([spm('dir'),filesep,'toolbox',filesep,'OldSeg',filesep,'grey.nii'],pobj); a=light; axis('off','equal') % A. Horn properties (SetObservable) niftiFilenam...
879a37acfeb83e2c583842f2c006a6d1d1376d25d0f8d03d3a0bd94e97a55940
MATLAB
13,730
365
function saveas(this,filename,format) % Save GIfTI object in external file format % FORMAT saveas(this,filename,format) % this - GIfTI object % filename - name of file to be created [Default: 'untitled.vtk'] % format - optional argument to specify encoding format, among % VTK (.vtk,.vtp), Col...
de14290da290405ede101ccf0b4637cf2027f747eb899ad7d858e0a1f2e15b94
MATLAB
13,741
267
function cm_data=RdBu(m) cm = [0.403921568627451 0 0.121568627450980 0.420234922908265 0 0.121780198586831 0.436093693351309 0 0.122121857680585 0.451507029581573 0 0.122593654786499 0.466483444818097 0 0.123195754618115 0.481031040567280 0 0.123928429963463 0.495157670291367 0 0.124792052969246 0.508871058866449 0 0.1...
299f20b4f20cb8a6db0821817f9b36b6c6f7abff51ac59a342249d6dfa4d521a
MATLAB
13,743
267
function cm_data=RdBu_r(m) cm = [0.0196078431372550 0.188235294117647 0.380392156862745 0.0283230993458890 0.197952412883611 0.398602525810859 0.0372992099145506 0.207543660101164 0.416224146840473 0.0461011759889104 0.217009699714168 0.433254817111962 0.0540166421641391 0.226351215333237 0.449694340499403 0.0611887383...
920831bd951603e7cc94b226268290b0d9a5c5914f116333c02faa4fd30d2864
MATLAB
13,745
365
classdef (CaseInsensitiveProperties = true) functionalBoxPlot < ... iosr.statistics.functionalPlot %FUNCTIONALBOXPLOT Draw a functional boxplot % % Use this class to plot a functional boxplot [1]. A functional boxplot % considers each function as a single observation. The order statistics % are calculate...
091dcc0af8509e59b83b7abf425613189be3765b8d82a579626f3cf94d97e540
MATLAB
13,771
284
function saved_binned_data_file_name = create_binned_data_from_raster_data(raster_file_directory_name, save_prefix_name, bin_width, sampling_interval, start_time, end_time) % This function takes the name of a directory that contains files in raster-format % and creates data that is in binned-format data that contain...
d4edd2f7620d4c26441bebc29715f64c8a734f863825f17f6d1a2ebec3775d9f
MATLAB
13,772
430
function Browse(parameter1,parameter2) %Browse - Interactively browse the data in one or all subplots in a figure. % % USAGE % % Browse(figure,'on') % enable browsing for this figure % Browse(figure,'off') % disable browsing for this figure % Browse('on') % enable browsing for all new figures % ...
fdbb088c053219139dbbda3918e8cc1b10ae31f7a528c1ec45571f5030efbfb6
MATLAB
13,774
276
function saved_binned_data_file_name = create_binned_data_from_raster_data(raster_file_expression, save_prefix_name, bin_width, sampling_interval, start_time, end_time) % This function takes the name of a directory that contains files in raster-format % and creates data that is in binned-format data that contain the...
716cb40d5e7d1dc41a0f6837734e137d40c75f125b018326c62354b66da852b9
MATLAB
13,779
405
function analysisResults = analyzeByGroup(aggregatedResults, swTestPath, compareGroup, outputFile, options) % ANALYZEBYGROUP Full Statistical analysis using file created from % aggregateTrackingResults with normality testing. % % Load compiled tracking results from aggregateTrackingResults, % run Shapiro-Wilk normali...