sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c05e8143bfe3944b89ef166a6e3118e0bf5f5aacd21a9ffcc58cb9df468b08c5
MATLAB
7,608
223
function [decodinginfo,errorpos_all] = decoding_position_PFC_novelfamiliar_trial(animalprefix,day,ep,eprun,timerange,cellthresh) %---------------------------------------------------------------% % This is the function for PFC decoding of spatial locations % % using the rate maps from one epoch to decode position in...
61c9df2d2ab1c39d51c12d62f5fbc5a09ea26cf007f3a6d002648c76a2bdaa20
MATLAB
7,613
223
function [decodinginfo,errorpos_all] = decoding_position_CA1_novelfamiliar_trial(animalprefix,day,ep,eprun,timerange,cellthresh) %---------------------------------------------------------------% % This is the function for CA1 decoding of spatial locations % % using the rate maps from one epoch to decode position in...
8fbf21a2808297ee125b9a8120b4b662c4a90f09b4391676c3b6ccb86c153f3f
MATLAB
7,619
222
function [app,behavDIO,soundinfo]=nextStateAction(app) %MDPState,RATState %Maciej's MDP - PHASE 3-4 s = app.MDPState; r = app.RATState; nAreas = 6; behavDIO.action=0; soundinfo.toplay=0; soundinfo.line = []; s.soundIsPlaying=soundIsPlaying(app); s.behavior = categorical({'no'}); s.rewsize = 0; % s.area = r.area.num; % ...
f81ece8f01976e6e550a09bd45826558457f108b656abd3679c4398fd432612b
MATLAB
7,650
222
function [snr_times, deuteron_tables, expdata] = ... prepare_one_session_folder(expdata, i, S) row = expdata.rat_table(i, :); out_folder_rat = expdata.folders.out_folder_rat; fname = sprintf('%02d_%s', row.SessionID, row.SessionType{1}); out_folder_session = fullfile(out_folder_rat, fname); if ~isfolder(out_fold...
8973b864bb2f439b0a1e32721f18358ed8edc9af4c2d92848b14c994f0995c31
MATLAB
7,679
201
function [T, paramF] = createSSAblock(Told,paramFold,bf,ssa_att) % 2000<=bf<=35000 !!!!!!! df=2^(1/6); % params------------------------------------------------------------------- type = cell(500, 1); type(:) = {'freq'}; speaker = ones(500,1)*3; samp_rate = ones(500,1)*192000; trial_dur = ones(500,1)*300; stime = ones(5...
c90ce04e4cdcfa72b4c59579a42b82b9fb2a48fe52db8a9a886cdf4c3dd2511f
MATLAB
7,679
216
function flatten_single_experiment(input_folder) % JN 2021-02-12 sampling_rate = 32000; half_window_silence_sec = 0.005; % 5 ms, this is hard-coded in `flatten_noise_areas.m` % Function flatten_single_experiment() creates a flattened DB for a single RIFF processed experiment. % The function operates on the outputs of...
28bf48da52945007360b08d605d8f7a1aa800986d9db95f20149146284372cb0
MATLAB
7,680
176
function filename=preprocess_functional_filsigreg(subjectdir, filename, fil, gsr, wmcsfr) % starts functional brain preprocessing % realgin all functional scans % This section is using FSL's MCFLIRT tool to conduct % motion correction and then plotting out and saving the motion % parameters as a separate JPEG f...
c7d37045150d4639999cd8f8fd5a46e670c748f93334ef939855cdd249f5d8c9
MATLAB
7,690
253
%This code implements multi-region graph cut image segmentation according %to the kernel-mapping formulation in M. Ben Salah, A. Mitiche, and %I. Ben Ayed, Multiregion Image Segmentation by Parametric Kernel Graph %Cuts, IEEE Transactions on Image Processing, 20(2): 545-557 (2011). %The code uses Veksler, Boykov...
1cd52d8aecf4ce21c89613642cbc1b8a895e34430b98387db399e23a7e8bf26d
MATLAB
7,738
125
% ClinicalASL toolbox 2025, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 25-05-2023 for the MOYAMOYA study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smoo...
6f9ef4fd6c2c643c5a6b3ff5b83faf4d00d189e05fe14765c64e7e4d17f0406c
MATLAB
7,780
218
classdef TrialState < ExperimentState %TRIALSTATE ExperimentState when the subject is on the platform. % This is the only state during which trials will be played and advanced. % Author: Lasse Osterhagen properties % Reinsert an 'early jump' stimulus at the end of the % trialGenerator reinsert = false; ...
f12ec029163e6aec1063c949d115247fbd02b7a9110dd60f6c6dc5c048ffe010
MATLAB
7,831
257
% [kcMax,A0,kcGM,d0,d] = getDcorrSect(im,r,Ng,Na,figID) % --------------------------------------- % % Estimate the image sectorial cut-off frequency based on decorrelation analysis % % Inputs: % im 2D image to be analyzed % r Fourier space sampling of the analysis (default: r = linspace(0,1,50) % ...
098195482711de54c3389df07cd36f2b9e8a07a62203f3f60ed40f1d901f6c96
MATLAB
7,879
188
function TD_plots_mean(U,r_components,left,group_ind,groups,saveDir,fs) %Generate a figure for each CPD component contains. Plotting channels activations on the left and %right hemisphere. Taking group indeces to use in bar plots % Plotting the mean of the signatures of each group of subjects noSamp...
1ff68c519a2ac1c5ff2a883e84155b9d3f9ec011791105499be27a9711d38bea
MATLAB
7,913
241
function [L,N] = superpixels(varargin) %SUPERPIXELS 2-D superpixel over-segmentation of images % % [L,NumLabels] = superpixels(A,N) computes superpixels of image A using % N as the requested number of superpixels. A must either be a 2-D % grayscale image or a 2-D RGB image. The first output argument, L, is a % ...
0bc2b25522d10d2aef01224f8fd5aa72b1d585d973a5a32f2a728d569d156cf8
MATLAB
7,923
182
%---------------------------------------------------------------% % This is the main script for UMAP transformation of neuronal % % population activity. The UMAP MATLAB toolbox (V4.1) is % % needed (https://www.mathworks.com/matlabcentral/fileexchange/% % 71902-uniform-manifold-approximation-and-projection-u...
b8b05cb54588242a4884b9b4a3ad854b48b7da1f7ac2f3b5d9d365464977b189
MATLAB
7,963
231
% Authors : Tatjana Schmitt & Simon Wadle 2019-2022 %function reads tiff stacks and scales pixels down to end size function resized_image = tiff_stack_import_block_process(tiff_fullpath, end_size) if iscell(tiff_fullpath) nr_tiffs = size(tiff_fullpath,2); nr_frames = zeros(1,nr_tiffs); %calcu...
1a1dfb243273f8c9275872c760656303d57bfe7d5a7129eeb18736ab361f82df
MATLAB
8,009
127
%% LaBGAS_get_firstlvl_dsgn_obj % % This script contains a function that defines a number of fields of % the CANlab style first level DSGN structure array % for Maaike's emosymp study on IAPS picture-induced bodily symptoms. % This function is used in LaBGAS_1_spm_fit_firstlvl_models.m to % run first level analysis us...
747736a7c4df6a8e5ae6e97ed031f079c1d3d20802b15c72aab0e62b985af4a0
MATLAB
8,071
149
function shearletSystem = SLgetShearletSystem2D(useGPU, rows, cols, nScales, shearLevels, full, directionalFilter, quadratureMirrorFilter) %SLgetShearletSystem2D Compute a 2D shearlet system. % %Usage: % % shearletSystem = SLgetShearletSystem2D(useGPU, rows, cols, nScales) % shearletSystem = SLgetShearletSystem2D(useGP...
cff5206533e2890e400202237aece0796500a5aef3df407a13786a3e91ad06fe
MATLAB
8,076
220
function coord = Coordinator(varargin) % Coordinator class constructor. % COORD = COORDINATOR(MAIN_SIGNAL) constructs a Coordinator % for the given Main_signal. % COORD = COORDINATOR(BASIC_LINE) constructs a Coordinator % for the given BASIC_LINE. % Coordinator is the base class of all Coordinators. % Th...
23a07b2ac4c407cc9fbde109c09d31f78ada6840bd1dfd43f0de0cedaed3088c
MATLAB
8,091
314
%% Add paths clear; clc; % TDR path tdrDir = '/Users/jeongjunpark/Desktop/Joonyeol/Mante'; addpath(fullfile(tdrDir,'TDR')); addpath(fullfile(tdrDir,'TDR','nansuite')); addpath(fullfile(tdrDir,'TDR','tools')); %% Load data % firing rate % time = 101:20:621 (300 = stimulus onset) % time window = 20ms(0~19ms) from time...
b8472f49dd942e6acab0f10fbf99fb831a1d237c0e7ab0863467e57c36ce49c0
MATLAB
8,129
194
%% Parameters ROIs_for_Dom = {'HGPM','HGAL','PT','PP','STGP','STGM','STGA','InsP','STSL','MTGP','MTGM','MTGA','SMG','AGA','IFGop','IFGtr','IFGor','MFG','OG',... 'dPreCG','vPreCG','vPostCG','PMC','PHG','FG','ITGP','ITGM','ITGA','TP','InsA','GR','Amyg','Hipp'}; measure = 'envCorrDBTorth_gamma'; threshold = 1/...
6316f2eb9dbfe421912f63ddb2c1c084738f534e26af0bf6f07089e1edf3b6a4
MATLAB
8,218
205
classdef GapTrainingGUI < DetectionGUI %GAPTRAININGGUI GUI for gap detection training. % Allows to change properties of a GapTrainingStimuliGenerator to change % gap properties. Furthermore, allows to change the maximum reaction time % after stimulus offset, that will lead to a reward. % Author: Lasse Osterhagen...
f80963a0ee8ca2c2b296952ad3fd9f74430acf77c850f39728b4297b5312f6e9
MATLAB
8,233
214
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <trAlign: aligns an input signal with a reference signal > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Softw...
5605c673d925222f9988079a1fe8b18ae7b96e1d92473a329a3b2302c35f6c5e
MATLAB
8,246
132
function SUBJECT = ASLConvertDICOMtoNIFTI(SUBJECT, imager, vTR_only) % ClinicalASL toolbox 2023, JCWSiero SUBJECTdir = SUBJECT.SUBJECTdir; DICOMinputdir = SUBJECT.DICOMdir; NIFTIoutputdir = SUBJECT.NIFTIdir; % check operating system: unix vs windows if isunix % unix if nargin == 2 if strcmp(image...
bb9f753d7ed8e6fb040c5948b538da34ed7d3be5251900f412918ab9f213b54f
MATLAB
8,249
296
% This code is a modified version of the original code from Mante et al 2013. % V. Mante, D. Sussillo, K. V. Shenoy, W. T. Newsome, Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature. 503, 78–84 (2013). %% Add paths clear; clc; % TDR path tdrDir = ''; % put your code directory addpath(f...
a6fcbb29de5bda110ed0dea263902d443baeb6369eb1b720cd1709347ff3ac85
MATLAB
8,328
143
clear close all clc % settings filename_exe = 'behavioral_data_exe'; % these are duration data of all valid trials of the sessions in which mirror neurons were recorded (177 MN) filename_obs = 'behavioral_data_obs'; % load data load (filename_exe) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
f726037f3f22672a9388d8b1cd222102a6d69b7b2ec5e4f4216d796c5358f81b
MATLAB
8,367
323
%%%This program is written by Zhenzhou Wang, for more information please %%%contact: zzwangsia@yahoo.com or wangzhenzhou@sia.cn %%%This program is free for academic use only. %%%Please reference and acknowledge the following paper: %%%%%%[1]Z.Z. Wang, "A new approach for Segmentation and Quantification of Cells or ...
785984c495b758b68eade2704ff98d64b224b4a202b6fdb0c902b1c021123685
MATLAB
8,386
245
%% Constant decleration and loading %clear % close all constants options = odeset('RelTol',1e-4,'AbsTol',1e-4); %% Choice of stimulation parameters start_stim = 1.015; % [s] When to start the current stimulation end_stim = 60; % [s] When to end it f_stim = 1; % [Hz] At what frequency do you want ...
69301fb42840b3e5214f39a28089d064b38458e91a1fd334c20c43dd228a65be
MATLAB
8,406
298
%% Add paths clear; clc; % TDR path tdrDir = '/Users/jeongjunpark/Desktop/Joonyeol/Mante'; addpath(fullfile(tdrDir,'TDR')); addpath(fullfile(tdrDir,'TDR','nansuite')); addpath(fullfile(tdrDir,'TDR','tools')); %% Load data % firing rate % time = 101:20:621 (300 = stimulus onset) % time window = 20ms(0~19ms) from time...
5f0b80fb4be1bcee9bf49441a761094ca6430da002b2c22cf033b237d9dda7b6
MATLAB
8,448
310
%% Add paths clear; clc; % TDR path tdrDir = '/Users/jeongjunpark/Desktop/Joonyeol/Mante'; addpath(fullfile(tdrDir,'TDR')); addpath(fullfile(tdrDir,'TDR','nansuite')); addpath(fullfile(tdrDir,'TDR','tools')); %% Load data % firing rate % time = 101:20:621 (300 = stimulus onset) % time window = 20ms(0~19ms) from time...
39ee30b25fb2ad2c1cfb282cda564fa8379d8a8c2592dac36dcd56d3578f1305
MATLAB
8,476
331
%%%This program is written by Zhenzhou Wang, for more information please %%%contact: zzwangsia@yahoo.com or wangzhenzhou@sia.cn %%%This program is free for academic use only. %%%Please reference and acknowledge the following paper: %%%%%%[1]Z.Z. Wang, "A new approach for Segmentation and Quantification of Cells or ...
afec77f851936a99a500c6d0746c008d89019eac09fdd3a555a7913c9091dfab
MATLAB
8,534
201
function TD_plots(U,r_components,left,condition_ind,conditions,saveDir,fs) %plots time, channel, and subj components % Plotting channels activations on the left and %right hemisphere. Taking condition indeces to use in bar plots noSamples_time=length(U{1}); xbase=1;ybase=1; activations=zeros(4...
ff1bd2d28fc5bae49bde3963ffda920d49c14734fb822948585bde666a679519
MATLAB
8,570
217
% It is sample MATLAB codes for the manuscript entitled % "A magnetoencephalography dataset during three-dimensional reaching movements for brain-computer interfaces". % A "topoplot" function and related sub-functions in the EEGLAB toolbox are needed to plot a topography. % The EEGLAB software is available at htt...
085ed0681dd006f41c22dc4398b8bce65f929311c8885313871a764493d2bc7b
MATLAB
8,586
264
function [ stat_out ] = cs_nmri_statistics( all_subjects, opt, params ) %[ all_subjects ] = nmri_statistics( all_subjects, opt, params ) % Will do generate a tabulated overview of metrics (all that are readable) % via nmri_load_metrics for any number of subject % % all_subjects = cell array of subjects (see nm...
3ffb9b77ce85922fe82ea883ace7c2ae9a0de27919bc7756b55e37dc9238261e
MATLAB
8,615
265
function [ stat_out ] = cs_nf_ft_statistics( all_subjects, opt, params ) %[ all_subjects ] = nf_ft_statistics( all_subjects, opt, params ) % Will do generate a tabulated overview of metrics (all that are readable) % via nf_ft_load_metrics for any number of subject % %s_ % all_subjects = cell array of subjects ...
830a7f1bd8071f66b7ce0f1ace2917540659a0519e71a99fa056101a58776379
MATLAB
8,616
221
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <fitHRF: Generates a series of HRFs and performs a best-fit GLM to input data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as publ...
07d2443fc2b4dfac539c4de7e24615b6f43f9d8926c8baa14ab8570f007dd3df
MATLAB
8,645
137
%% LaBGAS_get_single_trial_dsgn_obj % % This script contains a function that defines a number of fields of % the CANlab style first level DSGN structure array % for Maaike's emosymp study on IAPS picture-induced bodily symptoms. % This function is used in LaBGAS_1_spm_fit_firstlvl_models.m to % run first level analysi...
5831e2e0fcd3293463217446ca6b8bb92981864489f544dc301f251b2b47c12e
MATLAB
8,660
227
% HEADER: % This script allows you to test model-, rat- and human-driven classification % of epileptic brain states (interictal, preonset, onset and ictal) % using prototype comparison. It looks at 'individualized' and 'generalized' % classification performance, where 'individualized' means the performance in % ...
9ff21e73b4db83ffac435a0dc6412fbb4cf03598df2b5dc45e13eb7ea2de4b55
MATLAB
8,668
126
% Do PALM on IGE - controls (ImCoh/Power ~ group) analysis_dir = '/home/uni10/nmri/projects/cstier/aging_analysis/export/all_subjects'; export_func = '/home/uni10/nmri/projects/cstier/aging_analysis/export/all_subjects/yeo/'; export_th = '/home/uni10/nmri/projects/cstier/aging_analysis/export/all_subjects/ld10_sm/yeo/...
70ce5343d7bbda72eb50cd41c55a03ff44ff912682c958a767e9c180ce750b7f
MATLAB
8,693
309
function [x,fval,exitflag,output] = fminsearchbnd(fun,x0,LB,UB,options,varargin) % FMINSEARCHBND: FMINSEARCH, but with bound constraints by transformation % usage: x=FMINSEARCHBND(fun,x0) % usage: x=FMINSEARCHBND(fun,x0,LB) % usage: x=FMINSEARCHBND(fun,x0,LB,UB) % usage: x=FMINSEARCHBND(fun,x0,LB,UB,options) % usage: x...
51669491642e470cec7db1e4be7784dad6b089335c51830a741581b12698bdb7
MATLAB
8,696
303
function output=new_data_plotter(DATAFILE,SAVEFILE) %GUI for choosing a cluster for ephys_cluster.m % % load the information collected by outloop load(DATAFILE,'variableCellArray','peakLocation','property_names') % load the scores, their locations, the file number, and % the peak locations for subsequent saving syl...
eeb165cf08778bd82f1f15c5387078e8d9678056f23ba87f812a643a3d4953ad
MATLAB
8,754
210
%% Direction Tuning % align preferred direction to 0 degree to combine data % include only when there are tuning data of both two prior block % Fig 4. clear; clc; close all; load('Tuning.mat'); %% fit tuning curve to each monkey's data % choose a monkey monkey = 'B'; % A for Monkey A, B for Monkey B if strcmp(monkey,...
95d63d4f54b4a99323a285c5e88accdc0ccd31fdcc248f90b68bd2c9325677c9
MATLAB
8,812
225
% fdr_bh() - Executes the Benjamini & Hochberg (1995) and the Benjamini & % Yekutieli (2001) procedure for controlling the false discovery % rate (FDR) of a family of hypothesis tests. FDR is the expected % proportion of rejected hypotheses that are mistakenly rejected % (i...
be313a892e3a743f80d23706dff3251c322ec135ed1406669388a6965399dad2
MATLAB
8,831
143
function MRI_DIAMOX_UMCU_ClinicalASL_SSVB_CVR_IMAGER(inputdir, outputdir) % ClinicalASL toolbox 2025, JCWSiero % for MRI DIAMOX scans, via IMAGER % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smoothing, CVR registration, cal...
f16e610777b4b08ed230f92983532f2c67a01a6fe88562b2c185d43a7a045496
MATLAB
8,846
240
%analyze_results %-------------------------------------------------------------------------- % Analysis file for the data from manuscript "Causal evidence for frontal % cortex organization related to perceptual decision-making" % % The file runs all TMS analyses reported in the paper. % % Written by: Doby Rah...
273e8bdad14b1db9e6a2bac114905ca691db65f5848940713fe9f30e4becf2ea
MATLAB
8,923
234
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <fitHRF2: Generates a series of HRFs and performs a best-fit GLM to input data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as pub...
36d34f06db95ea64ffc2ef7d88eb03abad7f0898c85ad9e480bc9f892a60e39b
MATLAB
8,933
225
%---------------------------------------------------------------% % This is the main script for getting all dichotomies after % % UMAP transformation. UMAP MATLAB toolbox (V4.1) is needed % % (https://www.mathworks.com/matlabcentral/fileexchange/ % % 71902-uniform-manifold-approximation-and-projection-u...
8221dfa2ee1c12dfb647ebaec6552b34f224516d75a8b0d3cce24d6d9840f04b
MATLAB
8,937
319
%% Add paths clear; clc; % TDR path tdrDir = '/Users/jeongjunpark/Desktop/Joonyeol/Mante'; addpath(fullfile(tdrDir,'TDR')); addpath(fullfile(tdrDir,'TDR','nansuite')); addpath(fullfile(tdrDir,'TDR','tools')); %% Load data % firing rate % time = 101:20:621 (300 = stimulus onset) % time window = 20ms(0~19ms) from time...
cad04743aa61545b29c6eae6b9de2655b99b02797c5fe647a7d7794af6c63a84
MATLAB
8,985
343
%% mean dir std clear; clc; %%%%%%%%% Monkey A %%%%%%%%% load('direction_day_A.mat'); ah_std = mean(sb1c100std-sb2c100std,1); al_std = mean(sb1c008std-sb2c008std,1); a1 = sb1c100std-sb2c100std; a2 = sb1c008std-sb2c008std; t = 1:20:981; t = t-400; fig_a = figure; subplot(1,2,1) errorbar(t,mean(sb1c100std,1),std(sb1c1...
60c01a92631d6a12b8ebf4a07c4c07c3f9dce3a1db2c872100214bae429f778a
MATLAB
8,986
194
% Modify to specify image file subdirectories, wildcards to locate images, condition names % %% Set up conditions % ------------------------------------------------------------------------ % conditions = {'C1' 'C2' 'C3' 'etc'}; % structural_wildcard = {'c1*nii' 'c2*nii' 'c3*nii' 'etc*nii'}; % functional_wildcard = {'...
90a5f98470a23e9b807e00bb9b6607060c2b2b405de05cb4d6bbe7d026f58c73
MATLAB
9,029
216
%---------------------------------------------------------------% % This is the main script for calculating the distance of % % neural states of the same spatial location vs. the same % % trajectory phase in the original state space. % % -- Wenbo Tang (Jan 07, 2023) ...
b930dc7e202195dfc8ef6330418c9b64d9ab36bc4fca9386df9e1c3a0d9393f0
MATLAB
9,029
288
function [Y,ndx,dbg] = natsortfiles(X,rgx,varargin) % Natural-order / alphanumeric sort of filenames or foldernames. % % (c) 2014-2021 Stephen Cobeldick % % Sorts text by character code and by number value. File/folder names, file % extensions, and path directories (if supplied) are sorted separately to % ensure...
136dfc915ec322442988d138a30df6ee050b8c9b3c02df2364abad80750fb6bf
MATLAB
9,103
135
% ClinicalASL toolbox 2023, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 25-05-2023 for the APRICOT study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smoot...
578874b96355370e94e6ee0163fb72d3016ae2be88827d0bfc60b718bcd50f21
MATLAB
9,130
238
% This script runs single-level mediation models for proj-emosymp % (Van den Houte, Bogaerts, et al, in prep), in patients only, % with the following variables % X: CTQ % M: different options % 1. NPS response (including subregions) for each contrast % 2. voxel-wise brain mediator % 3. Principal Directions of Mediati...
86f8ed8dcffc5876b47f92df5608ac185a741095cb18f209adfa0e961c9a4ee3
MATLAB
9,153
240
%% Parameters ROIs_for_RS = {'HGPM','HGAL','PT','PP','STGP','STGM','STGA','InsP','STSU','STSL','MTGP','MTGM','MTGA','SMG','AGA','AGP','IFGop','IFGtr','IFGor','MFG','SFG','ACC','OG','TFG','dPreCG','dPostCG','vPreCG','vPostCG','PMC','CingM','PCCpreCun','PHG','FG','ITGP','ITGM','ITGA','TP','InsA','fOperc','GR','SPL','L...
9dfadd318cf5d0ce6b0d10d5e788c392794c227f0f390412bae78f0c6125432e
MATLAB
9,362
255
function gramm_2x2laminar_subline(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear...
33696822479af63bfb5ca2ad61ad63ff000c3a4dbfeb502422ee0be733b8d9ff
MATLAB
9,363
251
%---------------------------------------------------------------% % This is the main script for calculating population vector % % (PV) similarity -- Wenbo Tang (Jan 05, 2023) % %---------------------------------------------------------------% clc close all clear all; %% % set directory famnov_dir =...
b537b472afe1970c8739c28137565af837fcad553198baa76e0967a5f2c9306d
MATLAB
9,371
269
% This script runs a 5-fold cross-validated lasso-PCR model to predict % somatic symptom ratings from brain responses to positive, negative, and % neutral IAPS pictures (3 condition images from classic GLM per subject) % for proj-emosymp (Van den Houte, Bogaerts, et al, in prep). % % It requires all study-specific and ...
7e5b97cd8942b63fd1c109a73823f5e7ab9de5093bb215d285cd04fc39c1bf78
MATLAB
9,672
362
function [ subject, data ] = nmri_autodetect_artifacts( subject, data, params ) %[ subject, data ] = nmri_autodetect_artifacts( subject, data, params ) % This function will do automated trials and channel artifact selection % similar to the vft_rejectvisual % % subject = subject structure, see nmri_read_subject ...
99cb4c119f37571acf0e1bd22ed428dcc61dcc59073244ace9c990d475f25389
MATLAB
9,687
368
%% Correlation between FR ratio and difference of the directions(preferrred-target) % Fig. 2, d-i clear; clc; close all; %load spike data load('spikes.mat'); %load preferred and target directions load('pf_tar_dirs.mat'); % Responses to prior direction % Monkey A targetHighWide_A = mSpikes_A_b1c100; % wide-prior, h...
4fc374984005d7827ac51cefd606ce8632d9c601c290c8a78d53d68e2e96b79c
MATLAB
9,693
211
clear all;close all;clc; preproc_dir='E:\mouse_development'; template_dir = 'E:\mouse_development\md_brain_atlas'; ROIs = {'Somatosensory_Cortex' 'SCR' 'VIS1R'}; option_cohr = 1; %Load HRF load('E:\code\HRF\hrf.mat'); %hrf hrf2 = [zeros(1,5) hrf]; %Should delay a little cd(preproc_dir) age_list = dir('mous...
f86921907ac2f846a556b60c3890e294cea0dd03a9b4ef1bab779ab0e6a4811c
MATLAB
9,696
142
% ClinicalASL toolbox 2023, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 30-04-2025 for the APRICOT/MOYAMOYA/PXE/STROKE study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL anal...
5573e49735abff20ffb1f9039c98f33819c7d8e08081a0f366f16d0863e07b65
MATLAB
9,718
307
function IDX = singleSessionIDX(penetration,sdfwin,X); %% load session data global STIMDIR cd(STIMDIR) load(penetration,'STIM') matobj = matfile(penetration); %% Set up variables for electrode loop % Balance conditions if ~any(contains(STIM.paradigm,'brfs')) warning('no brfs on day...') disp(penetration) e...
82e15310c4c46a9b13f4dfa684d4aee84543d344fba425bf77e396f6804c7081
MATLAB
9,755
227
%% Function to do the anchoring analysis based on vessels % 2021/11/12- % Yunhao Bai & Bokai Zhu % Features: %'_cellRatio': instead of simple cell number encountered, use the cell overlap pixel ratio to reflect the cell distribution % use additional filter to solve the overlapping issue when adjacent tumo...
92c87dc56a1d5e4397364cf589023e3c5cc4e0cf397c50c3e9fa1f3c2737dace
MATLAB
9,755
151
function MRI_DIAMOX_UMCU_ClinicalASL_CVR_IMAGER(inputdir, outputdir) % ClinicalASL toolbox 2025, JCWSiero % for MRI DIAMOX scans, via IMAGER % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smoothing, CVR registration, calculat...
9b4e8fc77ce7b542951b7ea10d3ccc3830f012dbe4e1a19e733d6bdeace07b4e
MATLAB
9,766
227
%---------------------------------------------------------------% % This is the main script for calculating the distance of % % neural states of the same spatial location vs. the same % % trajectory phase on UMAP neural manifolds. The UMAP MATLAB % % toolbox (V4.1) is needed (https://www.mathworks.com/ ...
34b7d110fce6979a164896fea41e4fdb86e45e5e21ed4af36403d8406e36658d
MATLAB
9,768
233
function [behav_distrib_feat,gmm_grp,cluster_seeds] = generate_behavior_clusters(DLC_data,subsampling,... N_run_tsne,N_run_gmm,min_nb_frames_per_cluster) % This function performs multiple iterations of tSNE dim reduction followed % by GMM clustering to behavioral clu...
7b8e402bf4bfe5c5def010a43f341c0d7276d066e9be4e4cfc312a087372deb1
MATLAB
9,778
154
function [y_hat_wi] = MIRO_Fast_Wiener_Video(z, y_hat, sigma,sampling) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This algorithm is adapted from the article: % % [1] K. Dabov, A. Foi, and K. Egiazarian, "Video denoising by sparse 3D % transform-domain collaborative filtering," Eur...
4a4e3cd0aab0bdf2ed48857057342a2d50a4ec947c86e27c7ae4fe804982f436
MATLAB
9,878
286
%BONE2 Black-blue-white colormap % % Examples: % map = bone2; % map = bone2(len); % B = bone2(A); % B = bone2(A, lims); % % Similar to MATLAB's bone function, this colormap has been designed to % achieve perceptual uniformity. % % The function can additionally be used to convert a real-valued array ...
b04140fed5a674c03344ac81a3a169d8fd1efb23b9393813f64f5821ee516688
MATLAB
9,914
286
%THERMAL Black-purple-red-yellow-white colormap % % Examples: % map = thermal; % map = thermal(len); % B = thermal(A); % B = thermal(A, lims); % % A colormap designed to replicate the tones of thermal images, as well as % achieve perceptual uniformity. % % The function can additionally be used to co...
9118bace581a8ca249657b9e1f18f0f0f80524d8835c993c3500df15c41ead66
MATLAB
9,925
286
%SEPIA Black-brown-white colormap % % Examples: % map = sepia; % map = sepia(len); % B = sepia(A); % B = sepia(A, lims); % % A colormap designed to replicate the sepia tones of old photographs, as % well as achieve perceptual uniformity. % % The function can additionally be used to convert a real-va...
2df586b5b3f9ca04b3591cb6f5deb6e7a256acb937dadf7e504d91a0db76f0b1
MATLAB
9,929
303
function [ stat_out ] = cs_create_global_files( all_subjects, opt, params ) % This script makes files with global statistics for selected metrics for % frequency-specific statistical analyses % % Written by NF and modified by Christina Stier, 2020/22 % Will do generate a tabulated overview of metrics (all that are rea...
015d20f2d6399730e41096e8aa3b70498927f025e6d8697b7db66bfce8bfcad6
MATLAB
9,933
239
clear all % Defining network model parameters % PC In TC TI TRN W = xlsread('./FLNe.xlsx','Sheet2'); vth = [10,4,10,4,4]; tau_v = [40,10,200,20,40]; Tsig= [12,10,12,10,10]; %beta_ad = [0,4.5,0,4.5,4.5]; alpha_ad =[0, -2,0,-2,-2]; p=[ 10, 4, 10, 4, 4;...
45c2a0e957e5bd3e70ac32618cc95ad58178332391d991bc1946d441ba269d46
MATLAB
9,933
386
function IDX = IDX_iScienceSubmission_findTimingOffsets %% load session data global STIMDIR cd(STIMDIR) didir = strcat(STIMDIR,'\'); saveName = 'IDX_iScienceSubmission_highContrast.mat'; % THIS IS CONTRAST LEVELS OF .41-.75 INCLUSIVE anaType = '_AUTO.mat'; flag_saveIDX = true; kls = 0; list = dir([didir '*' ...
102a3d540c827548f235c5745e2276d7490365423d0f5575e2f3dd531be93ec1
MATLAB
9,940
323
%% Population Vector Decoder / Maximum Likelihood Estimate % Fig. 3, e-f clear; clc; close all; % load experimental data load('Monkeys_cir.mat'); Monkeys = Data; % gamma parameters of prefer and null response distribution % high, prefer hp = Monkeys(1).Tuning_pfnull(1,:); nanidx = find(isnan(hp)); hp(nanidx) = []; p...
1810dcf387a191c097af74953d9a3714b1a3dafda37fbc9fbf6e1b0b3a7efca9
MATLAB
9,940
346
function fit = fit_meta_d_MLE(nR_S1, nR_S2, s, fncdf, fninv) % fit = fit_meta_d_MLE(nR_S1, nR_S2, s, fncdf, fninv) % % Given data from an experiment where an observer discriminates between two % stimulus alternatives on every trial and provides confidence ratings, % provides a type 2 SDT analysis of the data. %...
a033dbcaee0c47940ed240d8b96fb9289607d119805abbfb4c21d6590454d1ea
MATLAB
9,950
287
%COPPER2 Black-copper-white colormap % % Examples: % map = copper2; % map = copper2(len); % B = copper2(A); % B = copper2(A, lims); % % A brighter variation of MATLAB's copper colormap, which also continues on % to white. This colormap has been designed to achieve perceptual % uniformity. % % The f...
a297267a51afec0157b82cadaf2fb51f62654c4924fc8f574fb0b941dbfd3fe0
MATLAB
9,986
287
%DAWN Black-purple-blue-green-yellow-white colormap % % Examples: % map = dawn; % map = dawn(len); % B = dawn(A); % B = dawn(A, lims); % % A black to white colormap with several distinct pastel shades reminiscent % of colors at dawn. This colormap has been designed to achieve perceptual % uniformity....
b7329260fec738d26f9dcdc1247a4fd49fad0bcb4b5115aa3ba384526b6c07e7
MATLAB
9,996
287
%DUSK Black-purple-blue-green-red-yellow-white colormap % % Examples: % map = dusk; % map = dusk(len); % B = dusk(A); % B = dusk(A, lims); % % A black to white colormap with several distinct pastel shades reminiscent % of colors at dusk. This colormap has been designed to achieve perceptual % uniform...
9dde78d63d8fb62292eb258c09f4801e8465bc338237d28d4c71b221538f0de8
MATLAB
10,002
320
function [hF1,hF2,hB] = imoverlay2(B,F,climF1,climF2,climB,cmap1,cmap2,alpha,haxes) %Other than the function of image overlaying same as the 'imoverlay'function %This function is specifically used for showing two sets of data with two different colormaps, %and showing two colorbars. In the current situation, data wa...
42b71c501bacb14c4e5e11a8626311c38d9f90f9392a49794e0732f23f3c4ff8
MATLAB
10,020
243
function [varargout]=errorbarxy(varargin) % ERRORBARXY is a function to generate errorbars on both x and y axes % with specified errors modified from codes written by Nils Sjöberg % (http://www.mathworks.com/matlabcentral/fileexchange/5444-xyerrorbar) % % errorbarxy(x, y, lerrx, uerrx, lerry, uerry) pl...
dd0019a8714215ad4dea640d2c2b647897fd78f528703a5a49261897a67be968
MATLAB
10,100
324
% Make sure tm goes out to .9 (in time for the second stimuli) Hopefully I % can crop the extra .1 later if needed. But this should at least show me % the second peak as a sanity check. clear tic didir = 'T:\diSTIM - adaptdcos&CRF\STIM\'; saveName = 'diIDX_AUTO_halfTM_MedMedC'; % THIS IS CONTRAST LEVELS OF .41-.75 I...
865e6fa72eba7eb4fd40b7e2b552e10a4183336345c169b250c49c0d0dde935c
MATLAB
10,132
114
function SUBJECT = ASLSaveResultsCBFAATCVR_FAST(SUBJECT) % ClinicalASL toolbox 2025, JCWSiero % Registration postACZ to preACZ if strcmp(SUBJECT.RegistrationMethod,'elastix') % use Elastix: S. Klein, M. Staring, K. Murphy, M.A. Viergever, J.P.W. Pluim, "elastix: a toolbox for intensity based medical image reg...
db79c79bef9badbd18af71aeea703e506563554763a7510cee7be1dbf4539477
MATLAB
10,134
222
% Neuromag layout of planar gradiometer % This function returns the positions of 204 MEG channels % Copyright by Hong Gi Yeom % You can use this code for academic purposes function [position]=neuromag_layout_planar() p=[ 1 -48.186871 26.886379 6.000000 3.500000 0113 2 -48.186871 31.886379 6.000000 3.500000 0112 4 -39...
8fd27fffbc110e46e73df45e94573a243f904827825cabba1e22fe0b12d86e03
MATLAB
10,135
215
function file_format_data=get_file_format(stimlist) str={}; global BF; global BFTHR; global NBTHR; nb=BF; str{1}=['BF=',num2str(nb),';']; bft=BFTHR; str{2}=['BFTHR=',num2str(bft),';']; nbt=NBTHR; str{3}=['NBTHR=',num2str(nbt),';']; % run_mode=get(meta,'Run_mode'); % str{4}=['META_RUN_MODE=''',run_mode,''';']; % nu...
9182102e7d4f5fb5c8dd3c019486ed402ed2971ce89b33e21638f90b244cd67d
MATLAB
10,143
214
function file_format_data=get_file_format(stimlist) str={}; global BF; global BFTHR; global NBTHR; nb=BF; str{1}=['BF=',num2str(nb),';']; bft=BFTHR; str{2}=['BFTHR=',num2str(bft),';']; nbt=NBTHR; str{3}=['NBTHR=',num2str(nbt),';']; % run_mode=get(meta,'Run_mode'); % str{4}=['META_RUN_MODE=''',run_mode,''';']; % nu...
6a22372bc2165d1ae980126586e2b156967a338e50255adc0e304355c3b0c12f
MATLAB
10,152
320
function dirTuningInfo = dirTuningEst(directions, resp, Wgt); rMax = max(resp); maxIndex = find(resp == rMax); if length(maxIndex) > 1 maxIndex = maxIndex(1); end startDir = directions(maxIndex)*pi/180.0; startDirPre = directions(maxIndex)-60; if startDirPre < 0 startDirPre = startDirPre+360.0; ...
75a964ef28fbd279532d2e9dc4f452c64991e2bf8957e0313f1a6836b7764ba0
MATLAB
10,153
259
% This script runs single-level mediation models for proj-emosymp % (Van den Houte, Bogaerts, et al, in prep), with the following variables % X: group (patients versus controls) % M: different options % 1. NPS response (including subregions) for each contrast % 2. voxel-wise brain mediator % 3. Principal Directions of...
ad6f904246f9d33147d78cd7a2d0395af891c3dd91fe6044613a5849977467fa
MATLAB
10,189
283
function f = MakeONFilter(Type,Par) % MakeONFilter -- Generate Orthonormal QMF Filter for Wavelet Transform % Usage % qmf = MakeONFilter(Type,Par) % Inputs % Type string, 'Haar', 'Beylkin', 'Coiflet', 'Daubechies', % 'Symmlet', 'Vaidyanathan','Battle' % Par integer, it is a parameter related t...
0fe2b8fa0f3729d1562b8887abf45a06600c888298baa6a89eab8f7ca3ffcb94
MATLAB
10,284
422
%%%This program is written by Zhenzhou Wang, for more information please %%%contact: zzwangsia@yahoo.com or wangzhenzhou@sia.cn %%%This program is free for academic use only. %%%Please reference and acknowledge the following paper: %%%%%%[1]Z.Z. Wang, "A new approach for Segmentation and Quantification of Cells or ...
34541537f684e6760b2bf71495947c65bf92d472a23dd4bec734d1852ded3de6
MATLAB
10,311
270
function GLM_getOnsets() % intended for OBIWAN hedonic reactivity task % get onsets % Simplified model on ONSETs 7 (STARTTRIAL, 2*TASTE, 3*questions 1 RINSE) % last modified on MARCH 2021 dbstop if error clear all ana_name = 'GLM_GUSTO'; session = {'second'}; %% DEFINE PATH cd ~ home = pwd; homedir = [home '/OB...
b0dcb143a10ae4aa79c0967ca7c94d30900483e1f740052e4ed5eac853e4863b
MATLAB
10,353
314
%Load the individual deltaF signals for each trial and the concatenated deltaF signal for all trials %Load all of the behav files and make sure the names are changed to the %corresponding trial. For example, for trial 2, name it behav_2 for trial %3, name it behav_3 and so on. %% Calculate the Z-score for the deltaF ...
cddee5756894c2fed5ee37163b7a1ccaf158e276c94dc7eb9a661413ce46e12c
MATLAB
10,453
154
% ClinicalASL toolbox 2023, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 25-05-2023 for the MOYAMOYA study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smo...
1de9c235f294eaa5897988ee2cfffdfd056ac12d9b638a430037850655ed272b
MATLAB
10,509
250
%---------------------------------------------------------------% % This is the main script for CCGP of different environments % % using linear SVMs; Libsvm MATLAB toolbox (V3.22) is needed % % (https://www.csie.ntu.edu.tw/~cjlin/libsvm/). % % -- Wenbo Tang (Jan 07, 2023) ...
50265aac44245386305af90f2d53d4a2cd55cd86906639c47292671992e07498
MATLAB
10,513
292
function [synaptic_weight, list_pot, list_dep, ca3_peak_locations] = Sim_CA3CA1_Romani(velocity, inductions, init_weight, L, n_ca3, param) % get the basic setup parameter as length of track, number of CA3, peak % positions, time step, duration of the plateau if nargin < 4 L = 187; end ...
f3cd23e924e4376c6cd90faf0631e612ccb103859618af302ea7316b6e974f7f
MATLAB
10,553
258
classdef ToneTrainingGUI < DetectionGUI %TONETRAININGGUI is a GUI for tone in noise detection training. % Allows to change properties of a ToneTrainingStimuliGenerator to change % tone properties. Furthermore, allows to change the maximum reaction time % after stimulus offset, that will lead to a reward. % Autho...
f4ceb117612c16664b4fa22e305c95f9f563af145077c5c4914b18dedd5fef9c
MATLAB
10,579
304
function decodinginfo = decoding_position_PFC_novelfamiliar_cross(animalprefix,day,ep,linfields,decoded_trajtime) %---------------------------------------------------------------% % This is the function for PFC decoding of spatial locations % % during the test trial (cross-validation procedure) % % -- We...
5f16ef97ea0d4ed119dfda1718bffcc98d115dd199bc48cba9665fba48ee1517
MATLAB
10,619
255
% This code performs eye-tracking data processing and analysis. It extracts % fixation events from eye-tracking data files and calculates the mean % deviation of the fixations in the x and y axes. It then saves the mean % deviation values for each participant and task in a structure called % meanDeviationData. % %...
486929514b59b48a59fade3ec1696c235e4e3dd7d7377decfe1bc65a8a694ee1
MATLAB
10,674
288
%Load the individual deltaF signals for each trial and the concatenated deltaF signal for all trials %Load all of the behav files and make sure the names are changed to the %corresponding trial. For example, for trial 2, name it behav_2 for trial %3, name it behav_3 and so on. %% Calculate the Z-score for the deltaF ...
dbcf05f93c89c24a7384fa60e090c561c084f0ccaf2fb55c7f816d02364d4b86
MATLAB
10,722
152
% ClinicalASL toolbox 2023, JCWSiero %%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 25-05-2023 for the MOYAMOYA study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smoot...
5adf9a34e4f5ace24514b9202300a21d09e2d1345e4fc915051472bbe9877773
MATLAB
10,733
305
function decodinginfo = decoding_position_CA1_novelfamiliar_cross(animalprefix,day,ep,linfields,decoded_trajtime) %---------------------------------------------------------------% % This is the function for CA1 decoding of spatial locations % % during the test trial (cross-validation procedure) % % -- We...