sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
2ddeba80cfa60f906de1922768dc6dfb4d508cc129e7e8424e4fb709150fbf75
MATLAB
17,108
556
function BCCT_showmap_subfun1(Parameter) [Vbg Dbg] = Dynamic_read_dir_NIFTI(Parameter.BG); [pth nam ext] = fileparts(Parameter.BG); if strcmp(nam,'mni_icbm152_t1') D_BG = reshape(Dbg,Vbg.dim); D_BG(isnan(D_BG)) = 0; D_BG(D_BG<30) = 30; D_BG(D_BG>85) = 85; D_BG = (D_BG-30)/55*0.99+0.005; else D_B...
22fd4af2d7e2433714044b45b5ecfb58c3b36de38f289e57762c7d29369e9dda
MATLAB
17,120
279
function [] = waveform_plotting_local_v3(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...
b31230d72e957fe356e8db4848f73dede0066c7d49bb711cacee58ff0e05fd6c
MATLAB
17,235
636
function [selected_file, selected_path] = rri_select_file(varargin) % % USAGE: [selected_file, selected_path] = ... % rri_select_file(dir_name, fig_title) % % Allow user to select a file from a list of Matlab competible % file format % % Example: % % [selected_file, selected_path] = ... % ...
49deee4167a256e679c5d1617ed8693fb4a324c47d563f97ad7b6760e150769e
MATLAB
17,266
412
function varargout = process_nst_extract_sensitivity_from_head_model( varargin ) % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2013 Brainstorm by the University of Southe...
74edf224af9ad4702df9838730043126099388ae2b8f165aa263b1a094642954
MATLAB
17,273
486
%% ========================================================= % Partial Spearman correlations of ISPSDeg / Radius_z / Proj_impulse_z % with each scale score (X) % Controls: BDI, BAI (residual method) % Data: F:\PIT\model\EEGmodelHC\OCD\OCD_M5b_Q.xlsx % Output: F:\PIT\ISPSplot\relation (CSV + one 80x70 mm SVG per combin...
11e758feb5343e781d869c77b716dff12b1b3e4db07749c556342e15f2816d22
MATLAB
17,332
552
function BCCT_CaSCN_MAP_GUI D.fig = figure('Name','Causal network of Structural Covaraince Connectivity(Seed to Whole Brain, volume-based)',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.20 0.15 0.5...
f58aa2c9c59fb5c4b420a3dcca26133a6b3347cfc4356cd27fff93637a595ddb
MATLAB
17,369
501
function [state, params, LL_complete]= saem(init, model, opt_params, Y_avg, Y, Y_mcmv, Ns, Np, P, dist_thr, gpu_flag, whiten_flag, mcmv_prior_flag) %AUTHOR : NARAYAN SUBRAMANIYAM /AALTO/NBE/ % INPUTS % 1) init : struct containing initial values for parameters and kalman % mean/cov . init.A0, init.V_q0, init.q0, init.P0...
d6a139c44a589e8b6df0e52f7f9fe6cb88eee6c48dd6ce5cafaa5c3d212de85b
MATLAB
17,422
416
% This script concatenates all the processed data contained in the % allCTX and allCA1 mat files in Matlab arrays to make the plots of the % network statistics of the events (Figs. 2 and 4 in the manuscript) % --- Load data --------------------------------------------------------- % load('Data\allCTX.mat') load('D...
6b45660319942ac6226012aed26fb669e4311f0e68cd4dbc3726ba756d29d4f9
MATLAB
17,454
435
function data_analysis_software() clear global;clear;clc; %% warning off addpath(strcat(pwd,'\load_files')) addpath(strcat(pwd,'\load_files\tiff')) addpath(strcat(pwd,'\load_files\storm')) addpath(strcat(pwd,'\load_files\tracks')) addpath(strcat(pwd,'\load_files\image')) addpath(strcat(pwd,'\loc_analysis')) ...
87e3ea155e2ca54077055d2e8511ae83d9f699491b22e4145e287ce73e99ac26
MATLAB
17,475
534
function BCCT_CON_Surf_GUI_freesurfer D.fig = figure('Name','Brain Covaraince Connectivity(Seed to Whole Brain, Surfacce-based, (standard Freesurfer process))',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'posi...
5893b56406cbbc23b956360a454150c1e6e843e4efd752ab6f31277fc822863a
MATLAB
17,526
427
% NOTE: This script is for regenerating figure_source_data.mat from the raw % pipeline. It requires access to the lab network drive (S:\Roy) and raw % .mat files from the imaging pipeline. % % For figure reproduction, this script is NOT needed. Instead, download % figure_source_data.mat from Zenodo and place it in data...
5b65a3ea23abd85dbbfd29fee9d8f2e77b367e527e0731f92559e04375751c1e
MATLAB
17,594
440
function [resels, reselspvert, edg] = SurfStatResels( slm, mask ); %Resels of surface or volume data inside a mask. % % Usage: [resels, reselspvert, edg] = SurfStatResels( slm [, mask] ) % % slm.resl = e x k matrix of sum over observations of squares of % differences of normalized residuals along eac...
2d700899e38811ccc340f77c77c1d7b9385790969dd1be2f2d686f220bf5cfa8
MATLAB
17,692
406
classdef NetworkAtlasFuncConn < nla.inputField.InputField %NETWORKATLAS Network atlas, contains network + ROI details properties (Constant) name = 'net_atlas' disp_name = 'Network atlas/Functional connectivity'; end properties net_atlas = false func_conn = false ...
18319abbcd3568537a680e414896bb7010fc6726f5ead9b6a6e96801f27167ca
MATLAB
17,728
573
function BCCT_ShowMap_GUI D.fig = figure('Name','Showing TFRZP 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_ShowMap_GUI....
eec7e8fe6bc8b060b8b09ff6d8a54d8abec12626e7b2245add637606b5c355bf
MATLAB
17,800
440
function AS_MatrixShowFinalResPermVer(enhanind) if nargin<1 enhanind = []; end [mpat,mnam,mext] = fileparts(which('AS_MatrixShowFinalResPermVer.m')); load(fullfile(mpat,'gray.mat')) colormapshow0 = AFNICOLORMAP(128); % colormapshowO = AFNICOLORMAP(12); colormapshow(1:64,:) = colormapshow0(1:64,:); colormap...
dcf4cf549c0332ea700e4b01b2f49b147be624acd95419ca1aa603380f55a23b
MATLAB
17,821
440
function AS_MatrixShowFinalResPermVer_bat(indir,outdir,enhanind) if nargin<3 enhanind = []; end [mpat,mnam,mext] = fileparts(which('AS_MatrixShowFinalResPermVer.m')); load(fullfile(mpat,'gray.mat')) colormapshow0 = AFNICOLORMAP(128); % colormapshowO = AFNICOLORMAP(12); colormapshow(1:64,:) = colormapshow0(1...
055230d1384c254ddb2897462d3b177ebf903159e675c28e10b6a137bc561e51
MATLAB
17,830
575
function BCCT_showgcmap_subfun(Parameter) [Vbg Dbg] = Dynamic_read_dir_NIFTI(Parameter.bgmap); [pth nam ext] = fileparts(Parameter.bgmap); if strcmp(nam,'mni_icbm152_t1') D_BG = reshape(Dbg,Vbg.dim); D_BG(isnan(D_BG)) = 0; D_BG(D_BG<30) = 30; D_BG(D_BG>85) = 85; D_BG = (D_BG-30)/55*0.99+0.005; else ...
cb3e1cb8bcbed996e91e9b47affb8acc097127dd0494b5c01b16c06e38de6a82
MATLAB
17,857
577
function BCCT_showgcmap_subfun2(Parameter) [Vbg Dbg] = Dynamic_read_dir_NIFTI(Parameter.bgmap); [pth nam ext] = fileparts(Parameter.bgmap); if strcmp(nam,'mni_icbm152_t1') D_BG = reshape(Dbg,Vbg.dim); D_BG(isnan(D_BG)) = 0; D_BG(D_BG<30) = 30; D_BG(D_BG>85) = 85; D_BG = (D_BG-30)/55*0.99+0.005; else...
7b8423bb707f1cb3dc8e1a3516bac800e10e8d9191670677feec0b01804e548e
MATLAB
17,874
394
function BCCT_CaSCN_computemain(Parameter) pathfiles = which('BCCT.m'); [path nam ext] = fileparts(pathfiles); Outputdir = Parameter.Outputdir; RealCompPara.Outputdir = Outputdir; Inputdir = Parameter.Inputdir; RealCompPara.Inputdir = Inputdir; SeedROItype = Parameter.SeedROItype; RealCompPara.SeedROItype = See...
fee6a334a7a5a9610ca863d9380459da241fc9365ed6405b977685c303cda32b
MATLAB
17,918
429
function [map,num,typ] = brewermap(N,scheme) % The complete selection of ColorBrewer colorschemes (RGB colormaps). % % (c) 2015 Stephen Cobeldick % % Returns any RGB colormap from the ColorBrewer colorschemes, especially % intended for mapping and plots with attractive, distinguishable colors. % % Syntax (basic...
bc1b82362bedbd3db1f69cdda1178ab2a8b843c604b2ce6bb3b2e75a49a04819
MATLAB
17,944
388
function [dPCAmodel, dPCAprojTrain, dPCAprojTest] = computedPCA(obj, dPCAOpt, processingOpt, trainOpt, testOpt, visOpt) % COMPUTEDPCA Fit dPCA on training data and project train/test sets. % % ------------------------------------------------------------------------- % SYNTAX % [dPCAmodel, dPCAprojTrain, dPCApro...
22208942a78407dd168c4623e5da66c1dca845c6853fa1b6415bb58046baa998
MATLAB
17,967
414
%% run_behavioral_association_analysis.m % Association between parcel-wise/cluster-wise SF coupling metrics and % developmental assessment scores while adjusting for family and maternal % covariates. % % This script is a cleaned, public-release template for the analyses used to % test associations between brain metrics...
4fec8497adfa345cb9e23dab0f58bebe918dc6679d2500930407ef1a0a3894b7
MATLAB
17,983
424
function varargout = process_nst_detect_bad( varargin ) % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2016 University of Southern California & McGill University % This so...
32ae088b3a54b5fa57406ab2ab482b7f460f7570a3b1c1eae622b8252206fd0a
MATLAB
18,187
495
function data = lvm_import(filename,verbose) %LVM_IMPORT Imports data from a LabView LVM file % DATA = LVM_IMPORT(FILENAME,VERBOSE) returns the data from a LVM (.lvm) % ASCII text file created by LabView. % % FILENAME The name of the .lvm file, with or without ".lvm" extension % % VERBOSE How many messages to d...
47dc6b6208de5b8cd211e93fd971426cb61adca43989de42793e5895dbe4500e
MATLAB
18,215
421
function loc_list_plot(data) if isempty(data)~=1 fig = figure(); set(gcf,'name','Localizations List (2D)','NumberTitle','off','color',[0.1 0.1 0.1],'units','normalized','position',[0.3 0.15 0.4 0.7],'menubar','none','toolbar','figure'); defaultToolbar = findall(fig,'Type','uitoolbar'); a = ...
1ad2928d191f9269a5bc2da0776cbec70b5e44dfa9de324df54cd91bbe5abff2
MATLAB
18,219
386
function training_decoding(subject,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 27.01.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Performs subject-level training and evaluation of a neural decoding ...
6e694edd52990309702b0644243c682b4742053ddcb990aafb6efdaf28b39fec
MATLAB
18,229
564
function BCCT_MOD_Surf_GUI_freesurfer D.fig = figure('Name','Modulate effect of Covaraince Connectivity(Seed to Whole Brain, Surfacce-based, (standard Freesurfer process))',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95]...
e163539252a67419db25a3f9de8d0c00108ec1fafbd3e7aa88c2e944a9b9f1fe
MATLAB
18,230
399
% ------------------------------------------------------------------------ % This script loads and processes EEG and respiration phase data from three % sources: original, new, and simulated. It bins EEG amplitude according % to Park et al. (2020) binning method, and generates permutation % distributions. Normalized ve...
a7285c7e888d5bee2240ddd051e3bac04b5b0c041752773a82e82953d3fdf163
MATLAB
18,543
615
%% Convert SPM files to Fieldtrip raw cd('D:\OPM - Pilot 2') % Convert SPM data object to raw Fieldtrip format data_orig = fDB.ftraw; data_orig.grad = extractGradSelectedSensors(fDB); data_orig_heart = fDH.ftraw; data_orig_heart.grad = extractGradSelectedSensors(fDH); %% Load required toolboxes incl. clean Fieldtri...
ffea7d4087535c827e770d872e548c2da203c2f6449a8fda7c1f586bd1090663
MATLAB
18,626
520
% internal function % 'xform_nii.m' is an internal function called by "load_nii.m", so % you do not need run this program by yourself. It does simplified % NIfTI sform/qform affine transform, and supports some of the % affine transforms, including translation, reflection, and % orthogonal rotation (N*90 de...
9111971fdd93a79059e601d02d092f9878fe7011be4c97295a49243c8f76a2b3
MATLAB
18,628
521
% internal function % 'xform_nii.m' is an internal function called by "load_nii.m", so % you do not need run this program by yourself. It does simplified % NIfTI sform/qform affine transform, and supports some of the % affine transforms, including translation, reflection, and % orthogonal rotation (N*90 ...
4b8b3549a726b0f8e2f2a1b5c5fd44ddbc93e46d0d16381a3d897365fbfb4a34
MATLAB
18,974
585
%% Overview % The main goal of this pipeline is to simulate a source in the brain in % presence of the cardiac field artefact (CFA), i.e. the electromagnetic % signal from the heart. We validate whether the OP-MEG recordings can be % corrected for the CFA and whether the brain source is retained. For this % a dipole f...
ff504eeb8733b42e2895842fe7fbc64a995f234cc6ab72d11797af445545cc88
MATLAB
19,096
523
%%%% EXTERNAL FUNCTION % function taken from the fastICA package % complete software may be downloaded from http://research.ics.tkk.fi/ica/fastica/ function [Out1, Out2, Out3] = fastica(mixedsig, varargin) %FASTICA - Fast Independent Component Analysis % % FastICA for Matlab 6.x % Version 2.3, July 27 2004 % ...
6670b3de15400e2cf0497901e9db0d6c28eb362efda5c62b1091a3c6608bbbbf
MATLAB
19,194
542
classdef parcellation % Class-based representation of parcellations % % This class is designed to facilitate working with parcels and standard masks % Key tasks are % % - Reading in a parcellation and matching it to a standard mask % - Reshaping between volume and matrix representations of the parcellation % -...
ff4fef1f11d3c30a62eb107bf921ce37f2dcebdf3caee5d487e89b6818d37c16
MATLAB
19,297
413
function [ H, P_binary, P_ROIs, MATF, cor_mat ] = static_FC_MEG_LBPD_D( S, data ) % It calculates static FC by computing Pearson's correlations of the % envelope of the data given in input. It does that independently for each % condition. % Additionally, it can perform contrast between two conditions, plot the FC % ma...
0cf99419b9b5c8bde956ec172a0279eb33bc19e257e13a708ae4229308b00e78
MATLAB
19,316
397
function EEG_regs_conv = c_eeg_power_regressors(parameters, delete_files) %% EEG_regs_conv = e_eeg_power_regressors(mainpath, subject, delete_files) %mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; tc_struct2ws('caller', parameters.main); %% load parameters tc_struct2ws('...
1542dd948790988111127a8a9aedbde2aa9b843e6fd1d845bbb4e6a14e905d4c
MATLAB
19,402
453
function spt_layover_module_colocalization() figure(); set(gcf,'name','Single Particle Tracks Colocalization','NumberTitle','off','color','w','units','normalized','position',[0.2 0.2 0.4 0.7],'menubar','none','toolbar','none','WindowButtonMotionFcn',@mouse_move,'WindowButtonDownFcn',@mouse_down,'windowkeypressfcn',@k...
efafe197e65074d04e0a2caa0fbf6700ab652759dd4e600154ba87d25799f2e1
MATLAB
19,403
531
function ShowResRadarSep_in(Outputdir) % Outputdir = uigetdir(pwd,'Output Directory Selection'); OutputdirFig = [Outputdir,filesep,'ResRadarFigure']; if isempty(dir(OutputdirFig)) mkdir(OutputdirFig) end % Outputdir = 'D:\testdata\AS_sub2cor1\testdata\'; LabedValmat = fullfile(Outputdir,'LabedVal.mat'); Rea...
c4e23f741b45f791bb04124408a44074e7c3765aac41f7457103ec6528726a3e
MATLAB
19,644
420
%-------------------------------------------------------------------------- % Till Habersetzer, 24.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Group Analysis and Visualization of Dipole Fits % % This script performs a group-level analysis of MEG dipole fitting % results ...
998b747537d748f8bb0f995ee4616125ccde4ab55544dff130ea6f419b1ec1d5
MATLAB
19,785
756
function SurfStatWriteVol( d, Z, T ); %Writes volumetric image data in MINC, ANALYZE, NIFTI or AFNI format. % % Usage: fmris_write_image( d [, Z, T] ). % % d.file_name = file name with extension .mnc, .img, .nii or .brik as above % Z = vector of slices. % T = vector of times. % If Z and T are o...
c3a618162713f773d64dafe55d09c5393b7f876e56584b2f3662a932fa0ba493
MATLAB
19,815
615
function BCCT_CaSCN_Surf_GUI_freesurfer D.fig = figure('Name','Brain Covaraince Connectivity(Seed to Whole Brain, Surfacce-based, (standard Freesurfer process))',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'po...
0a3ee430cd3a3aa548dea8299dd8c3f04ceeaae534658b1ba5180816349b176f
MATLAB
20,263
580
% Save back to the original image with a portion of slices that was % loaded by "load_untouch_nii". You can process those slices matrix % in any way, as long as their dimension is not altered. % % Usage: save_untouch_slice(slice, filename, ... % slice_idx, [img_idx], [dim5_idx], [dim6_idx], [dim7_idx]) % % ...
b3db0b26ee491b9fb9a50abc5a3e740a77b582224a9f7c781f9cc331784134ae
MATLAB
20,462
504
function AS_MatrixShowFinalResPerm(enhanind) if nargin<1 enhanind = []; end [mpat,mnam,mext] = fileparts(which('AS_MatrixShowFinalRes.m')); load(fullfile(mpat,'gray.mat')) colormapshow0 = AFNICOLORMAP(128); % colormapshowO = AFNICOLORMAP(12); colormapshow(1:64,:) = colormapshow0(1:64,:); colormapshow(66:12...
73aca5b0a7cadcecd33c626fa96efb3293865af96412ef8eec4d536afe1755f2
MATLAB
20,572
419
%% Data Construction % Load the data [file,path] = uigetfile('*.mat','Select the file you want to load'); % Open a dialog so you can specify which file you want to load selectedfile = fullfile(path,file); % Create the name for the file to load load(selectedfile); % Load the file % Clear up the work space clear fi...
261ea0d99af058b9e4523bb9eb5a495ec7d1fc5364ff88e68b284c6a578691c6
MATLAB
20,797
613
%% HC %% ========================= % A) Midfrontal–Lateral PFC [NO exclusion] % Go = mean(contra, ipsi); NoGo = nogo % width = 50 mm, Arial 9 pt (no bold), save as SVG %% ========================= % If results_dir is not defined, use the current folder: % results_dir = pwd; % -------- 1) Organize data to plot: T...
481e8137f0951085827aebb9e70f0b83997ef65a44eb042ae42ba8b110dcd58e
MATLAB
21,012
653
%% make grand average ERP if ~exist('mainpath','var') clearvars % current working directory needs to be /path/to/scripts mainpath = pwd; else clearvars -except mainpath end addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath...
e5ca64242ec5d66e7cb8374d54093272b42fd84ac7c1fb2f80bab569f2b234f8
MATLAB
21,034
466
%%% READS EYE TRACKING DATA AND OUTPUTS OVER TRIAL HEATMAP %%% addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) diffFct=@(x,y) sqrt((y(:,1)-x(:,1)).^2+(y(:,2)-x(:,2)).^2); subjDirOld=subjDir; workingDirOld=workingDir; %% if computeForMultipleSubjects(1)~=0 % if multiple subjects are asked to be computed ...
a8dfde0288449f0228a855c8ebbca0d6ecd03e7a0c554227b3cdcc7eedf6e507
MATLAB
21,257
616
function [map1,act_x,act_y,act_t,quivers_X,quivers_Y,quivers_vx,quivers_vy,CVmap,v,vout,quivers_Xout,quivers_Yout, quivers_vxout,quivers_vyout,onedev,vari,SE]... = cvmap(pix,framerate,images,mask,outs,velminin,velmaxin,velalgo,MINt,MAXt,winsize,before,wint,repolopt,repolap,tfilt,usespline,splineN) % Function fo...
630fbe88a20576de50381db6a2b94d6dc2ff72dd66806797e5ffbda1612d90df
MATLAB
21,327
501
%% 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 addpath([mainpath filesep 'fmriRegAnalysis']) addpath([mainpath filesep 'toolboxes' f...
0b359dffc835486726a1d14080b2ccd851eb4364da9cc9a208a50b0675a39627
MATLAB
21,335
468
classdef BstHelperTest < 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(...
06b3748bdaf7d087e88d24708e5104477268b04c6a55a8283825d3474330fcb8
MATLAB
21,582
586
%%%%%%%%% % This code contains various plot and analysis that we tried after GED %% addpath('/projects/MINDLAB2023_MEG-AuditMemDement/scripts/chiaramalvaso/GED_TSA2021'); addpath('/scratch7/MINDLAB2023_MEG-AuditMemDement/chiaramalvaso/GED_TSA2021'); %% *** START UP FUNCTIONS.. (LBPD_startup_D) *** %starting up some f...
2331be04947f81e59162e73c8bb5c1cce1ed8edbd5d1ad756403d41f538ee97e
MATLAB
21,691
569
% Stats and figures % Other m-files required: % EEGLAB toolbox: https://github.com/sccn/eeglab % /private/doPermTest2.m % /private/formatNBP.m % /private/makefigure.m % /private/subtightplot.m % /private/figset.m % Author: Cameron Hassall, Department of Psychology, MacEwan University % email address: hass...
1aad77ff48076cbfaafb4fe6e05a13e66dfd08774c17b0d6abd7e2ae1ed83c17
MATLAB
22,092
586
function varargout = process_nst_cpt_fluences( 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 sof...
125438c55d22a9fb5a6f789c696e805e71c2e43ec95493ddb68549080c35aa77
MATLAB
22,146
677
function [Pool,Part,QV] = check_pooled_error(S); % Pedagogical script to illustrate assumptions about error term(s) in % repeated-measures multi-factorial ANOVAs performed on many observations % (eg voxels in fMRI). Requires SPM8+ on path. % % Based on Henson & Penny (2003) Tech Report ("H&P03"): % http://...
fadef0bbddc98a6708c71c3873ca47082e0e9fbb775a723273928d8a3ea2821f
MATLAB
22,264
444
classdef TestPool < nla.DeepCopyable %TESTPOOL Pool of edge and net tests to be run properties edge_test = false net_tests = {} data_queue = false end properties (Constant) correlation_input_tests = ["kolmogorov_smirnov", "students_t", "welchs_t", "wilcoxon"] en...
ef5c942035a98877d746e75349f4d909c3c11af25cd62052c5518209d307cf9c
MATLAB
22,357
379
% current working directory needs to be /path/to/scripts mainpath= pwd; addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'fmriRegAnalysis']) %% hemis = {'lh', 'rh'}; if ~(exist('freqs','var')) freqs = {'alpha', 'gamma'}; end add_fname_freq = join(freqs, '_'); add_fname_fre...
93607c3dcb32f932b0632d9b512369a9b0e945c7e71b4002425a8b1730edbf06
MATLAB
22,407
675
function dimord = getdimord(data, field, varargin) % GETDIMORD % % Use as % dimord = getdimord(data, field) % % See also GETDIMSIZ, GETDATFIELD % Please note that this function is called from many other FT functions. To avoid % unwanted recursion, you should avoid (where possible) calling other FT functions % insid...
1711dd8bbf76ef372a976952e73921863098abe21d08f4262b0e9dff32911c14
MATLAB
22,423
396
%% setup program close all clear % current working directory needs to be /path/to/scripts mainpath = pwd; addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'fmriRegAnalysis']) %% % for binning = {'percentiles', 'binned'} % clearvars -except binning % binning = binning{1};...
b50ed6f6c0487825e734a0593e501040563972f9c15c010de4016dbea514647d
MATLAB
22,673
434
function BCCT_CaSCN_stat_mainfunc(Parameter) Outputdir = Parameter.Outputdir; Inputdir1 = Parameter.Inputdir1; Inputdir2 = Parameter.Inputdir2; RealComp1 = load(fullfile(Inputdir1,'RealCompPara.mat')); RealComp2 = load(fullfile(Inputdir2,'RealCompPara.mat')); if ~strcmp(RealComp1.RealCompPara.mod,RealComp2.RealCompPar...
ae44bd5b3b69a4b9c2f258321d54cc7f726b41a094dad8baecfed5344fe692f4
MATLAB
22,835
521
function [cell,module,mc,trec,Forcec,xrefc,xsubc,cengc,ctheta,cellpos,polyrate,gactin,trac,aflow,modnum,sdist,mdist] =... cms2Dv1_0(mpool,cpool,totact,maxpoly,kmod0,kcap,lcell,lmin,Kcell,nc,Fm,vu,kon,koff,Kc,Fb,Ksub,tint,durr,dynamicPlot,savedir,savename,runnum) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
9d123429db3526e944937ac8fb6d48ad019fc1506de574b9922df29d401b48ca
MATLAB
22,917
460
classdef InstallSourceTest < matlab.unittest.TestCase properties tmp_dir end methods(TestMethodSetup) function setup(testCase) tmpd = tempname; mkdir(tmpd); testCase.tmp_dir = tmpd; end end methods(TestMethodTeardown) func...
e388b2ffa2d93bb80efef7a4e7ef01116c7a3a942bd5ef7f193a565bcd279d27
MATLAB
22,985
505
classdef Behavior < nla.inputField.InputField properties (Constant) name = 'behavior'; disp_name = 'Behavior'; end properties behavior_filename = false behavior_full = false behavior = false behavior_idx = false covariates = false covariat...
d6bca56fd6858151cf23ec709a4075fa26357ede639d0f87ddcd117f16de3f25
MATLAB
22,995
559
function [ zmin, zmax] = ft_getminmax(cfg, data) %function [cfg] = ft_singleplotTFR(cfg, data) % FT_SINGLEPLOTTFR plots the time-frequency representation of power of a % single channel or the average over multiple channels. % % Use as % ft_singleplotTFR(cfg,data) % % The input freq structure should be a a time-frequ...
94a7a8b782aadce35a7b82485f14b4d16dab80ab1c1b2b62c02c96179f7e0f0e
MATLAB
23,103
577
function AS_MatrixShowFinalResPermVer_bat_GUI(indir,outdir,enhanind,Coltype,PVALT,Pvalused,orders) [mpat,mnam,mext] = fileparts(which('AS_MatrixShowFinalResPermVer_bat_GUI.m')); load(fullfile(mpat,'MatColormap','mycolormap.mat')); load(fullfile(mpat,'gray.mat')) colormapshow0 = AFNICOLORMAP(128); if Coltype==1 ...
2de840de7ceffd50b75b436c379cec9058bd0f8ba96b2d74410c72b7430ebf0e
MATLAB
23,119
711
% HYDRA SOLVER % Version 1.0.0 --- January 2018 % Section of Biomedical Image Analysis % Department of Radiology % University of Pennsylvania % Richard Building % 3700 Hamilton Walk, 7th Floor % Philadelphia, PA 19104 % % Web: https://www.med.upenn.edu/sbia/ % Email: sbia-software at uphs.upenn.edu % % Cop...
bf9197c2b1d6f39f007102b6b2441cfa4a50344f09f96c99b594478c84ca86af
MATLAB
23,161
897
function b = generative_model(A,D,m,modeltype,modelvar,params,epsilon) % GENERATIVE_MODEL Run generative model code % % B = GENERATIVE_MODEL(A,D,m,modeltype,modelvar,params) % % Generates synthetic networks using the models described in the study by % Betzel et al (2016) in Neuroimage. % % Inputs: % ...
28198911c796b3407115cd3e7a10da796bba9eef6d1000e26ce1f464db5f1df4
MATLAB
23,297
574
function AS_MatrixShowFinalResPermVer_other_GUI(Pval,outdir,enhanind,Coltype,PVALT,Pvalused,orders) [mpat,mnam,mext] = fileparts(which('AS_MatrixShowFinalResPermVer_bat_GUI.m')); load(fullfile(mpat,'MatColormap','mycolormap.mat')); load(fullfile(mpat,'gray.mat')) colormapshow0 = AFNICOLORMAP(128); if Coltype==1 ...
9813ee32d13bd610bd1d5ef66addf4256cccdc86ed3f89157a6deb6caf288bab
MATLAB
23,429
600
function varargout = panel_nst_fluences(varargin) % panel_nst_fluences Edit ROI for fluences computation. % USAGE: bstPanel = panel_nst_fluences('CreatePanel', OPTIONS) : Call from the interactive interface % bstPanel = panel_nst_fluences('CreatePanel', sProcess, sFiles) : Call from the process ...
5f861588ca8c20e945041068ea2cf4f55f4a17113b8af4c60960f7617cb63c45
MATLAB
23,572
554
function DrawCombined_AllInOne2() %% ============================================================================== % All-in-one Figure (Width <= 190mm, Right margin = 4mm) [SVG] % Row 1: HC -> WAIC + All Cues + Go Cues % Middle: shared legend (behavior lines + M3c prediction shading) % Row 2: OCD -> WAIC + Al...
70a816ed91f5309c5a621ceb0277410d1cb0fe585bb35b7f965a764c334db9b3
MATLAB
23,746
719
%% Overview % The main goal of this pipeline is to simulate whether the proposed method % for cardiac field artefact (CFA) correction is sensitive to simple % mismatch in torso geometry used by the forward model. % % Starting from the original cardiac source misplacement simulation, this % version evaluates whether cor...
55d86bb04cc174e583f8c9dac2a1ff24b976c4f8c5c37cea5de88475eddb76d7
MATLAB
23,872
607
%-------------------------------------------------------------------------- % Till Habersetzer, 01.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % This script performs a comprehensive analysis and visualization of MEG % cross-correlation data. It focuses on...
7ed31bebbcf541ddbf75c4a3a0601a1d5019c599f3fabcff14f32b7a984b1e79
MATLAB
23,923
635
% HYDRA % Version 1.0.0 --- January 2018 % Section of Biomedical Image Analysis % Department of Radiology % University of Pennsylvania % Richard Building % 3700 Hamilton Walk, 7th Floor % Philadelphia, PA 19104 % % Web: https://www.med.upenn.edu/sbia/ % Email: sbia-software at uphs.upenn.edu % % Copyright ...
b4a80f13e5e87962fe16f9646718357ecce4ae15d74fd7cd9d3ae99910484fc1
MATLAB
24,128
490
function BCCT_WTA_Stat_main_ver2(Parameter) % Face a problem for the number of connects % In later version, we would like to deal with it for the small ROM % computer. % Change this value to speed up when you have large ROM Nslice = 1000; % Outdir = Parameter.Outdir; Indir1 = Parameter.Input1; Indir2 = Par...
c57d860d84f9e1c276d8dd2642112d8b7fa6719d4c1248f27efc02e5da7ff80d
MATLAB
24,305
631
function varargout = process_nst_mbll( 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...
9a1c81fd36014759282e8c579a4badd4b1c000e09fcb00ac611e3584f7922ec9
MATLAB
24,331
742
%% Overview % The main goal of this pipeline is to find to perform co-registration of % the volume conduction model of the torso and the OP-MEG sensor locations % (as tracked via retroflective markers). % For this purpose, the 3D optical scan of the participant is aligned with % volume conduction model, by selecting fi...
5f477ca80c11b4f0acf103c0f4a1b75365b0f322c0fd101705a2712feb399ba2
MATLAB
24,625
680
function varargout = process_nst_import_head_model( 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 % Th...
62a9d8b6a32368cd0584e6e0aa5d3c0bc28316fae81f703a48bf26413f4e58f6
MATLAB
24,630
533
clear variables addpath(genpath('/Volumes/Samsung_T5/Milan_DA/OS_ephys_da/CorticoHippocampal')) addpath ('/Volumes/Samsung_T5/Milan_DA/OS_ephys_da/ADRITOOLS') cd('/Volumes/Samsung_T5/Milan_DA/RGS14_Ephys_da/Data_RGS14_Downsampled_First_Session') % cd('/Volumes/Samsung_T5/Milan_DA/RGS14_Ephys_da/Data_RGS14_Downsampled'...
d6ea6a36b11fc2b547d57061bdf1e8b088e245348ea40607e426bf1105936117
MATLAB
24,850
538
classdef NLA_GUI < matlab.apps.AppBase % Properties that correspond to app components properties (Access = public) NetworkLevelAnalysisUIFigure matlab.ui.Figure FileMenu matlab.ui.container.Menu OpenpreviousresultMenu matlab.ui.container.Menu GridLay...
dacce0129b4ec7357f4880a2352753afbeaafbcdf4975ef7f12c036382a92f20
MATLAB
25,123
672
%% % 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 sigmoidFct=@(x,k) 1./(1+exp(-k.*x+k/2)); % puts all workspace...
a5a10d8e4cd4f1a37b6ebbf75ff52485fad43eb7c73acdb6d98c11ab50b4fdfc
MATLAB
25,703
717
legend(app.UIAxes,'off') nroi = size(app.dFC_project.dFC,1); default_colors = transpose([(257-[1:256])/256; [1:128]/128,(129-[1:128])/128; [1:256]/256]); default = [0 0.4470 0.7410; 0.900 0.150 0.0980; 0.9290 0.6940 0.1250; 0.4940 0.1840 0.5560; 0.2660 0.6740 0.4880; 0.3010 0.7450 0.9330; 0.6350 0.0780 0.1840; 0 0.44...
434dfff0f37bdc1ba762314153aacab5ea55148f3c50e979fd8ff110444ee02c
MATLAB
25,725
685
function [Zmat, Bmat, pZmat, pBmat, aY, X0r] = rsfMRI_GLM(S); % [Zmat, Bmat, pZmat, pBmat, aY, X0r] = rsfMRI_GLM(S); % % Function (using SPM8 functions) for estimating linear regressions % between fMRI timeseries in each pair of Nr ROIs, adjusting for bandpass % filter, confounding timeseries (eg CSF) and (SVD of) ...
fd1d745e9354763799497930ffd178cb7c8b01d5fbaa09ea81108f385db258cf
MATLAB
26,186
841
%% Overview % The main goal of this pipeline is to simulate a cardiac field artefact % (CFA), i.e. the electromagnetic signal from the heart and to illustrate % how this manifests on OP-MEG channels on the scalp. Moreover, we validate % whether the OP-MEG recordings can be corrected for the CFA. Specifically, a % dipol...
0e341b7004be9e42ed396020afd77f47e7a8d795a301558079e530783bc2adb6
MATLAB
26,666
503
classdef ChordPlot < handle %CHORDPLOT - Class to construct and display chord plots for network and edge tests % % obj = ChordPlot(network_atlas, axes, axis_width, plot_matrix, varargin) % network_atlas - network atlas object used % axes - the axis that the chord will be plotted in/on % axis_width - the height ...
a47e1e00e57fd5fac495202804e1308812452ca1ff4bfc92caf957b3eb8641be
MATLAB
26,974
918
function MAP4SL(cfg,filename,outputfolder) % MAP4SL - Multiband Artefact Probe for Slice Leakage % % MAP4SL is a Matlab bases tool which is designed to identify the effect of % an artefact in MRI data on other areas depending on the slice leakage in % MR multiband EPI functional images. % % This tool calculates the...
9694bf213d2524b89f0173da55a7fb3c6f0625a8df3267169116129293e5f0ba
MATLAB
27,003
707
function varargout = process_nst_glm_fit( varargin ) % process_compute_glm: compute the glm : find B such as Y = XB +e with X % % OlS_fit use an ordinary least square algorithm to find B : B= ( X^{T}X)^{-1} X^{T} Y % AR-IRLS : Details about AR-IRLS algorithm can be found here : % http://www.ncbi.nlm.nih.gov/pmc/art...
a194973ee042a8aabd128ba660b2e8f960b9a20933de2246562737f33327da28
MATLAB
27,042
907
%%%% EXTERNAL FUNCTION % function taken from the fastICA package % complete software may be downloaded from http://research.ics.tkk.fi/ica/fastica/ function [A, W] = fpica(X, whiteningMatrix, dewhiteningMatrix, approach, ... numOfIC, g, finetune, a1, a2, myy, stabilization, ... epsilon, maxNumIterations,...
6af7bfa8891c9b3660aa8874818ac83678c93241c7941aacd50eafaf9b4d1833
MATLAB
27,133
723
%% Overview % The main goal of this pipeline is to simulate whether the proposed method % for cardiac field artefact (CFA) correction is sensitive to mislocation % of the dipole used to model the heart's electromagnetic field. % % Moreover, we test whether using two dipoles instead of one to model the % heart, can corr...
4aa765f7621b2307312ad482112f5541969e4f4a38e49359f5bd9403ade1b916
MATLAB
27,233
868
%% cue %% Two-condition plot: permutation results (Arial 9pt + 50 mm + no legend + 1000 dpi) % Required variables (already available): % TF1, TF2, MFchans, iFreq, freq.time, iTime, MFtime % ----------------------------- % 0) Global font settings (recommended) % ----------------------------- set(groot, 'defaultAxesFont...
82dc8789d0a2bd5b0564f794e23a9434b7b89ee63cb057b07dbb9e15f9cfb469
MATLAB
27,286
769
function [ peak_threshold, extent_threshold, ... peak_threshold_1, extent_threshold_1, t, rho ] = ... stat_threshold( search_volume, num_voxels, fwhm, df, p_val_peak, ... cluster_threshold, p_val_extent, nconj, nvar, EC_file, expr, nprint ); %Thresholds and P-values of peaks and clusters of random field...
d4c8b0f2c9d5aec4b850284895669b48364d07822d34c85ea1ed0c9b2650f478
MATLAB
27,360
546
function BCCT_CaSCN_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'; ...
bda27673fcbfa07da98e10ce8b118aa2f728a8c2941229a315b51613f59e5713
MATLAB
27,525
718
%%%%%%%%%%%%%%%%%%%%% Vectorize all trials at once %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ========================================================================= % Trial-level midfrontal theta POWER + Inter-channel Phase Co...
717d9f2bd10466e1f86fb4ed9bb6cda74ffb41f492bcd6c7075bade8a489dbc9
MATLAB
28,188
746
function varargout = process_nst_compare_montage( varargin ) % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2016 University of Southern California & McGill University % Th...
0b172febab5a5b40228a86cf0b0c4d49315e2c02d08a568fe5abc91ffa5b8f8f
MATLAB
28,471
563
classdef CSVImportTest < 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(...
d58be4a5f579d3ee227d07336a2a16c68fcff2149767906ba5ec205e17002d66
MATLAB
28,821
590
function BCCT_SCN_stat_mainfunc(Parameter) Outputdir = Parameter.Outputdir; Inputdir1 = Parameter.Inputdir1; Inputdir2 = Parameter.Inputdir2; RealComp1 = load(fullfile(Inputdir1,'RealCompPara.mat')); RealComp2 = load(fullfile(Inputdir2,'RealCompPara.mat')); if ~strcmp(RealComp1.RealCompPara.mod,RealComp2.RealCo...
463e2125979bf203a635ec582f994dcff9637ff30790d0f9c67a5efefb5fdd48
MATLAB
28,846
529
classdef NetworkTestResult < matlab.mixin.Copyable % Network level test results % Class to store all relevant results for a network level test. Each test will create an instance of this to store results % % :param test_options: Options and inputs for tests to be run (also called input_struct) % :par...
12b464eeeb402ab488342c17252268cc7176998fe44ee110085ed750145405bc
MATLAB
28,897
533
classdef BrainPlot < handle properties plot_figure edge_test_options network_test_options network_atlas edge_test_result network1 network2 test_name upper_limit lower_limit color_map = cat(1, winter(1000), flip(autumn(1000))); ...
427e18da7ea9da3efb355160706886df23488f7f84dfa6ecf8da8b35d978f935
MATLAB
29,208
702
function [tensorOut, infoOut] = addVariable2Tensor(obj, tensorIn, opt) %ADDVARIABLE2TENSOR Append a preprocessed variable as a new slice in the last dimension. % % [tensorOut, infoOut] = obj.addVariable2Tensor(tensorIn, opt) % % Designed to be called iteratively to build a regressor tensor. Each call % appends ...
f1edadef44db151356b2063b0d7e0810e9b9eb0de0798b484c8b60a81389f914
MATLAB
29,227
753
function varargout = panel_nst_OM(varargin) % panel_nst_OM Panel for the optimal montage % USAGE: bstPanel = panel_nst_OM('CreatePanel', OPTIONS) : Call from the interactive interface % bstPanel = panel_nst_OM('CreatePanel', sProcess, sFiles) : Call from the process editor % s = panel...
41ce1ad7e9d9b623dc40ee483359c5331a4d36b4deff836a23760addfc30092c
MATLAB
29,231
754
addpath(genpath('S:/Roy/ryhattori-PatchWarp-1.3.3.0')); % 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 figGen=0; fprintf('\n=== SWEEPING ALL ANIMALS IN MASTER PIPELINE ===\n'); for animal ...
5da3320ed967d0ddffcd9d5ae53f17a3e9985323bd927f603689854ad8689f98
MATLAB
29,346
671
function [neuralDecodingScores, neuralDecodingData, neuralDecodingModels] = neuralDecodingClassification(obj, processingOpt, trainOpt, testOpt, decoderOpt, visOpt) % NEURALDECODINGCLASSIFICATION Decode task parameters from neural population activity. % % For each cross-validation fold the method trains one classi...