sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
d31df15174d778ed7445e8a5ebfcab21f37e8c0cd3f671d316c910fae03e8d5f
MATLAB
9,357
222
classdef NetworkAtlas < nla.inputField.InputField %NETWORKATLAS Network atlas, contains network + ROI details properties (Constant) name = 'net_atlas' disp_name = 'Network atlas'; end properties net_atlas = false end properties (Access = protected) butto...
494b62311d063d90ed88ad575178bd0852c0d3f330d7cfd263121b47157b8da1
MATLAB
9,385
272
function varargout = process_nst_glm_group_ttest( varargin ) % process_nst_compute_group_ttest % Compute a t-test using mixed effects % % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyrig...
b79cec68eee8f6c89f4b1d2d79c77a2886a8121e157670440072f88eb0c49184
MATLAB
9,389
206
function jds_sleepStateVelTDComparison(animalprefixlist, varargin) % Compare velocity and theta/delta ratio (TD) across NREM and REM sleep. % % INPUT % animalprefixlist : cell array of animal ID strings % varargin : optional name-value pairs % % The function produces: % • Box-plots of velocity and TD (z-s...
dc655012cba7ced7fc6ddf3fbf998db172a881e69a9c8f0d24d75f28ef64c4c1
MATLAB
9,395
197
classdef MontageTest < matlab.unittest.TestCase properties tmp_dir end methods(TestMethodSetup) function setup(testCase) tmpd = tempname; mkdir(tmpd); testCase.tmp_dir = tmpd; utest_bst_setup(); end end methods(T...
42f7bc034ffbb7826a3b7ff67691eed2dda047bbbba579b5704b68cbf56b0840
MATLAB
9,400
284
function OCDdraw_m21_plot26() %% ========================================= % M21: beta distribution plot (70 x 26 mm) % Revised version (fix overlap of "median estimate" with left panel): % 1) Fix left-panel XTick to [0 0.05] % 2) Narrow the right subject-level panel % 3) Keep the right panel right-aligned % ...
b872c1f2bd51393818972f9bacbb1995008b7112514b6a1db04c6ada6ccfdc3d
MATLAB
9,404
286
% Save NIFTI dataset. Support both *.nii and *.hdr/*.img file extension. % If file extension is not provided, *.hdr/*.img will be used as default. % % Usage: save_nii(nii, filename, [old_RGB]) % % nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m) % % nii.img - 3D (or 4D) matrix of NIFTI...
f1eb03400349abd826b95b4b58018e421331be4f26feec96525a11fffacaebdb
MATLAB
9,404
254
function jds_thetaPhaseLockingPFCRipplesShifters(animalprefixlist) %JDS_THETAPHASELOCKINGPFCRIPPLESSHIFTERS Theta phase locking around PFC ripple chains. % jds_thetaPhaseLockingPFCRipplesShifters(animalprefixlist) measures CA1 % cell spike phase locking to theta within +/-2 s of REM cortical % ripple-chain midpoi...
a10512d91c149b69903bc9ba9efafdfb13ddd8f1b38aeeac578f23089d18e08d
MATLAB
9,424
225
function BCCT_ShowFCmatrixGUI_GCA Hsize = get(0,'screensize'); MIDPOINT = [Hsize(3)/2,Hsize(4)/2]; Asize = [100*3,100+40]; MaxSIZE = [Hsize(3) Hsize(4)]*0.4; factor = MaxSIZE./Asize; factornew = min(factor); POSSIZE = Asize*factornew; Hshow.fig = figure('position',[MIDPOINT(1)-POSSIZE(1)/2,MIDPOINT(2)-POSSIZE(2)/2,POSS...
abe4595c07f7f7793aec6215663a2d9a358da0237b248e19f1596a06e02aff65
MATLAB
9,452
243
function BCCT_MOD_Surf_compute_freesurfer(Parameter) mfilenam = which('BCCT.m'); [pat nam ext] = fileparts(mfilenam); Outputdir = Parameter.Outdir; Indir = Parameter.Indir; marker = Parameter.markerdir; Marker = {marker,['r',marker(2:end)]}; FSlab = Parameter.FSlabs; if FSlab(1) FStype = 'fsaverage'; el...
3d0086617da40ebab2c496fe2e9bdbe9fc6b68d01d6e4d383de17786c439b5c9
MATLAB
9,485
226
function shape_classification_plot(data) clf(figure()) set(gcf,'name','Shape Classification','NumberTitle','off','color','w','units','normalized','position',[0.3 0.2 0.4 0.6],'menubar','none','toolbar','none') file_menu = uimenu('Text','File'); uimenu(file_menu,'Text','Send Data to Workspace','Callback',@send_dat...
d42ed8e7335260f511c09e70de2c16ec9ec02d557bf2286ca2d282bb51e687b6
MATLAB
9,497
227
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function save_nii_hdr(hdr, fid) if ~exist('hdr','var') | ~exist('fid','var') error('Usage: save_nii_hdr(hdr, fid)'); end if ~isequal(hdr.hk.sizeof_hdr,348), error('hdr.hk.sizeof_hdr must be 348.'); end ...
345f616e0ab6216f99c5f67cf56bf32dceb4c62b92570b72ad5d892bff2b44a2
MATLAB
9,514
261
% % current working directory needs to be /path/to/scripts mainpath = pwd; addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'scriptTemplates']) ft_defaults parameterSettings=tc_ws2struct('base','MaxVarSize',16484,'Excl...
5c4efb670f9ec980f3f3b9b0b8723a0ba5bddac073bab093587c0e07f25b6f55
MATLAB
9,525
276
%-------------------------------------------------------------------------- % Till Habersetzer, 15.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Pre-processes OLSA sentence stimuli by computing their auditory % envelopes. This script applies the same resam...
aabebf4dbd05f78f7b9000460bd50956b88cf9eb1c0143e2cfdcc6187ada7c2e
MATLAB
9,528
228
function spt_parabolic_fit(data) input_values = inputdlg({'percentage of data to fit:'},'',1,{'25'}); if isempty(input_values)==1 return else percentage=str2double(input_values{1}); for i=1:length(data) [data{i}.a,data{i}.c,data{i}.r2] = msd_fit_parabolic_msd_inside(data{i}.msd,percentage...
920fea7ec0a7ca6e9eb1047142c3fbcbfb6ff52c669cfbc5780ed5c6f1dddeaa
MATLAB
9,553
214
function colocalization_module() figure() set(gcf,'name','Colocalization Module','NumberTitle','off','color','k','units','normalized','position',[0.25 0.2 0.5 0.6],'menubar','none','toolbar','figure') global data listbox uicontrol('style','pushbutton','units','normalized','position',[0,0.95,0.2,0.05],'string','Set ...
e3878a4327cab9e5e837bd257b9f6efdf017bbfc247cd926b5e81c2dbd3bf262
MATLAB
9,558
200
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...
35d447f8ee3197a4bc280566dc04871684ccd8dc144b09efac736a60ef2485a2
MATLAB
9,587
241
function [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,pred_var,model,FC) % GENERATE_FC Generation of synthetic functional connectivity matrices % % [FCpre,pred_data,Fcorr] = generate_fc(SC,beta,ED,{'SPLwei_log','SIwei_log'},FC) % [FCpre,pred_data] = generate_fc(SC,beta,[],{'SPLwei_log','SIwei_log'}) % % ...
aa9d161481c965e27b24e4e7074204b0096ace9b5663faa9c11d7fe56123642d
MATLAB
9,597
368
function [Beta,res,Z] = fMRI_multitrial_GLMs(S); % Matlab function to return single-trial Betas from GLM using LSA, LSS or L2-regularised LSA % fit to fMRI timeseries from a scan x ROI data matrix, given onsets and durations of events % % rik.henson@mrc-cbu.cam.ac.uk, 2017 (see Abdulrahman & Henson, 2016, Neuroim...
8d3a05de6fe88f902f8c290d1c5b70ac279863b46788d50698ce531ab0d56bee
MATLAB
9,600
204
function jds_detectPopulationSuppressionREM(animalprefixlist,area) %JDS_DETECTPOPULATIONSUPPRESSIONREM Detect population-activity suppression events. % jds_detectPopulationSuppressionREM(animalprefixlist,area) detects % transient drops in smoothed, normalized population firing (z-scored, % below threshold, 0.3-0....
21532cd1161632627bfb0e8f7bff18428abd16cf4f2868980f4daee78ff74cd7
MATLAB
9,613
207
function [ data ] = ps_preparedata_spmobj_LBPD_D( S ) % It extracts data from SPM objects (in one or more datasets) in the % requested time-range(s). % It computes the source leakage correction (by orthogonalisation, removing % zero-lag correlations) and calculates the envelope. % Currently, it is designed to extract...
926de06a8cced877a9e289c18bb2e3e28cb9f82c9ce065f594bfea71b6b9c5a5
MATLAB
9,631
209
classdef FilterTableTest < matlab.unittest.TestCase properties acq_table end methods(TestMethodSetup) function setup(testCase) s_table(1).subject_id = 1; s_table(1).period = 'pre'; s_table(1).acq_date = '2017/05/23'; s_table(1).age = ...
aa8f52e2865043d1827bfa8aa0e96b3c4ca27699d694b331b06deeec2ee9b4bf
MATLAB
9,641
244
%jds_sleepStateRipplePrediction %Decodes ripple type (REM vs noncoordinated NREM cortical ripple) from %CA1 per-ripple spike-count vectors with a linear classifier (10-fold %cross validation, repeated over 10 random ripple-count-matched splits), %against a row-shuffled control. Reports accuracy, precision, recall, %and...
4c830f96c20715a583ddd07e0ef5818b08fcf54bdbcb2fb5240134dc9ee267e9
MATLAB
9,665
265
%% cue-locked %% step 1: source estimation: ERP-based source activity (to ft) clear all; close all; clc dbstop if error % Add FieldTrip path addpath('D:\MATLAB oolbox\fieldtrip-20211209\fieldtrip-20211209'); % Make sure the path is correct ft_defaults; % Set data path path = 'G:\MT\reference\rename\cue_epoch\out_p...
343d64dfc4e8c46da12dfd8967f23b830401e5e69ab4538a7ad654ed22adb802
MATLAB
9,667
279
% SFig 2A (activation density vs distance from stim site at 4 uA) % Build weekDensityData from populationDistances dDiv = 7; % days per week targetCurrents = [4,5]; C = numel(targetCurrents); min_neurons = 1; num_shells = 20; shell_width = 0.05; % mm (50 µm) num_shells = 8; shell_width = 0.1; % mm (100 ...
f0de5ec7eef43af9666ea388d38d3e0142f984a560f8e5f3d74512881fdf2517
MATLAB
9,690
286
% Save NIFTI dataset. Support both *.nii and *.hdr/*.img file extension. % If file extension is not provided, *.hdr/*.img will be used as default. % % Usage: save_nii(nii, filename, [old_RGB]) % % nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m) % % nii.img - 3D (or 4D) matrix o...
15c09f3df400784fd8e47e661eab2c8c0efc5b791bcb7e3cb37b647b02b4e908
MATLAB
9,732
204
function jds_rippleTriggeredAssemblyStrengthREMxVal(animalprefixlist,area,state) %JDS_RIPPLETRIGGEREDASSEMBLYSTRENGTHREMXVAL Cross-validated assembly sequence around ripple chains. % jds_rippleTriggeredAssemblyStrengthREMxVal(animalprefixlist,area,state) % randomly splits REM ripple-chain onsets into two halves, al...
c3b06991063b05f1442979a7071021fce114da51d192d792079dd58d18448540
MATLAB
9,753
275
function freezeColors(varargin) % freezeColors Lock colors of plot, enabling multiple colormaps per figure. (v2.3) % % Problem: There is only one colormap per figure. This function provides % an easy solution when plots using different colomaps are desired % in the same figure. % % freezeColors freeze...
d82570dc5a840b4c9af4302787c13dc18670c969bdee3ed5f18ef8845d10dfea
MATLAB
9,772
322
%ARDEM Demonstrates modules of the ARfit package. % Revised: 30-Dec-99 Tapio Schneider % 01-Dec-10 (added example with multiple realizations) format short format compact echo on clc % ARfit is a collection of Matlab modules for the modeling of % multivariate time series with autoregressive (AR) mode...
b82f4fe9562b82fcc1fc1fd13368a4df1383499e85b148ce551d754ba436a836
MATLAB
9,815
206
function [ ] = GT_modul_plot_LBPD( S ) % It plots intra and inter subnetworks connectivity (after finding ideal % subnetworks; e.g. using modularity algorithms). % INPUT: -S.intra_con: 1 for connectivity intra subnetwork; 0 otherwise % -S.inter_con: 1 for connectivity inter subnetwork...
0d2ff850aa68530ce66376df9c7b01d53468aa893afd95d4529e40279350ce17
MATLAB
9,824
255
classdef SandwichEstimator < nla.edge.BaseTest %SANDWICHESTIMATOR Summary of this class goes here % Detailed explanation goes here properties name = "Sandwich Estimator" coeff_name = 'SwE Contrast T-value' end properties % test specific properties go here (things that ...
5dc4024f1fd0ad1c2a5cd61a15886e5b5e4257dd9a5a19d41ff25511c3971e0a
MATLAB
9,864
218
function [ ] = sources_3D_plot_LBPD( S ) % Plotting in 3D space neural signal over MEG sensors and in brain sources. % If you do not provide information about the head model and MEG sensors % position, previously computed structural/topologic data will be shown. % For now, the function works in 8mm MNI152-T1 space, b...
802d0da12fa609e3c423bfcfca9a271bc4f24d6a85c936a2032e5f68d0502a73
MATLAB
9,870
237
function stat = pl_permtestcluster(data, varargin) % % Performs cluster-size statistical inference on 'data' for difference against 0. % For a difference against any mean value m, use input data - m. % % Data from each observation are randomly multiplied by +-1 to create permutation samples. % Statistical maps ...
ba09c5fafe4ce4f17c8eb0354e77e152443d1b54e57f0f15b9e4b36c92591ff8
MATLAB
9,905
274
function [result, problem] = optimize(varargin) % Script that optimizes an MR gradient waveform subject to a number of constraints. % In particular it maximizes the b-value of a diffusion encoding % pulse sequence subject to constraints on power, maximum gradient and maximum slew rate. % % If you use this in your resea...
24cdd18a4eeeafe92287caae6bdc1762c8dbb5e79ba3581048a24855120a7928
MATLAB
9,920
259
function jds_thetaPhaseShiftersREM(animalprefixlist) %JDS_THETAPHASESHIFTERSREM Classify CA1 cells as REM theta-phase shifters. % jds_thetaPhaseShiftersREM(animalprefixlist) computes each CA1 cell's % preferred theta phase during run (theta periods) and during REM, and % classifies cells whose preferred phase shi...
20bbc89e361d601437e952523624f814773fcf6daca9ad94bff095f3ccc69ec5
MATLAB
9,941
346
function slm = SurfStatLinMod( Y, M, surf, niter, thetalim, drlim ); %Fits linear mixed effects models to surface data and estimates resels. % % Usage: slm = SurfStatLinMod( Y, M [,surf [,niter [,thetalim [,drlim]]]]); % % Y = n x v or n x v x k matrix of surface data, v=#vertices; % n=#observ...
8f4f4c22eb8a8c79c6b0f3484a723aadca3d8fc87a4dc77a864bc8b48ff14f7c
MATLAB
9,971
212
function [] = waveform_plotting_local_v2(S) % It plots waveform for multiple conditions (one group of participants). % Typically used for plotting time series of MEG channel/source, locally. % INPUTS: % -S.data: Data that you want to plot % ROIs (s...
14716ea7a477ddd65fd8caf1c9bca88f3f00540e2cbac53d0e1104fdbf17d907
MATLAB
10,009
256
function preprocessing_audiobooks(settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Prepares audiobook stimuli for a neural decoding analysis by converti...
b6673b367de074bdb3f24d667890c5bbb7ec58c4781db744e870ee42ed6d3da9
MATLAB
10,017
327
function BCCT_ShowGCMap_GUI_coef D.fig = figure('Name','Showing Coef-based GCA maps',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.2 0.3 0.6 0.4]); movegui(D.fig,'center'); dires = which('BCCT_Show...
fbdf258c945f755e4a2c8e661b14a57a3c13d4acb8082508b43a4070e6a420f5
MATLAB
10,032
226
% .HACKED, some minor modifications by PKR, UPENN, September 2018 % Function that iteratively identifies thresholds for Voronoi Areas given % an input of Voronoi areas from data and from a Monte Carlo simulation % % input is intended to be the output from the associated function: % VoronoiMonteCarlo_JO.m % %...
8b188c9e639610b35f866e7b2f0a74f6b0336f72f21ddaa321ec5480a788a9a4
MATLAB
10,085
335
function BCCT_ShowGCMap_GUI_res D.fig = figure('Name','Showing Res-based GCA maps',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.2 0.3 0.6 0.4]); movegui(D.fig,'center'); dires = which('BCCT_ShowGC...
c8a699c59884b1470760177be82e3442057884ef260d3fbfe150718c5da777e6
MATLAB
10,097
266
function varargout = process_nst_dOD( varargin ) % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2013 Brainstorm by the University of Southern California % This software is...
b5ce20593c9a641d5b3d4a1a4ca59228ae62e49ff34dc26e99cdefd2676f6408
MATLAB
10,138
321
% The basic application of the 'reslice_nii.m' program is to perform % any 3D affine transform defined by a NIfTI format image. % % In addition, the 'reslice_nii.m' program can also be applied to % generate an isotropic image from either a NIfTI format image or % an ANALYZE format image. % % The resliced N...
831617545ef88f8fe5c8a63f86ffed36f28f2c1507cc121bb890608d9882272a
MATLAB
10,148
279
%% % current working directory needs to be /path/to/scripts mainpath= pwd; addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'fmriRegAnalysis']) addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip']) addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis']) tvm_inst...
143b558a12e7c06ebda4c046e5cf09274a1fcd5166501bd8f1bd8dc859938ec3
MATLAB
10,174
255
function defaults = tc_make_reg_analysis_defaults(mainpath, subject, varargin) %% defaults = tc_make_reg_analysis_defaults(mainpath, subject, dir_for_computation) % % creates default parameter set for EEG-fMRI regression analysis basic_only = false; if ~isempty(varargin) dir_for_computation = {1}; if length(var...
67d326bfd06b499a3666013f2dfa4336bdc166e17e4d7c217a727af0a6e15fa4
MATLAB
10,189
326
% RUN_SPATIAL_SPIN_CORRELATION_TEST % % This script tests spatial correlations between parcel-wise % structure-function coupling (SFC) and cortical maps while accounting for % spatial autocorrelation using spin permutations. % % The script was written for surface-based cortical data with separate left % and right hemis...
0adc1ff3da2e1640802ada03734aa7a550480abb9cd4f13479a6fbc1abf4fddf
MATLAB
10,209
249
function stat = pl_permtestcluster2(data1, data2, varargin) % % Performs 2-sample cluster-size statistical inference on 'data1' and 'data2' for difference against 0. % For a difference against any mean value m, use input data - m. % % % stat = pl_permclustertest2(data1,data2) uses default values % % stat = ...
498e734d7d691902ae363ebb0c6f1a86c0b3b28fd854063a881863808c226ec2
MATLAB
10,242
280
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function [hdr, filetype, fileprefix, machine] = load_nii_hdr(fileprefix) if ~exist('fileprefix','var'), error('Usage: [hdr, filetype, fileprefix, machine] = load_nii_hdr(filename)'); end machine = 'ieee-le'; new_ext = 0;...
77993efbb572cb36320aa3c5858a50ca29e066be0437c7e10d113e1b7efb77eb
MATLAB
10,311
280
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function [hdr, filetype, fileprefix, machine] = load_nii_hdr(fileprefix) if ~exist('fileprefix','var'), error('Usage: [hdr, filetype, fileprefix, machine] = load_nii_hdr(filename)'); end machine = 'ieee-le'; new_ext = 0;...
145f40d9b431e48c724fc0436c52d3b6a09aef99cfcabb0adc6dce606ae2b0b3
MATLAB
10,354
296
function dFC_project = compute_variability(dFC_project) method_choices = { 'Zhang et al. Formula' 'Standard deviation' }; if ~isfield(dFC_project,'var_method') [method,tf] = listdlg('SelectionMode','single','ListString',method_choices); if tf==0 method=1; end else me...
94576473ff3c0ae14d6556fa5ee81d6ae66fc095d42e0d17325701be99838b2e
MATLAB
10,357
268
function [data_path,movement_par,varargout] = Realign_func(functional4D,pre_proc,all_slices,aux_folder) if strcmp(pre_proc,'none') data_path = functional4D; movement_par = []; if nargout > 2 varargout{1} = []; end return; end % if realigned functional data already exist, check realignmen...
3eae7e76dfe5252f7c3d1d07d812968d2b4d7fc056f65595aa2dc226bc803103
MATLAB
10,457
246
function image_plot(data) figure() set(gcf,'name','Image Toolbox','NumberTitle','off','color','w','units','normalized','position',[0.35 0.25 0.4 0.6],'menubar','none','toolbar','figure') if length(data)>1 slider_step=[1/(length(data)-1),1/(length(data)-1)]; slider_one = uicontrol('style','slider','un...
aed793db0a44d11fe5abec69f348c3eecc1b548492382d536b6627a997b8fd5e
MATLAB
10,461
385
function varargout = boundedline(varargin) %BOUNDEDLINE Plot a line with shaded error/confidence bounds % % [hl, hp] = boundedline(x, y, b) % [hl, hp] = boundedline(x, y, b, linespec) % [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2) % [hl, hp] = boundedline(..., 'alpha') % [hl, hp] = boundedline(...
4651b5579eb9972a83e9334069cb579e4d7a4398904d8fe27af9c6a80c2424ea
MATLAB
10,477
261
function [A, bcol] = print2array(fig, res, renderer, gs_options) %PRINT2ARRAY Exports a figure to an image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % A = print2array(figur...
9c07ac0784ddbe236e18b061f2e8151c158f1966d9733c28e5798fb82b7b7bf0
MATLAB
10,508
175
classdef NetworkResultPlotParameterTestCase < matlab.unittest.TestCase properties root_path network_atlas edge_test_options network_test_options edge_test_result network_test_result permutation_results tests end methods (TestMethodSetup) ...
095d48f862cab1ad31101afc8a15a6bf60da2851d97ed0cdcc2647da9d2bcf76
MATLAB
10,526
283
function [ARA_table,tableRowInds] = getAllenStructureList(varargin) % Download the list of adult mouse structures from the Allen API. % % function ARA_table = getAllenStructureList('param1',val1,...) % % % Purpose % Make an API query to read in the Allen Reference Atlas (ARA) brain area % list. All areas and d...
6b488c09fe942eef4775b0b0e88f37c5d1fc6870a12224a8cf28420d313da8a1
MATLAB
10,530
215
function h = schemaball_modularity_LBPD(r, lbls, modul, COL, perc_intra, perc_inter, limitt) % Plots modularity of graphs (such as brain networks) in schemaball. % This work is based on the brilliant function "schemaball" created by Oleg % Komarov (oleg.komarov@hotmail.it), even though the codes here have been % ...
dc6c4c80d8d0f1078275960204515c5bf9858c3df7c3bb4600b7f897805903c1
MATLAB
10,569
199
function O = InducedResponses_Morlet_Coords_AALROIs_LBPD_D( S ) O = []; % It computes time-frequency analysis (induced responses) using Morlet % wavelet. % It computes Morlet wavelet transform independently on each voxel and each % trial of the provided data. Then, it averages the results over voxels and trials. % It...
09b50b2c0f66288ddd3be1fc23ac980af7200ca459a445b1551f6cf036a765e8
MATLAB
10,576
236
%% ============================================================ % Combined Motivational Go/NoGo Task Behaviour (HC & OCD) % [Final Adjustment: Vertical Gap Increased by 2mm] % - Layout: 50mm width per panel, 2 rows (HC/OCD) % - Vertical Gap: Increased from 3.2 to 3.4 cm (+2mm) % - Figure Height: Increased from 13....
55855f59cfa4c0fe8e04c2c7864fbc32b26ad5b235a8c625fe8bcce0117241d6
MATLAB
10,578
263
%% Plot and count Fig 3 J, L, M, N % Requires fig3_final_results or fig3def_plot_data loaded if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end if ~exist('mergedDFF', 'var') load(fullfile(DATA_ROOT, 'fig3def_plot_data.mat')); end subset_idx = subsetMerged == 1; remaining_idx = subsetMerge...
9ed30bcfdae057a2c4c6f3fbf98886ccc78da062bda6a34ce5d36be12f49bc3d
MATLAB
10,608
263
function AS_WTA_MapShow [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); indir = uigetdir(pwd,'Result of WTA'); outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_read_dir_NIFTI(backgroundmap); dbgre = reshape(dbg,vbg.dim(1),vbg.dim...
8d378f27752998e771dbad73bb5055cfcef9645f14ed15df4a64e2f520bfc81f
MATLAB
10,650
301
%jds_rippleBurstingREM %Bursting probability and first-spike latency of CA1 theta-phase shifter %vs nonshifter cells within isolated (non-chain) REM cortical ripples. %Compares the two groups (rank-sum, bar/boxplots) and relates bursting and %latency to phase-shift magnitude by quartile. clear all; close all; animalpr...
f3a6beb38a834175a86fcd5d9e1a08df84c7a33ff42b41b989d586ec63b9b810
MATLAB
10,663
239
function data = spt_plot(data) for i = 1:length(data) if isfield(data{i},'msd') ~= 1 f = waitbar(0,'calculating msd'); for j = 1:length(data{i}.tracks) waitbar(j/length(data{i}.tracks),f,['calculating msd ',num2str(j),'/',num2str(length(data{i}.tracks))]); if size(dat...
a85f4e7e9eb282ab331e2e5de23185d6b61a2931edfb8ccf2f940d28989cd5d2
MATLAB
10,739
312
function jds_CA1PFCRippleCoactivityREMDeltaFR(animalprefixlist) %JDS_CA1PFCRIPPLECOACTIVITYREMDELTAFR CA1 firing-rate change vs REM ripple cofiring. % jds_CA1PFCRippleCoactivityREMDeltaFR(animalprefixlist) computes each CA1 % cell's mean z-scored cofiring with PFC cells in REM chain cortical % ripples, along with...
01ae88dac9d0c54f1233df8a0b2876ee75c00bfae2dd7db71ca03b5ad165107b
MATLAB
10,882
208
function [ PP ] = BrainSources_MonteCarlosim_3D_LBPD_D( S ) % It identifies 3D spatial clusters (by using islands3D_LBPD_D.m) on a binarized % 3D matrix and then computes Monte Carlo simulation for testing the significance of the % clusters in the original data. The clusters always refer to only one direction of the %...
0d5b6cade09eae58c0a0368c1b68a13ff11f4dea204c68a8b8d6a9583045993a
MATLAB
10,941
309
function SurfStatView1(struct, surf, varargin ); %Viewer for surface and/or volume data or P-value or Q-value structures. % % Usage: SurfStatView( struct, surf, ... ); % % struct = 1 x v vector of data, v=#vertices, % or one of the following structures: % P-value structure: % struct.P...
54eae374d923ae77fd42a243ca4ff0ba8d7f62af252db31cae3069907ecdde59
MATLAB
11,015
299
function Plot_C_summary(data_dir,save_dir,selectedK,centroid,parcellation) % % Plot the centroids in 3D glass brain, in vector format and the boxplots % of the fractional occupancy and dwell time value % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for sele...
a2fff3b41c891deda8ce85d707ef72c8782711a1144eecefaf23dae9f9799353
MATLAB
11,015
285
%jds_phaseAmpCouplingREMShuffle %Shuffle control for jds_phaseAmpCouplingREM: computes the theta-phase to %gamma/ripple-amplitude comodulogram during phasic REM alongside a %circular-shift shuffle of the phase/amplitude time series, and compares %real vs shuffled modulation indices for gamma and ripple bands. animalpr...
efd5c5b9f010a3ffff66f604e8a3980297c3898fbd853fa05b38ea3ecdc9d12f
MATLAB
11,071
315
function dFC_project = compute_TF_comm_struct_v4(dFC_project, condition) % condition = 1; nsub = size(dFC_project.dFC,5); % nsub = 1; TF = zeros(nsub,1); mean_duration = zeros(nsub,1); time_in_state = zeros(nsub,1); mean_in_state_dFC = zeros(nsub,1); mean_out_of_state_dFC = zeros(nsub,1); mean_dFC = ze...
8f184f4d69ef4dad3d82bccfe2187dadf823290b0a5c39034c082248cacccbcf
MATLAB
11,076
208
function [cfg] = ft_topoplotER(cfg, varargin) % FT_TOPOPLOTER plots the topographic distribution over the head % of a 2-dimensional data representations such as the event-related % fields or potentials or the power- or coherence spectrum. % % Use as % ft_topoplotER(cfg, timelock) % or % ft_topoplotER(cfg, freq) % ...
f5b76dc69abcd339941bf54bb2ec4cad50b016a56d73fe179a9ed0b5d1144efa
MATLAB
11,080
268
function AS_WTA_MapShow_inFun(inmixdir,outdir,extendfactor1,extendfactor2,extendfactor3) [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); % indir = uigetdir(pwd,'Result of WTA'); % outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_r...
045c0ea1342e7d4b7090b0ef4fe241af64a24077bf155538eccb77e82b549f0e
MATLAB
11,112
389
function [actmap,aoff]=activationmapoff(pix,framerate,images,mask,velalgo,before,tfilt,usespline,splineN,repolap,inoff); % Function for creating activation map from an image stack. % This version also outputs the offset % Chris O'Shea and Ting Yue Yu, University of Birmingham % Maintained by Chris O'Shea - Email...
b42cf333bfb9a8e58e059455419d87abfdb07bbbefc2db1b191f9e0c1f9eff81
MATLAB
11,121
258
function Plot_DwellTime(data_dir) % % Plot the results from the hypothesis tests obtained from comparing the % mean dwell time between conditions % % INPUT: % data_dir directory where the results from running the hypothesis % tests on the dwell time of PL states % % OUTPUT: % Fig1 plot of th...
d892d90376fe86a4aac58149552635b82091aceeaa55e4944ca5910fd88e5b15
MATLAB
11,176
294
% calculate trace means and stds % TODO - report baseline trace means over each session, i.e. see if there is a drifting baseline in each session or for each roi allROI2Comp = cell(3,1); allDays = cell(3,1); for animal = 1:3 if(animal==1) icms = 'ICMS92'; files2Load = {'Z:\xl_stimulation\ICM...
fe5e27bd22666a70a8f75a2e62e93a0ca21f142b91cc160067a1bb5caa3dea7e
MATLAB
11,176
238
function [ ] = MEG_sensors_MCS_plottingclusters_LBPD_D( S ) % It plots topoplots for gradiometers and magnetometers clusters (given the % cluster ID that you want to plot). % Magnetometers positive and negative are plotted together, assuming that % user is providing cluster IDs that are compatible. In other words, % ...
cd7d8f20af4d221417bc0babe59b7ea70435cd28cbde9d940f24f50c792068f0
MATLAB
11,177
226
function shape_classification_ellipses_plot(data) number_of_classes = size(data.classes,1); answer = inputdlg({'Classes to Plot:','Radius of Ellipses:','Scatter Clusters in Class (1 or 0):','Show Error Bar (0 or1):','Show Data Table (0 or 1):','Weight for Total Number of Clusters (0 or 1):'},'Input',[1 50],{['1:',num...
3ace22db7a70786daf433a9ee9741e49f3fb01ff60333c2ec542ad3e4d5c7f0d
MATLAB
11,196
308
function preprocessing_crosscorr(subject,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Performs subject-level preprocessing for a cross-correlation a...
b604d64b505811e2250208f3c967d10541fa3fd7dd9433acc57416a5de80fe74
MATLAB
11,210
338
function [model,code,message] = nst_glm_add_regressors(model,Regressor_type,varargin) % Call exemple % model = add_regressors(Model, "event", Events, basis_choice, hrf_duration) % model = add_regressors(Model, "external_input", external_input) % model = add_regressors(Model, "channel",sFile,criteria,params,types) % mo...
fa829e0e4b8cd3b1a28b043f538d16fbb78d4eb8da910a725b3af4993ca29abc
MATLAB
11,222
258
function Plot_FracOccup(data_dir) % % Plot the results from the hypothesis tests obtained from comparing the % mean fractional occupancy between conditions % % INPUT: % data_dir directory with the results from running the hypothesis % tests on the mean fractional occupancy of PL states % % OUTPUT: % ...
3abfcde12bf61dc53795a4939ce03332554183c2e50aa9b4f4e6fa41c4dab64f
MATLAB
11,251
233
function loc_list_clusters_remove_outliers_updated(data) %------------------------------------------------------------------------- f = waitbar(0,'Exracting Clusters from Image(s)...'); for k = 1:length(data) clusters{k} = loc_list_extract_clusters_from_data(data{k}); names{k} = data{k}.name; waitbar...
1e51886749cd92a763bb33d470d35d50ad6f5be935ff5c3f8db7511771b8ffa4
MATLAB
11,289
268
function AS_WTA_MapShow_inFunZspec(inmixdir,outdir,width,lenth) [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); % indir = uigetdir(pwd,'Result of WTA'); % outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_read_dir_NIFTI(backgroundm...
d5f5e0b01bda98191665176ebd16a33ed00dbe2a744bbaca9db332498d938ed9
MATLAB
11,307
223
function AS_WTA_Stat_main(Parameter) % Face a problem for the number of connects % In later version, we would like to deal with it for the small ROM % computer. Outdir = Parameter.Outdir; Indir1 = Parameter.Input1; Indir2 = Parameter.Input2; Incalmat1 = load(fullfile(Indir1,'SetUpparameter.mat')); Incalmat2 = ...
c870e19a57ef12452ed4200af275c13a53010a18017e00090de5e5e10e8e7eeb
MATLAB
11,318
268
function AS_WTA_MapShow_inFunX(inmixdir,outdir,extendfactor1) [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); % indir = uigetdir(pwd,'Result of WTA'); % outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_read_dir_NIFTI(backgroundmap...
a77bde8289e2c1f325f3dd72e5b11759840bcab859d7a685938df5c35ae118d1
MATLAB
11,319
268
function AS_WTA_MapShow_inFunY(inmixdir,outdir,extendfactor2) [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); % indir = uigetdir(pwd,'Result of WTA'); % outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_read_dir_NIFTI(backgroundmap...
9b858039eb85135441b8385954224d8df623822e6c638ae1b1c1e48d18a04234
MATLAB
11,342
345
function [y,index_ab_unique]=abnorm_detect(x1,label_index,detect_label) % detect_label=1 3sigma detect_label=2 ËÄ·Öλ detect_label=3 zscore % detect_label=4 ¹ÂÁ¢É­ÁÖ rng(1) x=zscore(x1); %¶¼ÏȽøÐбê×¼»¯´¦Àí if detect_label==1 figure index_ab_all=[]; for i=1:size(x,2) x_mean=mean(x(:,i)); x_std=s...
10dd978e9e6e4149219cea43ed48ce8134663b320268fcee6b1fbb18f869c297
MATLAB
11,345
268
function AS_WTA_MapShow_inFunZ(inmixdir,outdir,extendfactor1,extendfactor2,extendfactor3) [pat nam ext] = fileparts(which('AS_WTA_MapShow.m')); backgroundmap = fullfile(pat,'mni_icbm152_t1_tal_nlin_asym_09a.nii'); % indir = uigetdir(pwd,'Result of WTA'); % outdir = uigetdir(pwd,'Pic Out Dir'); [vbg dbg] = Dynamic_...
87a11f362d7e14828638527459ce77b899028fb683d2c64f56665e1c2895c94d
MATLAB
11,351
255
% Load source EEG data and convert to BIDS format % % Project: Song Familiarity % Other m-files required: EEGLAB with bids-matlab-tools extensions % bids-matlab toolbox (https://github.com/bids-standard/bids-matlab) % Other files required: dmlab32.locs % Author: Cameron Hassall, Department of Psychology, MacEwan Unive...
2f1e7a0cc94b228a4a3d2c587e997afcfb877f138c9e747efa2786d75a045f79
MATLAB
11,357
368
%% Relation midfrontal theta power and Pavlovian-Instrumental conflict (FINAL) clear; clc; close all; % ============================= % 0) Global style (Arial 9pt, no bold) % ============================= set(groot, 'defaultAxesFontName', 'Arial'); set(groot, 'defaultTextFontName', 'Arial'); set(groot, 'defaultAxe...
d7bf5f9b85621aaadfa38708916c6301413e370db8fdd77b4fb75b30607dc430
MATLAB
11,358
345
function [apd,tau,DI,ttp,maxvelup] = segapd(apdopt,tauopt,DIopt,ttpopt,maxupvelopt,Fluo,framerate,f,before,after,tfilt,t,startopt,apdblopt,apdblnum,tstar,tend); % Function for doing analysis of paramaters measured in single file analysis GUI % Chris O'Shea and Ting Yue Yu, University of Birmingham % Maintained by...
2ef5ded45a2a98a8cdfb65e85b2262e5ab2599f322df8e0d3ec878431749731d
MATLAB
11,361
308
function varargout = process_nst_wmne( varargin ) % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2013 Brainstorm by the University of Southern California % This software i...
d684ed6503b63f89a51b073c58109a0e15921930e1abfbd8f95f8a6b48cf11af
MATLAB
11,417
361
function [X, SPM]=batch_spm_anova(S) % A general function for N-way mixed (within+between subjects) ANOVAs in SPM5/SPM8 % (though assumes same number of conditions per group) % R Henson Oct 2006 % % The only required argument in S is: % imgfiles ...
bc2cee7667d9d086b16264d5cd06b3be3c00e9f13dfb6edc76f84a0c42832614
MATLAB
11,483
276
function R_all_blocks = a_confound_and_task_regressors(parameters, delete_files) %% R_out = a_confound_and_task_regressors(mainpath, subject, delete_files) % mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; tc_struct2ws('caller', parameters.main); %% setup parameters tc_st...
9da3ccda85a03f72250d2bd4bbac8f38938a62112319c7ba1fd8020629e96a34
MATLAB
11,494
314
function preprocessing_audiobooks_decoding(subject,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Performs subject-level preprocessing for a neural de...
ab92db27fe6c34e2d318545220ea768660f07b881d84cdbc0add7d08a7a159d8
MATLAB
11,516
299
%-------------------------------------------------------------------------- % Till Habersetzer, 23.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % This script automates the creation and visual validation of individual % headmodels and sourcemodels for MEG source analysis. It...
6e669ba75e57ad78c264363cad5fb9863fbb9664c8c5084eea3d331fbdbddb0a
MATLAB
11,558
317
%-------------------------------------------------------------------------- % Till Habersetzer, 19.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % This script performs a complete Auditory Evoked Field (AEF) analysis on % MEG data using the FieldTrip toolbox. For a list of sub...
edc90d0d23550075bdc917267cfe285c8db16803cd562575a37c5c23ca401e51
MATLAB
11,569
264
function [ P_pos_fin, P_neg_fin, PM ] = diff_conditions_matr_couplingROIs_MCS_LBPD_D( a, b, ROI_lab, X, permut, threshMC, plot_label ) % It calculates the difference between two conditions of strength of the significant % coupling between each couple of ROIs. Then, it calculates Monte Carlo % simulations to assess the...
30327b18f861bcbbf3d6079643f84f9a68955b4514ba02e99b1db3bf8c42bf4a
MATLAB
11,640
374
%% Overview % The main goal of this pipeline is perform source estimation using the % processed data from the main pipelines (OPM_CFA_correction_Pilot_study.m % and Comparative_analysis_with_ICA.m need to have created the required % data objects. %% Parameter settings spm_path = 'C:\Users\swoelk\Documents\MATLAB\spm\...
7c8ebdb85eabbbf01ff7c05e9cc459ae59e2bbff2141afe4dd61b6012b300b44
MATLAB
11,683
261
function drawChord(ax, ax_width, net_atlas, sig_mat, color_map, sig_type, chord_type, coeff_min, coeff_max, representative) %DRAWCHORD display chord plot % ax: axes to plot on, should be square % ax_width: width (assumed to equal height) of axes % net_atlas: respective NetworkAtlas object % ...
92664f79cf91bac15d0056496ed89dbbea1b3320fc8cea27b8a04c8427c177de
MATLAB
11,713
297
%% define parameter sets for analysis if ~(exist('mainpath','var') && exist('thisSubject','var')) clearvars % current working directory needs to be /path/to/scripts mainpath = pwd; thisSubject = 'S1'; else clearvars -except mainpath thisSubject end load([mainpath filesep '..' filesep 'subjectData' ...
0347f1858aab74bd83516b10e2f993a67e015931a9cda3986eebc7769a837610
MATLAB
11,833
291
% This script concatenates all the processed data contained in the % allCTX and allCA1 mat files in Matlab arrays to make the plots of the % individual statistics of the events (Fig. S1 in the manuscript) and the % correlation curves of Fig. 3 % --- Load data --------------------------------------------------------...
3482c5115eda0b660e9918bdcd9a18d8c3ad0e824d78fbd1023f2eb0a99c6910
MATLAB
11,844
327
function varargout = process_nst_cmem( varargin ) % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2013 Brainstorm by the University of Southern California % This software i...