sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
35871842dc963d0b8880de9a50b7fade04fa4a1805732c6bf1cc213359e26337
MATLAB
7,595
264
%% read [data,id,~]=xlsread('L:\Results\Ishita\Log2abs0.5.xlsx'); prot = tblread('L:\Results\Ishita\Copy of Log2abs0.5 GO.txt','\t'); protcl=prot(:,1:12); %% optimize find min variance f = @(x,y) x.*exp(-x.^2-y.^2)+(x.^2+y.^2)/20; ezsurfc(f,[-2,2]) fun = @(x) f(x(1),x(2)); x0 = [-.5; 0]; %options = optim...
8c842f3016819bbd19e0554164fda025c209a83728f7842dde7713b2ae1edd76
MATLAB
7,601
221
function preprocessing_olsa_decoding(subject,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 06.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Performs subject-level preprocessing of OLSA task data for...
a881f993af9ee9a734bd7f0b2bcab77e9b021a80481d3ea415fdeb5b03620dd8
MATLAB
7,602
137
%% Checking number of pyr neurons match with excel sheet. % 101 RGS, 57 VEH. % RGS cd('/home/adrian/Documents/GitHub/RGS14/spiking_activity') load('SD_Data_RGS_Pyr_clean.mat') NPD=[]; for i=1:length(SD_Data_RGS_Pyr) % Rats for ii=1: length(SD_Data_RGS_Pyr(i).RatxData)% Study days x=SD_Dat...
f3fc4e5ef68fbfe36e2ccddad12ad7bbc76930c66cc32cf62c8f52b499125ac6
MATLAB
7,605
210
function preprocessing_audio(settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Prepares audio stimuli for a neural cross-correlation analysis by % conv...
863428b431a1f72c0deed7a5ea38f91ebe4cbce783ecec875425bde64121bfe2
MATLAB
7,637
184
function LEiDA_stats_FracOccup(data_dir,cond,pair,n_permutations,n_bootstraps) % % For each clustering solution compute the fractional occupancy of each PL % state for all subjects. Perform hypothesis tests to check for differences % in the probability of occurrence of PL states between conditions. % % INPUT: % data_di...
57736bc36d113d6799f29ea4c57f090be1ba75ad91b6e499a93d4ca2b5911276
MATLAB
7,662
174
function [ ] = LF_3D_plot_LBPD( S ) % Plotting in 3D space leadfield over the MEG sensors given a brain source % and orientation. % This function should work for each individual subject. If you do not have % any subject information, just for visualization and demonstration purposes, % a previously computed subject da...
a200f6dbd8d9f3ca403d8a2f4f4156cd613185dc59ef82f385e27f2e7c6e48a6
MATLAB
7,672
229
function ROI = roi_extract(S); % Extract ROI data from image volume(s), either 4D (e.g., resting state % timecourses) or 3D (e.g., grey matter signal). Gets data from image files % themselves; does not require SPM.mat. % % ROIfiles = cell array of cell arrays, ie set of files for each ROI mask % Datafiles = cell arr...
bad6ecbeb008afe0e8ed372260d672fa6d9a27c0f461b4af310564f0ec55f8bf
MATLAB
7,688
120
function spm_preprocess_brainageR(t1, template_dir, spm_dir) addpath(spm_dir); % check arguments are specified if nargin < 3 error('T1 raw image must be specified'); end %check SPM release if exist('spm','file') ~= 2, error('Please install SPM12'); end [v,r] = spm('Ver','',1); if ~contains(v,'SPM12'), error('%s: O...
14b1e19a976328c81fa1fa2f5676ff29c87d358fc9b9316a2168d124ff8a931d
MATLAB
7,711
226
function BCCT_Mod_mapcomputemain(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 = Se...
a230b69bb01db03ac48b6a273d93b76574ff0326978e003f77c265c311961260
MATLAB
7,785
198
function [M,Q]=community_louvain(W,gamma,M0,B) %COMMUNITY_LOUVAIN Optimal community structure % % M = community_louvain(W); % [M,Q] = community_louvain(W,gamma); % [M,Q] = community_louvain(W,gamma,M0); % [M,Q] = community_louvain(W,gamma,M0,'potts'); % [M,Q] = community_louvain(W,gamma,M0,'negative_a...
a247a7a8f2cb3f448625d64d86a6652e8c744774b684d83a2d8c28d754cb963f
MATLAB
7,788
120
function [BorderCoords, PolyshapeCloud] = FindBorders(Cloud) % ------------------------------------------------------------------------- % Function that finds the inner and outer borders of a point cloud. The % inner coordinates are only there when 'holes' are present in the data. % The function uses a combination ...
287b088a4eed84d88a2d4a01f6b7355602048c9bb89c9e35c90e5fd64e593c43
MATLAB
7,816
176
function data = chanscale_common(cfg, data) % CHANSCALE_COMMON applies a scaling to specific channel types % % Use as % data = chanscale_common(cfg, data) % where the configuration contains % cfg.parameter % % For specific channel groups you can use % cfg.eegscale = number, scaling to apply to the...
9eb7897bae6ecf470c82538c4bbbe9c6766a50645c905c566c11377e476397e0
MATLAB
7,854
174
function shape_classification_decision_boundary_plot(data) clf(figure()) set(gcf,'name','Shape Classification Decision Boundary Plot','NumberTitle','off','color',[0.1 0.1 0.1],'units','normalized','position',[0.3 0.1 0.4 0.7],'menubar','none','toolbar','figure') uicontrol('style','text','units','normalized','posit...
48da5148d5658ed6e7d4cf47dbf6fb85d88e1916efd9a58fe4a913ebf5436bcd
MATLAB
7,894
284
function [W0, E0, P0, Delt0] = mleme_constraint_model(samp, W, M, Lo, Li, Lm, opts) %MLEME_CONSTRAINT_MODEL Unbiased sampling of networks with soft constraints % % W0 = mleme_constraint_model(samp, W); % W0 = mleme_constraint_model(samp, W, M); % W0 = mleme_constraint_model(samp, W, M, Lo, Li, Lm); % [W0, E...
50e4b329c22887ef60cda7bf2605ffc4852552d1d811e5cf8be549fee1a8399b
MATLAB
7,902
196
function varargout = ghostscript(cmd) %GHOSTSCRIPT Calls a local GhostScript executable with the input command % % Example: % [status result] = ghostscript(cmd) % % Attempts to locate a ghostscript executable, finally asking the user to % specify the directory ghostcript was installed into. The resulting path...
0e92436c88914e8fc7896d27a73652cfb09ab3c28f7df5260bf87074b585c470
MATLAB
7,912
197
function [N,E] = rentian_scaling_2d(A,XY,n,tol) % RENTIAN_SCALING_2D Rentian scaling for networks embedded in two dimensions. % % [N,E] = rentian_scaling_2d(A,XY,n,tol) % % Physical Rentian scaling (or more simply Rentian scaling) is a property % of systems that are cost-efficiently embedded into physical space. It ...
4bf43780dbdee22db254b2deb70612d703cc72608d90cc15e0b0db452cc7e174
MATLAB
7,952
186
clear;close all;clc %% Simulation Parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Module Parameters mpool=1000; %total number of motors shared by modules cpool=750; %total number of clutches shared by modules totact=10^5; %t...
b7bc201dfd131cdceb75d57fab747b4ede7d6746e9ee67adb21ca0f918461f39
MATLAB
7,960
227
%-------------------------------------------------------------------------- % Till Habersetzer, 24.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % This script is for the visualization and quality control of computed % dipole fitting results for a single subject. It loads the o...
e12d11b6e7bca42c3320e3080683ebf50bb1a8183e1796efbc804a2b79e32b88
MATLAB
7,969
209
function data_load = load_XML() [files,path] = uigetfile('*.xml','select the files with SMT Tracks from TrackMate','MultiSelect','on'); if path~=0 input_values = inputdlg({'space units (micron, pixels):','pixel size (um):','time units (second, frames):','frame interval:'},'',1,{'micron','0.16','second','0.015'})...
f74be765965e21bc0632263b7e5c7b59523edc01d1a4c89f739a122d840f8444
MATLAB
7,983
338
%% Granger Analysis clc clear addpath('/Users/pelinozsezer/Documents/Science/Radboud/RGS-Project/code/ripples/fieldtrip'); load('GC_ripple_4clusters_median_wa.mat'); %% Merge data per treatment GC_veh=[GC_cluster1_veh_median_wa; GC_cluster2_veh_median_wa;... GC_cluster3_veh_median_wa; GC_cluster4_veh_median_wa]; ...
bc56a0f9516e2e3257e332d8f6231564f52625d0f98ad86b08b72b7b106017dd
MATLAB
8,008
200
function data = load_microscopy_file() %%%%%% file type can be either "bin", "locb" or "csv". %%%%%% example: data = load_microscopy_file('bin'); %%%%%% example: data = load_microscopy_file('locb'); %%%%%% example: data = load_microscopy_file('csv'); [file_names,path] = uigetfile({'*.bin;*.locb;*.csv'},'Select Fil...
b9909cc82bb49c7f453097d34858b3f4e8bd3d949c0e5e66dd665406d4376c1a
MATLAB
8,035
192
%-------------------------------------------------------------------------- % Till Habersetzer, 24.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % This script performs dipole model fitting on averaged MEG data for a % batch of subjects to estimate the location and time course ...
df9ae9533f614e6ba1c513a71a0d6a0c8bb3562fc498cc5f1219f650a80c0517
MATLAB
8,059
202
classdef EdgeLevelMatrix < nla.inputField.InputField properties name disp_name dimensions matrix = false matrix_ordered = false end properties (Access = protected) label = false select_file_button = false end methods function ...
51a47fef10297a77df485e0bc4b7a68ba65bc77d8f87b07c9db733dab45914c7
MATLAB
8,085
255
% Decode extra NIFTI header information into hdr.extra % % Usage: hdr = extra_nii_hdr(hdr) % % hdr can be obtained from load_nii_hdr % % NIFTI data format can be found on: http://nifti.nimh.nih.gov % % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) % function hdr = extra_nii_hdr(hdr) switch hdr.dime.da...
228197ed9d2703426cee65c289b1feb531e996710577f7ab4b12bec4aa76a1c9
MATLAB
8,086
199
function [ ROI_final_mat ] = diff_conditions_matr_degree_MCS_LBPD_D( a, b, ROI_lab, X, permut, thresh ) % It calculates the difference between the significant degree over time of brain % areas (with the whole brain) in two conditions. Then, it calculates Monte % Carlo simulations to assess which differences are signif...
aa47784c942ee2c92062c7b522c8115ae59fab8df98fd0cb10c24d18bd05405a
MATLAB
8,097
197
%% plot_fig4_simulate_signal_conditions % % Simulates multi-trial LFP-like signals under five senarios that the % stimulus SD varies compared to the baseline (Fixation-like period) SD. % Computes across-trial variability (ATV), within-trial power variability % (ITV), and their cross-subject correlation for each conditi...
2e97bf02a2ed45f71ce23cb8b005c3eda111ad14c7daae9e7b5fe1b903350048
MATLAB
8,112
258
function data_to_send = loc_list_extract_features(data) counter = 0; for i = 1:length(data) data_to = unique(data{i}.area); if length(data_to)>1 counter = counter+1; data_to_send{counter} = data{i}; end end if exist('data_to_send','var') f = waitbar(0,'Please Wait...'); fo...
6bccd02ef8e00e9bce2038a9a71dbf609062e5a3b9f0deb937df6eb5daad1b86
MATLAB
8,119
261
function cmap = tc_turbo_map %% cmap = tc_turbo_map % % by Nikolas Karalis, 21 August 2019 % Adapted from https://gist.github.com/nikolaskaralis/b19a1d192e6972d73ab7a0a1005a0e17 cmap = [[0.18995,0.07176,0.23217]; [0.19483,0.08339,0.26149]; [0.19956,0.09498,0.29024]; [0.20415,0.10652,0.31844]; [0.20860,0...
fe5a7d08adf7933648c94c2b500ff39525cc078037559668993746bf35465384
MATLAB
8,140
180
%% Analyze Fig 3 neuron/response counts across the full pipeline % Requires Plotter2Results and allRasterData % Outputs a summary of counts at each processing stage if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end fprintf('=== Loading data ===\n'); load(FIG3_DATA); load(FIG3_RASTER); %% ===...
4c4c5d724535ec4e0beece6ef4c468e186450880242e51c2dad93590e8955a4c
MATLAB
8,171
264
function OCDdraw_m16_plot26() %% ========================================= % M16: beta distribution plot (70 x 26 mm) % Current version: % 1) Remove titles: subject-level / group-level % 2) Change color to OCD blue % 3) Use white circle settings fully matching M12: % - rng(1) % - jitWidth = 0.32 % ...
c5352b7395a10b29befe8567bcda91d8ef24b5fab684c62d4629e958fcce20c8
MATLAB
8,190
261
% function lineStyles = linspecer(N) % This function creates an Nx3 array of N [R B G] colors % These can be used to plot lots of lines with distinguishable and nice % looking colors. % % lineStyles = linspecer(N); makes N colors for you to use: lineStyles(ii,:) % % colormap(linspecer); set your colormap to have eas...
0c0de26a3a70a8d167edbe15580530232578680b48d4e82e3ce626ead26eaeca
MATLAB
8,232
250
function results = run_opnmf_stability_analysis(cfg) % RUN_OPNMF_STABILITY_ANALYSIS % Evaluate model order and parcel-level clustering stability for orthogonal % projective non-negative matrix factorization (opNMF). % % This script was prepared for public code sharing. It uses generic input and % output paths and does ...
ae528a45ef7dad1c0602bff3a1b7851b8b455ab1a0520ecbc6d8ee0ca3392bea
MATLAB
8,282
266
function BCCT clc;clear all;close all; [pat,nam,ext] = fileparts(which('BCCT.m')); % addpath([pat,filesep,'extendFunc']); % some immature ideas will add into this fold. addpath([pat,filesep,'supportFunc']); % add nifti IO and reslice data. % addpath([pat,filesep,'SomeTemplates']); TempExistPath = [pat,filesep,'So...
54d1121e9bed73bcc9b247af74f11f635c9b7e3ccebba39b1b6e315e9cc9e276
MATLAB
8,293
200
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function hdr = load_nii_hdr(fileprefix, machine) fn = sprintf('%s.hdr',fileprefix); fid = fopen(fn,'r',machine); if fid < 0, msg = sprintf('Cannot open file %s.',fn); error(msg); else fseek(fid,0,'bof')...
0f138e796435b00ee1fd01483fb09001a2934f4b1ef150a5a715adc379b2a7a6
MATLAB
8,295
278
function BCCT_WTA_SetupCal D.fig = figure('Name','SetUp&Cal: Brain Covariance Connectivity Cor2SubCor&Winner Take All',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.20 0.15 0.5 0.5]); movegui(D.fi...
9d86cf43a525489c6980a90090c2224198d19221f9c5797ad27f48bde1025cb9
MATLAB
8,352
244
% Hacky function for thresholding connectivity matrices across groups % Rik.Henson@mrc-cbu.cam.ac.uk Nov 2018 function connectivity_stats(S); try CM = S.CM; catch error('Need to pass a Nsubject x Nroi x Nroi connectivity matrix in S.CM') end try X = S.X; catch error('Need to pass a design matrix i...
6b73ad52d31f7125246fcc5c77cddca7ebef17d3fb9cffa7c706322328058e23
MATLAB
8,356
173
function jds_rankOrderCorrChainREMExcludeIEI(animalprefixlist,day,cellcountthresh) %JDS_RANKORDERCORRCHAINREMEXCLUDEIEI Rank-order correlations within ripple chains. % jds_rankOrderCorrChainREMExcludeIEI(animalprefixlist,day,cellcountthresh) % computes, for each REM gamma chain and NREM ripple chain (treated as one...
8263b9c2d898f1a65c21307aaa778ba45abdb40be47a8558da7b44746db5c54e
MATLAB
8,362
181
function [ ] = FC_Brain_Schemaball_plotting_LBPD_D( S ) % Given a connectivity matrix and the corresponding parcellation, it uses % oslspinningbrain and schemaball for plotting connectivity within the % brain (both video and specific frames) and as schemaball. % INPUT: -S.MATF: connectivity matrix ROIs x ...
2f17356a33609c06a327acf1e4abd6268bcd1a02b639a708f7ceefb10397e437
MATLAB
8,372
198
classdef TriMatrix < handle & matlab.mixin.Copyable %TRIMATRIX Lower triangle matrix % Elements of a TriMatrix can be anything from doubles % to multidimensional arrays of strings. However, there % may only be one type of element overall per TriMatrix % TriMatrix inherits from handle because...
bf5426197b2106844e1169b72b6572ab04a6394abdcfef9e88d39c0e5ac7c141
MATLAB
8,396
167
function perm_id = rotate_parcellation_fixed(coord_l,coord_r,nrot) % Function to generate a permutation map from a set of cortical regions of interest to itself, % while (approximately) preserving contiguity and hemispheric symmetry. % The function is based on a rotation of the FreeSurfer projection of coordinates % ...
17cd45e8b3d864e462a4441b7e8bb35052ed74a78a6951ae0f447871c66e17c6
MATLAB
8,408
196
function LEiDA_stats_TransitionMatrix(data_dir,save_dir,selectedK,n_permutations,n_bootstraps) % % For the selected K compute the transition probability matrix for each % participant. Perform hypothesis tests to check for differences in the % state-to-state transition probabilities between conditions. % % INPUT: % data...
026909d12c2ccb3c088ff101bf17f16121a6f6b6b67d8770f61b5bef1f0d40f5
MATLAB
8,411
208
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % RFR_Trento_Pipeline % % This script performs the RFR analysis on a set of subjects' data. % % Runing this file will: % 1. Define pre-processing parameters % 2. Select the subject(s) to analyse % For each subject: % 3. Prepare data structure a...
e4708bed0adf0d6f4283d9751431bf07f5e318d517432c9eb4669cbfdabf59de
MATLAB
8,418
281
%% read [data,id,~]=xlsread('L:\Elite\Celine\heatmap_data.xlsx'); prot =xlsread('L:\Elite\Aida\MM20.xlsx'); protcl = tblread('L:\Elite\Aida\RawFiles\CellLines RawFiles\combined\txt\proteinGroups.txt','\t') protmm = tblread('L:\Elite\Aida\RawFiles\Samples\combined\txt\proteinGroups.txt','\t') prot =xlsread('L:\Elit...
01d4c99c51838b2fba6ed66c9fcd0514448e1af790d34fba69f6d6f0be1099b0
MATLAB
8,449
181
function [W0,R] = null_model_und_sign(W,bin_swaps,wei_freq) %NULL_MODEL_UND_SIGN Random graphs with preserved weight, degree and % strength distributions % % W0 = null_model_und_sign(W); % W0 = null_model_und_sign(W,bin_swaps); % W0 = null_model_und_sign(W,bin_swaps,wei_freq); % ...
2482a8c1c8af954b4d264672e860603c447820838450a4e5545cdd2988ecff2d
MATLAB
8,486
198
function [netGraph,meanDeg,varDeg,numHighConnNodes,propHighConnNodes,conMat] = ... activGraph(GlobalEventsTime,GloEvMat,cellMap,varList,T_HC,orientation,scale) % This function builds the activation graph for one recording session % ----------------------------------------------------------------------- % % *** Inpu...
0a84f1150dd60919ff2341d2505462819f826ddbed2f815536b71d0f11f18cd4
MATLAB
8,504
236
function jds_rippleTriggeredAssemblyStrengthREM(animalprefixlist,area,state) %JDS_RIPPLETRIGGEREDASSEMBLYSTRENGTHREM Ripple-triggered assembly reactivation, REM vs NREM. % jds_rippleTriggeredAssemblyStrengthREM(animalprefixlist,area,state) % aligns z-scored assembly reactivation strength to the first ripple of % ...
5900615f25044ebfe427a0f12776677db860f6722d0f8f26900d322c8ee68ffb
MATLAB
8,523
217
% Function for performing 2D Voronoi Tesellation and calculating the zero % and first rank area for each [x,y] input point. % J.Otterstrom MATLAB 2016a % % INPUTS % x (required) - either a vector of 'x' positions or a matrix of '[x,y]' % positions % y (optional) - a vector of 'y' positions; include...
94f3adb188cb45db15fa3521dc810e3173d3eb95b2a5955b150c10350d751ca3
MATLAB
8,523
222
function [stats] = bootstrap_within_permutation_ttest2(data,design,niter,nboot,pthr,htest) % % PERMUTATION TESTS WITH WITHIN BOOTSTRAP SAMPLES % % INPUT: % data a matrix where each column is a subject and each row is a % data-point for example a voxel intensity in fMRI, a node level % value in a n...
b1bfc1eb5bd9a7aaf0c865510aad425b109dd13882f8953fdf206fe041284354
MATLAB
8,524
157
classdef ResultRankTestCase < matlab.unittest.TestCase properties root_path network_atlas edge_test_options network_test_options edge_test_result network_test_result permutation_results tests rank_results ResultRank rank ...
f6661914c14884db9329ffd356d1933cf63ecff688c07ca1d2bf22bedec3ba63
MATLAB
8,524
144
%% Export full trial-averaged dF/F traces (pre+mid+post) for recruited ROIs % For each tracked ROI x stim channel (4-6 uA pooled), per session: % - trial-averaged, span-5 smoothed dF/F over PRE + MID + POST, aligned so % t=0 is stim onset (pre = negative time) % - per-ROI threshold thr = 2*CV (CV = regionSTD/re...
aa5c32c9c659becfb17bc99c991eb77eb4e2b7babd68484283d6fbded061d1a9
MATLAB
8,525
226
function varargout = process_nst_glm_contrast( varargin ) % process_nst_glm_contrast % Compute a contrast and its variance from a GLM result % % % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm %...
d4f63a786852dc3835b9b20673621f7bcb97156e82b5d6a61fdd47e9213de513
MATLAB
8,550
208
function anovaResults = computeAnovaOnCond(obj, neus2consider, conds2consider, refWindow, anaWindow, binWidth, varargin) % COMPUTEANOVAONCOND - Compute ANOVA comparing baseline and analysis windows % % INPUTS: % obj - RecordedData object % neus2consider - Neuron ind...
235a0a698a24c4f6bf07d3fe57bda14baef9c1d6f268035e3714b535bf9ac69c
MATLAB
8,560
276
function HCdraw_m12_plot26() %% ========================================= % M12: beta distribution plot (70 x 26 mm) % M12-specific version adapted from M16 script: % 1) Input file changed to M12_f2_drawshc.csv % 2) Output file changed to M12_beta_distribution_70x26mm_Compact.tif % 3) X-axis label changed to \b...
ea1f3d1747407634845f157c606b9fd0ac34f7730fcb3afe3b9dc8395b05f71a
MATLAB
8,575
172
function vox_coor = get_AAL3_vox_coor() vox_coor = [ 25.5348837209302 60.5192853091322 61.8201928530913 65.5504288671991 59.2250813368826 62.4049097900030 34.9160164271047 81.9776180698152 54.6186858316222 56.2756535310183 80.5963714397191 55.6718689036286 27.2365209673841 80.4364322165520 51.9689372087863 64....
5ef0b253cc4f1a5bd46566c97853cfde0269de8e56a5ff9860009e2864bafc95
MATLAB
8,581
247
function varargout = panel_nst_rename_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 % This sof...
7e8ccb5274e0670c3beb7094c36b182de739a88847c358a67376570cf5d15296
MATLAB
8,583
195
function BCCT_VIEW_surfsimp Hvs.fig = figure('Name','Simple Version for the Surface results viewer',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.3 0.3 0.4 0.4]); movegui(Hvs.fig,'center'); Hvs.BUT1 = ...
3cc9b3465279e85328671f9b0ce3191ec317c674426d40f53e9530332190e528
MATLAB
8,587
261
function HCdraw_m19_plot26() %% ========================================= % M19: beta distribution plot (70 x 26 mm) % This revision: % 1) Move the left x-label (β_{ISPS-lPFC}) slightly downward % 2) Move the right y-label ("median estimate") downward by 1 mm % and slightly to the right % 3) Keep the right...
863d5d240fb22d8103f67b20a418bddccef387755a701efe18ab66f8eb2cc49c
MATLAB
8,592
223
function varargout = panel_nst_search_space(varargin) % @============================================================================= % This function is part of the Brainstorm software: % https://neuroimage.usc.edu/brainstorm % % Copyright (c)2000-2020 University of Southern California & McGill University % This sof...
98eb935b95770eb46dd1150280cf23231e37ca14900e0d004410e2c1cd263ff3
MATLAB
8,594
262
function HCdraw_m16_plot26() %% ========================================= % M16: beta distribution plot (70 x 26 mm) % This revision: % 1) Move the left x-label (β_{ISPS-motor}) slightly downward % 2) Move the right y-label ("median estimate") downward by 1 mm % and slightly to the right % 3) Keep the righ...
16025f2ef445eb106380ee409e59538e081c44f7e00035e01fdc5140867883f0
MATLAB
8,618
204
function voronoi_area_percentiles_inside(data) input = inputdlg({'Number of Percentiles'},'',1,{'2'}); if isempty(input)~=1 no_of_percentile_ranges = str2double(input{1}); for i=1:no_of_percentile_ranges prompt{i} = ['cell ',num2str(i),' percentile range']; default_input{i} = '10 90'; ...
c48b987db69bd5b353078bdc46fb492aab01cf2c98741a4c9c2dd7c0daf98765
MATLAB
8,641
209
function obj = makeCSMS(filenameSpikes, filenameEvents, eventType, stateSeqs, matchOpt, otherMarkers) % MAKECSMS - Create RecordedData from spike times and behavioral events % % SYNTAX: % recordedData = makeCSMS(filenameSpikes, filenameEvents, ... % eventType, stateSeqs, matchOpt, otherMarkers) % % INPUT...
6009887e931dcc9ffeefbf7378110824fa68560f179c8fe8f081179579f52fa9
MATLAB
8,648
231
function varargout = process_nst_channel_cluter_auto( varargin ) % process_channel_cluter_auto: Automatically create channel cluster based % on the distance to anatomical atlas. % @============================================================================= % This function is part of the Brainstorm software: % https...
5eb65d2fb8e04710138c9b61b921149d656d12bce5fbc47ad2fd5c22a507df0d
MATLAB
8,654
209
function [N,E] = rentian_scaling_3d(A,XYZ,n,tol) % RENTIAN_SCALING_3D Rentian scaling for networks embedded in three dimensions. % % [N,E] = rentian_scaling_3d(A,XYZ,n,tol) % % Physical Rentian scaling (or more simply Rentian scaling) is a property % of systems that are cost-efficiently embedded into physical space. I...
e60bb75b120deb48c8837e8534f60b4da93cec24aaedc495b2122ada5adee21a
MATLAB
8,661
213
function LEiDA_stats_DwellTime(data_dir,cond,pair,tr,n_permutations,n_bootstraps) % % For each clustering solution compute the dwell time of each PL state % for all subjects. Perform hypothesis tests to check for differences % in the dwell time of PL states between conditions. % % INPUT: % data_dir directory whe...
f5075ec3108ef161c7d6b9dc305bb764afd832c560c5d362148f2c148230e275
MATLAB
8,710
246
%jds_compareNREMCA1SuppressionREMCofiringShifters %Same suppression-vs-REM-cofiring analysis as %jds_compareNREMCA1SuppressionREMCofiring, run separately for CA1 cells %classified as REM theta-phase shifters vs nonshifters. Plots suppression %by cofiring quartile for each group and tests whether the two %correlation co...
5cd8716c1e0fa1a895b35b32190388143aec53ef47ac56233bdfd0d8c9365a67
MATLAB
8,721
207
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function save_nii_hdr(hdr, fid) if ~isequal(hdr.hk.sizeof_hdr,348), error('hdr.hk.sizeof_hdr must be 348.'); end write_header(hdr, fid); return; % save_nii_hdr %------------------------------------------------...
0b427af1a1240404b23202a2f201f6045a9d8ce55ece0c47a47b7104273b89d9
MATLAB
8,739
217
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function hdr = load_nii_hdr(fileprefix, machine, filetype) if filetype == 2 fn = sprintf('%s.nii',fileprefix); if ~exist(fn) msg = sprintf('Cannot find file "%s.nii".', fileprefix); error(msg); end ...
cd91a87f1b10871627d431128d2bb158aebfe3bbf31d1d2d9e1f0ea09aa908ef
MATLAB
8,740
200
%% clear for BL_type = [1, 2] logRatioAvg = zeros(52,1,13,151,2,3); counter = 0; for subSel = [1:52] counter = counter +1; % current working directory needs to be /path/to/scripts mainpath= pwd; thisSubject=['S' num2str(subSel)]; workingDir=[mainpath filesep '..'...
e4fb47833118e349ea71cdaa039bdb47fdd5bc2b456f9dc487a8f6ed066d27f3
MATLAB
8,778
174
function [] = phasesynchrony_LBPD_D(S) % Calculates the instantaneous phase synchrony between each couple of brain % areas by extracting the instantaneous phase of each brain area with Hilbert % transform and then calculating the cosine similarity of the % instantaneous phases of different brain areas. % Calculates al...
cabe89ef1fff45320c4d7e773eed80020c56f571f952064f3cc357dd15aec667
MATLAB
8,797
211
% 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...
47481bb8aba8f669e5dc3a0d6eadd42f42d6bf26e6bad659b07133ee096f7151
MATLAB
8,813
219
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function save_nii_hdr(hdr, fid) if ~isequal(hdr.hk.sizeof_hdr,348), error('hdr.hk.sizeof_hdr must be 348.'); end write_header(hdr, fid); return; % save_nii_hdr %------------------------------------------------...
1896d246e0b6efee8a106f2bf52948c0730d6604d3c52d29a6058f5fcab14af2
MATLAB
8,818
173
%% % 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 'scriptTemplates']) addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis']) tvm_installOpenFmriAnal...
fe305d3c2e2dec7419e766401eb1361b2c6eddf5f902fddf35dc0980bdb051e6
MATLAB
8,825
174
function [meanFreq,realEvts,diffToBaseAll,varList] = ... segWithBaseCorr(signalMat,dt,dtev,minDepth,maxEvThresh,Tev,cfDown,smoothParam,evNumVec,GlobalEventsTime) % This function segments the input signals in signalMat and extract the % segmented events and inter-events features detailed in *Outputs*. % ------------...
37af2adbe2a075540c22a83dff600359833ce977e607ae8150f1011b21f391aa
MATLAB
8,897
201
function varargout = process_nst_mbll_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 softwa...
d8836da13cae14b008d4db4c865cafff572690671bba06fe5fb6faa74be5bb21
MATLAB
8,905
172
classdef TestPoolTest < matlab.unittest.TestCase properties edge_test_options network_test_options tests root_path end properties (Constant) permutations = 20 end methods (TestClassSetup) function loadTestData(testCase) import nla.TriMat...
0239fe05f3c995a8e2616fee66c8c38d84ffdc7add31212d0759dad705f13e7a
MATLAB
8,946
186
%% % 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...
89102686d55925122ee7a31789344241b850ce4f02933135ddb6ebcb6d9f31c8
MATLAB
8,946
207
function spt_compute_mean_msd(data) f = waitbar(0,'calculating mean msd'); for i=1:length(data) mean_msd{1} = calculate_mean_msd(data{i}.msd); data_to_send{i}.msd = mean_msd; data_to_send{i}.name = [data{i}.name,'_mean_msd']; data_to_send{i}.tracks{1} = data{i}.tracks{1}; data_to_send{i}.type...
0b50cf1eb170da51d940b8f82c21927f2ce5ed8e79400fc007ff381c5e41c98a
MATLAB
8,965
205
%jds_chainIsolatedRipplesAmpFreqDurREM %With analyzeData = 0: detects cortical REM ripples across riptet tetrodes, %measures amplitude and frequency of each event, and saves %<animal>ctxripple_REM_amp_freq_<day>.mat. %With analyzeData = 1: loads that file, splits events into chain vs %isolated (non-chain) REM ripples, ...
c328183418bde50ec0fcbb923cc8146e930dc86a47dcf6d00aecb9ed82bc1602
MATLAB
8,969
212
% ------------------------------------------------------------------------- % Script: make_figureS1.m % % Description: % This script generates Figure S1 for the manuscript, comparing the % readiness potential (RP) in two datasets: original (Park et al., 2020) % and newly collected data. The comparison is done for the 5...
60a569db6fce8b92accf77a4b675ebfa1c7a381759b7e4b97f9f90c5779cc894
MATLAB
8,990
429
function hb_extinctions = nst_get_hb_extinctions(wavelengths) %% Return HB extinction coeffecients in water, at the given wavelenths %% Unit is cm^-1.l.mol^-1 % % Args: % - wavelengths: array of double, size: nb_wavelength % Wavelengths for which to return Hb extinction coefficients % % Output: matrix of doub...
fdf751605cf172549a92382435faf5980afe1307b64b8cfc2976aef6d3b9945f
MATLAB
8,991
234
function [local_fns, downloaded_files] = nst_request_files(relative_fns, confirm_download, remote_repository, default_file_size, local_repository, download_title) % Request local files: if they are not available in the given local repository % then attempt to download them from given remote repository. % The given file...
56e70a88b7070f80a97e11de9ff00391a8b69f7db13b29fb54cef0aa3599131a
MATLAB
9,003
165
%% if ~(exist('mainpath','var')) clearvars % current working firectory needs to be /path/to/scripts mainpath = pwd; else clearvars -except mainpath end addpath([mainpath filesep 'fmriRegAnalysis']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'toolboxes' file...
a22bdc0115b2c5c27b1480e4dfe84f1a3013dd7ed85b4f6f699ca6d904de4432
MATLAB
9,025
188
function [W0, R] = null_model_dir_sign(W,bin_swaps,wei_freq) %NULL_MODEL_DIR_SIGN Directed random graphs with preserved weight, % degree and strength distributions % % W0 = null_model_dir_sign(W); % W0 = null_model_dir_sign(W,bin_swaps); % W0 = null_model_dir_sign(W,bin_swaps,wei_...
838212e438dadf9ba984bd50472885a61486eabc33a7957770c9e852078cabdf
MATLAB
9,027
187
%% RECORDEDDATA CLASS % RecordedData - Load, process, and analyze neural recording data % % This class provides tools for loading neural recording data (spike times, behavioral markers, % kinematic data) and performing comprehensive analysis including binning, visualization, % decoding, and dimensionality reduction via...
c540f019588d46279afa9f82e224487a00409b06eb59695a709385b7d1c87e80
MATLAB
9,076
237
function forge_activity_test_data(dest_dir) % Generate test data for activity detection processes. % The generated file is a bst subject that is intended to be uploaded % on the nirstorm data repository. Then this data is retrieved by % nst_request_data({{'unittest', 'activity_test_subject', 'activity_test_subject.zip'...
c432e947c7aacfc9d7995240c7aea8cf2beb179ff2dab9fb620ece1418b0f78f
MATLAB
9,100
260
function [clusterInfo] = doPermTest2(data,alpha,neighbours,EEG) %DOPERMTEST Do permuation testing % Do a t-test at each point. Look for contiguous sig. % values according to the given alpha value. Sum the t-values to get the % cluster mass. Do this for the actual data, then for permuted data. % Permute data by ...
ae491924b5ca76a2c922f198f2eb43b66f42a3860546a3255bb80ee05e436d57
MATLAB
9,121
223
function AS_MatrixFCshow_bat(indir,outdir,enhanind) if nargin<3 enhanind = []; end % indir = uigetdir(pwd,'MatrixFC dir'); load(fullfile(indir,'R_Pres.mat')); [mpat,mnam,mext] = fileparts(which('AS_MatrixFCshow.m')); load(fullfile(mpat,'gray.mat')) % outdir = uigetdir(pwd,'Outdir'); R(1:size(R,1)+1:end) ...
080e7e24306c8ce96ff515bc0b470c6c9f7d951a3b951d44fa28ce67601a475e
MATLAB
9,135
206
function jds_thetaCoherenceREM(animalprefixlist,Hz) %JDS_THETACOHERENCEREM CA1-PFC coherence around REM cortical ripples. % jds_thetaCoherenceREM(animalprefixlist,Hz) computes ripple-triggered % CA1-PFC cohereograms (all riptet/ctxriptet pairs, z-scored to the % epoch), along with a circular-shift shuffle, sa...
57b053983defea0497cfa6d4ba6fe4206d78e7cfeb5af9697c1b1c2f9a9b6a2a
MATLAB
9,163
224
function AS_MatrixFCshow(enhanind) if nargin<1 enhanind = []; end indir = uigetdir(pwd,'MatrixFC dir'); load(fullfile(indir,'R_Pres.mat')); [mpat,mnam,mext] = fileparts(which('AS_MatrixFCshow.m')); load(fullfile(mpat,'gray.mat')) outdir = uigetdir(pwd,'Outdir'); R(1:size(R,1)+1:end) = 0; Z(1:size(Z,1)+1...
f0d8d582a0efb60c11b8919c89726d0451506b3ff555bfe7bdfba5a01e9b196a
MATLAB
9,165
243
function h = schemaball(r, lbls, ccolor, ncolor) % SCHEMABALL Plots correlation matrix as a schemaball % % SCHEMABALL(R) R is a square numeric matrix with values in [-1,1]. % % NOTE: only the off-diagonal lower triangular section of R is % considered, i.e. tril(r,-1). % ...
1247ece23384a098e93d270ea173db37c7b6331bc7a730604eba81ef61cf01e0
MATLAB
9,217
223
function AS_MatrixFCshow_bat2(indir,outdir,enhanind) if nargin<3 enhanind = []; end % indir = uigetdir(pwd,'MatrixFC dir'); load(fullfile(indir,'R_Pres.mat')); [mpat,mnam,mext] = fileparts(which('AS_MatrixFCshow.m')); load(fullfile(mpat,'gray.mat')) % outdir = uigetdir(pwd,'Outdir'); R(1:size(R,1)+1:end)...
4c17ec13a7b8cad9761244fa7540292d9538f098b08d11dd2bc23e3221309733
MATLAB
9,225
244
function jds_phaseSlopeIndexCA1PFC(animalprefixlist) %JDS_PHASESLOPEINDEXCA1PFC Theta-band phase slope index between CA1 and PFC. % jds_phaseSlopeIndexCA1PFC(animalprefixlist) computes the FieldTrip % phase slope index between every CA1 riptet / PFC ctxriptet pair in % 2-s windows around REM ripple-chain midpoint...
3271f477e1dc02c7bd794823362be004cee869e618e3acbdf555935d4495e59a
MATLAB
9,232
228
function [FCpre,FCcorr,beta,pred_data,R] = predict_fc(SC,FC,ED,pred_var,model) % PREDICT_FC Prediction of functional connectivity from structural connectivity % % [FCpre,FCcorr,beta,pred_data,R] = predict_fc(SC,FC,ED,pred_var,model) % [FCpre,FCcorr,beta] = predict_fc(SC,FC,[],{'SPLwei_log','SIwei_log'},'quadrati...
403527d4d30e2973c65cd42b8d2c42b63ba8b63f31c28772a110c8c27e5c3e14
MATLAB
9,235
352
function [e,sots,stim,X,df] = fMRI_GLM_efficiency(S); % Matlab function to calculate efficiency for fMRI GLMs. % rik.henson@mrc-cbu.cam.ac.uk, 2005 % % See for example: % % Henson, R.N. (2006). Efficient experimental design for fMRI. In K. Friston, J. Ashburner, S. Kiebel, T. Nichols, and W....
2def5d51680579ed92b23a65121afa2e412525460d60fc7c242b7ef4a6e214d4
MATLAB
9,245
303
function [map,meann,alll,onedev,vari,SE] = mapsbaby(startopt,framerate,t,maskedimage,imagestack,avbeat,outs,cmin,cmax,tfilt,before,apdblopt,apdblnum,medianfilter) % function for taking a single beat image file and making apd/cad maps % Chris O'Shea and Ting Yue Yu, University of Birmingham % Maintained by Chris O...
47ef4ece427e102d26709737af013204ad6907af17d2784b079d9ed3590bdbd2
MATLAB
9,267
245
function BCCT_CON_computemain(Parameter) pathfiles = which('BCCT.m'); RealCompPara.mod = 'volmap'; [path nam ext] = fileparts(pathfiles); Outputdir = Parameter.Outputdir; RealCompPara.Outputdir = Outputdir; Inputdir = Parameter.Inputdir; RealCompPara.Inputdir = Inputdir; SeedROItype = Parameter.SeedROItype; Re...
8ecd0387a55c1a744de67bd3fec027c84e19bc0d55bcc74481b0ac557134e29b
MATLAB
9,270
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 if hdr.h...
925689a1ee0825f629638c2099243ac71803f5209348dfeb2ec4c04220e45f9e
MATLAB
9,283
228
function BCCT_CON_Surf_compute_freesurfer(Parameter) mfilenam = which('BCCT.m'); [pat nam ext] = fileparts(mfilenam); RealCompPara.mod = 'surfmap'; Outputdir = Parameter.Outdir; RealCompPara.Outputdir = Outputdir; Indir = Parameter.Indir; RealCompPara.Indir = Indir; marker = Parameter.markerdir; RealCompPara.m...
9fa802860fd57169db5d5d2894c7a35ab535df4a60cb4f5443e06751e36f6e68
MATLAB
9,286
266
%__________________________________________________________________________ % violin.m - Simple violin plot using matlab default kernel density estimation % Last update: 10/2015 %__________________________________________________________________________ % This function creates violin plots based on kernel density e...
10a8ded92627ed6033b9d6c8e387e57a4452b955ef1c8baf2b73fb66630a3e5c
MATLAB
9,354
311
function gifwrite(varargin) % GIFWRITE(INARRAY, {DISPOSALMETHOD}, FILEPATH, {DELAY}, {WRITEMETHOD}) % GIFWRITE(INARRAY, MAP, {TRANSPARENTIDX}, {DISPOSALMETHOD}, FILEPATH, {DELAY}, {WRITEMETHOD}) % Write image stack to an animated gif % % INARRAY: 4-D image array % RGB/I or RGBA/IA arrays may b...