sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
d67631de95ad4390eee49eb001a65040ff63ab1b8b8704559f4a43e16f1705a1
MATLAB
4,556
165
function BCCT_Modulate_statGUI D.fig = figure('Name','BCCT stastic(two groups Modulations)',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.3 0.4 0.4 0.3]); movegui(D.fig,'center'); %% D.O...
ede9f63f18963c5f307bf1c8b5857901c9966a07ab0cd88a0155ad6ce687cd31
MATLAB
4,561
139
function [index,val,foi,logRatio]=sortVirtualChannel(tmpDataTFR,freqInt,timeWinMax,BLwin,sorting) %% indsBL=tmpDataTFR.time>=BLwin(1) & tmpDataTFR.time <= BLwin(2); if ndims(tmpDataTFR.powspctrm)==3 logRatio=log10(tmpDataTFR.powspctrm./repmat(nanmean(tmpDataTFR.powspctrm(:,:,indsBL),3),[1,1,size(tmpDataTFR.powspct...
2437ef1b45728f0fdb5eb83122d0c51a6803a0684e6447cfcf55902238a03e0d
MATLAB
4,578
114
function varargout = process_nst_bootstrap_MEM( varargin ) % process_nst_bootstrap_MNE: Compute source-localization using Bootstrap % and MEM % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % ...
aebdc630ba2535c1255ea72e84d7501c8d7e4358bd3772cb98093793461e8e9c
MATLAB
4,579
105
function dFC_project = get_lesion_info_v2(dFC_project) old_path = pwd; cd(fileparts(which('AAL3v1.nii'))) AAL3 = load_nii('AAL3v1.nii'); AAL3_origin = AAL3.hdr.hist.originator(1:3); AAL3_img = double(AAL3.img); AAL3_img(isnan(AAL3_img)) = 0; cd('C:\Users\isaac\OneDrive\Documents\Grad School\Kiran Lab\DIssert...
49ab3046283597f7b4d32913c30ff74b9662cad4b0742ea03b12b3cf139f7ca1
MATLAB
4,586
160
function grayplot_HFmotion(QCinit,stage,subject,mvm_filt) % function grayplot_MIND(QC,whattomask,stage,subject) % % This function will make grayplots to look at timeseries after different % stages of procesing. Additionally allows for bad timepoints to be masked % out from visualization. % This will allow one to inspec...
636193f830a0995284efb9ee4b7ed5c60fe75fce7cf0e442770375aaacb59478
MATLAB
4,591
108
function sResults_hb = nst_mbll_source(sResults, wavelentghts) %NST_MBLL_SOURCE Apply the MBLL on the data after source reconstruction assert(length(sResults) == length(wavelentghts), 'Provide the wavelength associated with each map') assert(length(sResults) > 1, 'Unable to compute the MNLL with only one wave...
de49b58059a4c56b26c3de41d3b07b38f65b37f49e7c6284a30d969e7a1cd08d
MATLAB
4,597
113
%% Get path to NLA root_path = nla.findRootPath(); %% Create a pool of tests tests = nla.TestPool(); tests.net_tests = nla.genTests('net.test'); % Example: Changing the edge-level test % tests.edge_test = nla.edge.test.Spearman(); % tests.edge_test = nla.edge.test.SpearmanEstimator(); % tests.edge_test = nla.edge.te...
f85db9cd9b22044fda872eefe885e8a09feaa1d2d5868bf3ee8f30c2691d683c
MATLAB
4,598
83
clc;close all;clear % Change this if needed PixelSize = 0.117; % 117 nm per pixel PlotFigures = 1; % Decide whether or not you want to plot the images % Do not change from this point on Continue = 1; % Ignore this % Do the analysis until you're tired of it while(Continue) [file,path] = uigetfile...
a7c693f4e896ba6d479e2ce11bdf3f685abe5f91a56078f9a6f6a68bace4a318
MATLAB
4,604
121
function varargout = process_nst_deglitch( 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...
576ab31a5615c58efbeca2f5323914fb55a2398d57c650ea46003873285d92c1
MATLAB
4,626
136
function [Rlatt,Rrp,ind_rp,eff] = latmio_und_connected(R,ITER,D) %LATMIO_UND_CONNECTED Lattice with preserved degree distribution % % [Rlatt,Rrp,ind_rp,eff] = latmio_und_connected(R,ITER,D); % % This function "latticizes" an undirected network, while preserving the % degree distribution. The function does no...
c65c65394aa7dc45344374d34c819b1d3db4febf4ff08d5f4508cf4afa2c87ab
MATLAB
4,634
127
function Binned_y = Model_3State( parameter_guess, JumpProb, data_to_fit) %MODEL_3STATE Summary of this function goes here % Detailed explanation goes here LocError = data_to_fit.LocError; dT = data_to_fit.dT; HistVecJumps = data_to_fit.HistVecJumps; dZ = data_to_fit.dZ; HistVecJumpsCDF = data_to_fit.HistVecJumpsCDF;...
1afbd597b758b9a1589f9d3a30f9d2919eb4c5b4dfce305a26971437465e9b49
MATLAB
4,640
113
function [accur] = Decode_main_code(subid, timeid,iShufid) iShuf=1;%1 real data, 2 premutation data is.ENL1=0.001; kfold_k=10; rng('shuffle') is.random_fixation = 154; nstim=8; is.whichTimes=1:10:750; addpath('./Decode_Data') dirRoot = './Decode_Data'; DirCon = dir(ful...
e46c1ed51ad8a32c80e43820c9bd2ed884b72c196911d56bca655d5cfa96f2d9
MATLAB
4,651
122
function [data_clustered,data_not_clustered,area_threshold] = construct_clusters(data,area_threshold,min_number_of_localizations,type,waitbar_counter) f = waitbar(0,['Please Wait...',num2str(waitbar_counter(1)),'/',num2str(waitbar_counter(2))]); voronoi_areas = data.vor.voronoi_areas; neighbors = data.vor.neighbors;...
631705c3c7c432bdb03f47ba24befb412f5ad179d64a4f46f4bee8a1123fef3a
MATLAB
4,654
159
% Code to solve the spatio=temporal IRES. Basically a block coordinate % projected gradient descent algorithm where the edges and the solution % itself will be updated sequentially. % Xiyuan Jiang % 11/17/2022 function [x, y,res_obj,J_intermediate,J_intermediate_count] = FISTA_ADMM_IRES_Tensor(alpha, W_v, V, L_v,x_0, ...
c5ef0b572e8bfaf01d2709fe32cbfa1ab0291348e6175131f3c506d887e0efc7
MATLAB
4,662
109
function [filtered_events] = read_events_modified(path_dataset, stim_channel, min_duration_samples) %-------------------------------------------------------------------------- % Till Habersetzer, 06.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % READ_EVENTS_MODIFIED Extracts ...
dc1c855e7d45e69b0fc13ae96a36dc45a6051c29d76dc9e22739d97853231c64
MATLAB
4,667
80
classdef HyperGeometricTest < handle %HYPERGEOMETRICTEST Hypergeometric (One-sided Fisher's Exact Test) to test significance properties (Constant) name = "hypergeometric" display_name = "Hypergeometric" statistics = ["two_sample_p_value", "greater_than_expected"] ranking_statisti...
8d16cdfaf1d14a62fb812e3923d7203f8c25011e49226ce17aaeb9d00f243f24
MATLAB
4,682
189
% Generate X Y Z coordinates of a 3D Bresenham's line between % two given points. % % A very useful application of this algorithm can be found in the % implementation of Fischer's Bresenham interpolation method in my % another program that can rotate three dimensional image volume % with an affine matrix: ...
9175500dd4adafb355e8be5f529daf4201f826ec07f0b9c28afd27ca7bcbac31
MATLAB
4,684
127
function Binned_y = Model_3State_fitLocError( parameter_guess, JumpProb, data_to_fit) %Model_3State_fitLocError Summary of this function goes here % Detailed explanation goes here dT = data_to_fit.dT; HistVecJumps = data_to_fit.HistVecJumps; dZ = data_to_fit.dZ; HistVecJumpsCDF = data_to_fit.HistVecJumpsCDF; ModelFi...
99bb2fd06d3c06d033da1c8b836dc17ae21c5e379805b6e048dc4ae3b441ba72
MATLAB
4,694
124
%APPEND_PDFS Appends/concatenates multiple PDF files % % Example: % append_pdfs(output, input1, input2, ...) % append_pdfs(output, input_list{:}) % append_pdfs test.pdf temp1.pdf temp2.pdf % % This function appends multiple PDF files to an existing PDF file, or % concatenates them into a PDF file if the o...
1beaed03c3a682e4e314833502e162ff4f763d2196753b51531dbcf6a134187f
MATLAB
4,704
188
clear fnl(1,:) = {"D:\DATA_LOCAL\MIPCART pilot\Histology\Mouse 105\2023-04-13 13.21.07.ndpi_ID5_HE_42_B4_2.jpg" "D:\DATA_LOCAL\MIPCART pilot\Histology\Mouse 105\2023-04-13 11.25.44.ndpi_ID5_Ki67_42_B3_1.jpg" "D:\DATA_LOCAL\MIPCART pilot\Histology\Mouse 105\2023-04-13 10.31.07.ndpi_ID5_psma_44_B2_2.jpg"}; fnl...
258543c0c190159d5c65e63aa4df7bfa4fbf6d97dbec17703636e15d074dcb7b
MATLAB
4,705
81
classdef ChiSquaredTest < handle %CHISQUARED Chi-squared test to determine how far a result is from expectation properties (Constant) name = "chi_squared" display_name = "Chi-Squared" statistics = ["chi2_statistic", "greater_than_expected"] ranking_statistic = "chi2_statistic" ...
aa2b151c3aa21e96641273492c903cd060a4d0beb2813946dd59b8734acc7363
MATLAB
4,705
124
function [V1_all,Time_sessions,Data_info] = LEiDA_data(data_dir,save_dir,n_areas,tmax,filter,flp,fhi,tr) % % For each subject compute the leading eigenvetor of the phase coherence % matrix calculated at each recording frame. % % INPUT: % data_dir directory where the parcellated fMRI data are saved; % ...
052caea075f01b861e0048099b4287de640ea702a1c43e03abdd32843635cce1
MATLAB
4,707
118
function [spindles,phase_total,z,BST,V_pfc,v_pfc,Sx,Ex,Mx] = spindles_detection(vec_bin,NC3,NC2,fn,j,i,k) if sum(vec_bin)~=0 %%All states v2 = ConsecutiveOnes(vec_bin); v_index = find(v2~=0); v_values = v2(v2~=0); for epoch_count = 1:length(v_index) v_timestamps{epoch_count,1} = reshape(NC3(:, v_index(ep...
bab315f1b2421a97e41500417f5f34a4ab7045aefb00b4053786e65a3ceaa259
MATLAB
4,711
164
%%% DISCLAIMER %%% % This file is a modified version of `tt_cp_fg.m` from Tensor Toolbox: % Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, Version 3.1, % www.tensortoolbox.org, June 2019. https://gitlab.com/tensors/tensor_toolbox. % It is therefore subject to the following license: % BSD 2-Clau...
5e5ea8de393e376fab1ab2d00e9822894fd7ff6a7927b6a7eb35f7ccdd3caee3
MATLAB
4,712
142
function obj = fit(obj,connectivity_matrix,varargin) % Computes the kernel, embedding, and alignment according the % properties of the calling object. A data matrix or cell array of data % matrices is obligatory as input. Valid name-value pairs of optional % arguments are as follows: % % - Kernel arguments % - ...
b31f028f66557e08660744f49fbb2e140453b9d807336364814843b7e3ab68a9
MATLAB
4,713
207
function [preimages,images,averages,mask] = OMimprocess(fname,im,rect,num_images,cropchoice,mask,sfilt,sfiltsize,inversion,tfilt,removef,camopt,sfiltsigma,pbefore,pafter,n,tstack) %funtion for reading in and processimg all images in the tif stack/ rhs [rows,cols] = size(im); [~,~,remain] = fileparts(fname); fileisr...
b7ff416805774b95ca3b7eb454958760ed0637421a5710641966cfc0a4cba3a4
MATLAB
4,724
174
function status = compute_epoch_psd_metrics(rootPath, subjectIDs, opts) % compute_epoch_psd_metrics % % Compute epoch-level power spectral density (PSD) metrics from % *_BipolarEEG_QC_Post.mat files. % % INPUT % rootPath : root data directory % subjectIDs : cell array of subject IDs % % OPTIONAL (opts...
62518310135c8fd5933f3647736cdb341f70fb112740af5c5ef9d623460fbad0
MATLAB
4,729
174
%% download and install orbitrap to mzxml convertor wget http://unfinnigan.googlecode.com/files/Finnigan-0.0206.tar.gz tar xvzf Finnigan-0.0206.tar.gz cd Finnigan-0.0206/ cpan install Data::Hexdumper install CPAN reload cpan install Data::Hexdumper install Digest::SHA1 install YAML install Getopt::Declar...
780e816048d54b920e5508410952f05751e3e23177d6e80d0364ac2caaabe9c5
MATLAB
4,732
129
function varargout = process_nst_detrend( 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 softwar...
ba02f0e808c768c9e630adef8e2a999923235938927c09f5d5d1910fdfd2b01f
MATLAB
4,735
141
function MEM = compute_mem(W,varargin) % COMPUTE_MEM computes the Moran eigenvectors. % % MEM = COMPUTE_MEM(W,varargin) computes the Moran eigenvectors for a % weight matrix or a surface. If a surface is provided, then the weights % are computed as inverse geodesic distance. % % Name-Value pairs: % 'n...
1988e61bb8ad83bfd05a64c304a7b30b8b37ae245c8356c8bd5a4e51eab42598
MATLAB
4,742
128
function varargout = process_nst_extract_ssc( 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...
0d9315476e5a382e45b6bf8b368aaba8e12b26d76b8bb71592e88c00542f4379
MATLAB
4,745
126
% The main goal of this script is to study the phase locking behaviour of % neurons in both treatments. % % It uses input data containining NREM sleep spikes and % corresponding phases for each neuron in the entire study day. % % Using the neuron IDs, the script loads the sleep scoring file for each % neuron (and St...
f93b4f01ae4c149a0fe86c7afb8430fab881cdc584fba58b59b21adcaa136de7
MATLAB
4,745
131
function varargout=findND(X,varargin) %Find non-zero elements in ND-arrays. Replicates all behavior from find. % The syntax is equivalent to the built-in find, but extended to % multi-dimensional input. % % [...] = findND(X,K) returns at most the first K indices. K must be a % positive scalar of any type. % % ...
3fa4c09953d66ed0866ba950be6a54564ac072ece97731a25c05c142307875e2
MATLAB
4,759
131
function jds_extractHighThetaPhasicREM(animalprefixlist) %JDS_EXTRACTHIGHTHETAPHASICREM Extract high-theta (phasic) REM bouts. % jds_extractHighThetaPhasicREM(animalprefixlist) averages the % theta-filtered LFP envelope across all ctxriptet tetrodes, keeps % periods more than 4 SD above the mean REM theta envelop...
3a682b6421b4f2647ad0598d125083c416c5eb0977a22756919449e8db9c1e06
MATLAB
4,761
115
function [OUT ] = Epoch_singletone_fl_F3 ( C,x,y,z,d,task,por) % Epoching, concatenating trials, reshaping, averaing and removing source leakage correction % of the memory encoding task data. % This function was made for didactic reasons and it is not to be % considered a general function that is very likely to be ap...
b27cc6b5ad52a150d0336dd233c02fe6ca78c3d18c7ee1a90cd7caf8dff82078
MATLAB
4,791
129
% Analyze behavioural data for the song familiarity task % Also determine labels for each note (famuliar, unfamiliar, or % recognized) % Author: Cameron Hassall, Department of Psychology, MacEwan University % email address: hassallc@macewan.ca % Website: http://www.cameronhassall.com close all; clear all; clc...
2660602492754201d1805211b37e98cdf5ae7840f7ff1ed749066de6e8abf715
MATLAB
4,806
152
function fitted_model = nst_glm_fit(model, y,method) %NST_GLM_MODEL_FIT Summary of this function goes here % Detailed explanation goes here if nargin < 4 method='OLS_precoloring'; end switch method case 'OLS_precoloring' [B, covB, dfe, residuals, mse_residuals] = OLS_prec...
79f1e7ba27c392c3e60582acb3176432d8a16d98cb5f28a6c1c1dd079b2bd485
MATLAB
4,808
110
function Res = BCCT_Perm_CaSCNMap_Cal(RealCompPara,maskedSignal,ROIsignals1) % ROIsignals1: 1*N Calmethod1 = RealCompPara.Calmethod1; COVcond = RealCompPara.COVcond; if COVcond(1) RealCompPara.COVs = zscore(RealCompPara.COVs); % else % RealCompPara.COVs = ones(size(ROIsignals1)); end ROIsignals1 = zsco...
736623a3441a5f50638fefd0072128d1b1625ecc7da9cfea392fda92b2039aa7
MATLAB
4,810
181
clear switch 2 case 1 % Treated onam = 'Mouse_002'; path = mipp_getDataPaths(2); s_nrm = 3000; slice = 11; yl = [0.04 1.05]; case 2 % Untreated onam = 'Mouse_115'; path = mipp_getDataPaths(115); s_nrm = 5000; slice = 12; yl = [0.1...
12d9d3dc763147a1435517b2ae0b5faf885853f589858f26e50d13e3a3928230
MATLAB
4,822
128
function anatomy_based_full_group_pipeline_V1() % Example for the template- and surface-based full pipeline, using the % function NST_PPL_SURFACE_TEMPLATE_V1. % % This script downloads some sample data of 10 "dummy" subjects (27 Mb) % Total max amount of data to download: (TODO) Mb, the user is asked for download...
bb5c8ad11609d1c426f92ae81d3659b96197b62b25c71c1a98a8f23269eee9f9
MATLAB
4,824
128
function Plot_C_boxplot_DT(data_dir,save_dir,selectedK,centroid,parcellation) % % Plot the boxplot of dwell time (DT) values by condition for the selected % PL state. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % selectedK K de...
88fb9c0f1e8b8ece31b670728908516a7138112ae28d5c3a76743fb9cf6a2e50
MATLAB
4,832
137
%% ISPC calculation - batch for HC + OCD (all subjects found in folders) clear; clc; close all; dbstop if error; % Add FieldTrip path addpath('D:\MATLAB\toolbox\fieldtrip-20211209\fieldtrip-20211209'); ft_defaults; % ===================== Parameter settings ===================== parTF.minFreq = 1; parTF.maxFreq = 50;...
5e0e44ad9fa316e165f0d668330f5d627264959c00b4fbcda811d7226e63bcaa
MATLAB
4,838
121
function checkHeadMotion(fig, input_struct, motion, remove_index) network_atlas = input_struct.net_atlas; functional_connectivity = input_struct.func_conn; if remove_index ~= 0 [new_netatlas, functional_connectivity] = nla.removeNetworks(input_struct.net_atlas, input_struct.net_atlas.nets(remov...
c12c52b872ad841303bf1d851a63361d7088c9302ba39dd0d31480333b9a6de8
MATLAB
4,838
122
function [nPerms pInds Perms] = uperms(X, k) %uperms: unique permutations of an input vector or rows of an input matrix % Usage: nPerms = uperms(X) % [nPerms pInds] = uperms(X, k) % [nPerms pInds Perms] = uperms(X, k) % % Determines number of unique permutations (nPerms) for vect...
0658ac8b032cf640f563739934dbcfc225fd78e507f4555de578373bfdb39cbf
MATLAB
4,848
135
function [Mreordered,Mindices,cost] = align_matrices(M1,M2,dfun,flag) %ALIGN_MATRICES Alignment of two matrices % % [Mreordered,Mindices,cost] = align_matrices(M1,M2,dfun,flag) % % This function aligns two matrices relative to one another by reordering % the nodes in M2. The function uses a version of si...
226afe1273d6799a36f9e1ef1fddfc5184740f69dd2de420c6716f10bf9726e4
MATLAB
4,849
138
classdef EVTImportTest < matlab.unittest.TestCase properties tmp_dir end % This script aimed to test two functionality : % % methods(TestMethodSetup) function setup(testCase) tmpd = tempname; mkdir(tmpd); testCase.tmp_dir = tmpd...
9c5aff8910bb619e71ad6d23c17ffcfa8c85a1636ab284ed51be04e42d145161
MATLAB
4,851
130
function fh = isolate_axes(ah, vis) %ISOLATE_AXES Isolate the specified axes in a figure on their own % % Examples: % fh = isolate_axes(ah) % fh = isolate_axes(ah, vis) % % This function will create a new figure containing the axes/uipanels % specified, and also their associated legends and colorbars. The o...
945d0fe7b69b8986feb7589ed9bd42b23140f6298fb494560b637978cb466f52
MATLAB
4,856
108
function [adj, names, name_hash, contig, overlap, deltafiles_ref, Startnode_name, Endnode_name] = get_reference_nodes( ... adj, names, name_hash, contig, overlap, target_chromosome, contig_ref, ... overlap_ref, name_hash_ref, deltafiles_ref, ... max_chromosome_dist, distance, clipping_thrs, ref_first, ......
878fe731207a8e1fd290003d16bb742d4d6210bf4ddcbd8b57be2dddcd998304
MATLAB
4,860
126
function Plot_C_boxplot_FO(data_dir,save_dir,selectedK,centroid,parcellation) % % Plot the boxplot of fractional occupancy (FO) values by condition for % the selected PL state. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % selected...
e73c2fa6db39106de6315e7ee50e3fc93b6e52c791ddf783b841ba06973b26ca
MATLAB
4,865
133
function newmap = darkb2r(cmin_input,cmax_input) %BLUEWHITERED dark Blue, white, and dark red color map. % this matlab file is designed to draw anomaly figures. the color of % the colorbar is from dark blue to white and then to dark red, corresponding to % the anomaly values from negative to zero to positi...
0e9b5de927c9be138acd23fb5188115619b4435cfe57bd42c46e29fbd31a6ab7
MATLAB
4,887
98
classdef MultiLevelPermutationTest < matlab.unittest.TestCase properties test_options end methods (TestMethodSetup) function loadTestData(testCase) testCase.test_options = struct(); testCase.test_options.func_conn.v = [1:10].*ones(10,1); end end met...
28b0ce8a44bc2541f9bec1c388a382682c1a14ad98149f8469afad20afb27eb5
MATLAB
4,894
170
function postproc(func_data_path,seg_data_path,stim,filter,regression,out_dir) % Read data func_data = double(niftiread(func_data_path)); seg_data = niftiread(seg_data_path); % Check size match if ~isequal(size(func_data,1:3), size(seg_data)) error('Mask size and functional size differ, check data'); end % Calc...
9bf6fca0bf96e02b268dc42e246a88352a6de2d862e1b695b901543829d3b0e4
MATLAB
4,903
129
%% plot_fig7 % % Plots time-frequency representations (TFR) of spectral Mean, SD, and CV % for neural LFP data, plus time-course plots per canonical frequency band. % % Requires: % - Fig7.mat containing: V1, M1, frq, Tt, Tl, frband, bandTitle, fs % - shadedErrorBar.m (Mathworks File Exchange) % % Outputs: % - Fig...
51c2ef5519ca7cda1356a6a9220211f1f49ef3266f4aa1f3590ff217b7871ccd
MATLAB
4,917
160
function p = patchline(xs,ys,varargin) % Plot lines as patches (efficiently) % % SYNTAX: % patchline(xs,ys) % patchline(xs,ys,zs,...) % patchline(xs,ys,zs,'PropertyName',propertyvalue,...) % p = patchline(...) % % PROPERTIES: % Accepts all parameter-values accepted by PATCH. % % DESCRI...
3112d488162af930ab6c0b737c5324bbe2d37fdd4a264f556cb47131ab51b7bd
MATLAB
4,920
111
function SpinPermuFS(readleft,readright,permno,wsname) % Compute designated # of permutations/spins of the input surface data % in FreeSurfer fsaverage5. % FORMAT SpinPermuFS(readleft,readright,permno) % readleft - the filename of left surface data to spin % readright - the filename of right surface data to spi...
b083e6d16457ca7f21b40d13fc29c7bc357369795f6fda5aa8b0e06967445184
MATLAB
4,921
154
function motion_HFcharacteristics(subinfo,TR,mot_data) % motion_HFcharacteristics % This script gets FD summary measures from a group of subjects and relates % them to subject demographic caracteristics. Edit the specific % characteristics depending on what is available in each dataset % % subinfo = structure, with eac...
f3b4ce7496859c435b68f00c028b2d636c34ac74345b2a47bd8298bb23a56fac
MATLAB
4,928
148
% This script generates ripple data for ripple response type and visualizes firing activity centered around ripples. % Note: Variables Counts_Norm_RGS_Temp and Counts_Norm_Veh_Temp were used % to create response type plots on GraphPad. % Functions used: Ripple_Analysis_All.m, Ripple_Colorplot.m %% Loading Input Data...
13628769c17714497644a8b5f7bb838a77c0afba0d133809bf53330b4889c933
MATLAB
4,930
135
function tc_show_contour_on_slice(configuration) % Hack to allow plotting of sections % % Copyright (C) Tim van Mourik, 2015, DCCN % %% Parse configuration volume = tvm_getOption(configuration, 'i_Volume'); %no default section_sel = tvm_getOption(configuration, 'i_Section'); %no default slic...
5f2aa2555295066d9a56fc028dc297e0d9cdd17c4116b9de2acfac72c6ce1567
MATLAB
4,936
213
function [num_images,rect,mask,im,I,boundaries,camopt,frame1,fluoim,rois] = OMimreload(fname,cropchoice,quinnieopt,threshop,threshman,rect,inversion,camopt,fluo_opt,roinum,roisum,frame1,num_images) % Function for taking raw image file and applying thersholding without having to reread whole image stack, final % outpu...
b0b6c4a1140c1b1bb255a9e3bcd2aa8817d5fb087d35885e23c4f8830a3017b7
MATLAB
4,956
144
function varargout = process_nst_mask_from_atlas( 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 ...
ab3ddbd43b8492fa1ff824f6d0709ded3e01840c0bf4f41e85d6d24435cf875b
MATLAB
4,964
133
function data_filtered = remove_outliers(data) clusters = extract_clusters(data); names = data.name; areas = cellfun(@(x) x(1,3),clusters); no_of_locs = cellfun(@(x) size(x,1),clusters); ratio = log10(no_of_locs./areas); ratio = ratio + abs(min(ratio))+0.1; [counts,centers] = hist(ratio,100); figure(1595)...
ccd88c3e65166e2bf1785e0b6aa88af9bc77e28a384acfa176ec2134297ad474
MATLAB
4,993
119
function jds_remRippleCA1CoactivitySpatialCorr(animalprefixlist) %JDS_REMRIPPLECA1COACTIVITYSPATIALCORR Spatial correlation vs REM ripple cofiring. % jds_remRippleCA1CoactivitySpatialCorr(animalprefixlist) computes, for % CA1 cell pairs tracked from the preceding run epoch, the correlation % between their place-f...
2cec3dbf7d41cded2acf7ebb731a71e8040bf09f971654e06d26652d9bd0742d
MATLAB
5,008
145
function results = c_eeg_plot_power(mainpath, subjects) %% EEG_regs_conv = e_eeg_power_regressors(mainpath, subject, delete_files) %mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; results = []; for subject = subjects fprintf('computing results for subject %d\n', subje...
a58bb3ebd74c5b3214a7adb778b8df4596fd6ee20ba0c00a12180881455e6266
MATLAB
5,021
130
clear switch 2 case 1 % Treated onam = 'Mouse_002'; fn_rare = '\\uw.lu.se\research\LU22A1004-msf_fsz\Common\DATA\MIPCART pilot\Pilot MRI/MouseExternalRT_PilotJune2022\221021\20221021_091729_220210_JS_221006_mouse_2_time3_1_28\NII\010_1_Bruker_RARE_MAGNITUDE.nii.gz'; fn_qti = '\\uw.lu.se\r...
1df47a70708df80339e8d6142fa7253845296e0c9fc8c7fbbe1598f477eb542b
MATLAB
5,026
111
function beta_results = g_average_betas(parameters, delete_files) %% beta_results = g_average_betas(mainpath, subject, delete_files) % mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; tc_struct2ws('caller', parameters.main); %% parameters tc_struct2ws('caller', parameters.p...
08952b3da87094e49994ae7b4aeb474c9485cf2c03e7789f599245f2549bf065
MATLAB
5,027
128
function varargout = process_nst_search_space( 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...
66162372b0f732e7be47fcdd14d37fa90a0f5fa8b88a0092f9a1d38f651d1d4f
MATLAB
5,033
118
function surface_template_full_group_pipeline_V1_all_opts() % Example for the template- and surface-based full pipeline, using the % function NST_PPL_SURFACE_TEMPLATE_V1. % % This script downloads some sample data of 10 "dummy" subjects (27 Mb), % as well as the Colin27_4NIRS template (19 Mb) if not available. %...
7395cc5ed8762c69f8926a4230c9539bb330fd9634dfb98f30586b32cdeeddd3
MATLAB
5,033
123
classdef SciTest < 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(TestMe...
48537d30afa3844dfeffc8791a1d8cb3ead8217bb5a347250ce53fad5fb18531
MATLAB
5,046
124
function [old, young, index_old, index_young] = young_or_old_evals(freq_path, index_old, index_young, thresh) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Load the explained variance for each frequency and divide them between % young and old. If you want to discard subjects that gave ...
b76a8ae354523b4b5b7baaf9a0880fdb7b11126a0345581af33e22eb4ba807ac
MATLAB
5,052
85
function spt_tracks_displacement_model_plot(data) figure() set(gcf,'name','Tracks Displacement Model Plot','NumberTitle','off','color','w','units','normalized','position',[0.4 0.3 0.4 0.6],'menubar','none','toolbar','none') if length(data)>1 slider_step_one=[1/(length(data)-1),1]; slider_one = uicontrol(...
f4d28b1f633bad972f93939c52fd4270ee92ddcfe077ea58f9ec41d57518e392
MATLAB
5,064
135
function preprocessing_olsa(settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Prepares individual OLSA sentence stimuli for a neural decoding analysis % ...
7be83bf73ebd1c2c28e3ed7110251410e41de2f7f1dc0ca5d89eb86133679eac
MATLAB
5,099
109
%% if ~(exist('mainpath','var') && exist('setup_sel','var')) clearvars % current working directory needs to be /path/to/scripts mainpath = pwd; setup_sel = sprintf('%s/../subjectData/all/eeg-fMRI/setups/b_5_d_contrast_t_000_025.mat', mainpath); else clearvars -except mainpath setup_sel end cd addpat...
e9d981f4eb907de765a1747740de5ab7a29bff6d569d4eed695892f87ebc22c7
MATLAB
5,101
83
function [GWpos,GWneg] = gateway_coef_sign(W,Ci,centtype) % Gateway coefficient % % [Gpos,Gneg] = gateway_coef_sign(W,Ci,centtype); % % Gateway coefficient is a variant of participation coefficient. Similar % to participation coefficient, gateway coefficient measures the % diversity of intermodular connectio...
9551d5f5eae3d8237b375479a48390d5e86995400fccb3a578d176b3c77f7e68
MATLAB
5,102
153
%%%% EXTERNAL FUNCTION % function taken from the BioSig package % complete software may be downloaded from http://biosig.sourceforge.net/ function [CC,NN] = covm(X,Y,Mode); % COVM generates covariance matrix % X and Y can contain missing values encoded with NaN. % NaN's are skipped, NaN do not result in a NaN output....
d453b7e62f10080ea5c8ff0174bf223ed402e79f9f9ff7db4b7edcaaca302ec3
MATLAB
5,123
95
function [swr_hpc,swr_pfc,s_hpc,s_pfc,V_hpc,V_pfc,signal2_hpc,signal2_pfc,sd_swr, M_multiplets, Mx_multiplets, multiplets, ripples, Mono_hpc, Mono_pfc,total_swrs,total_NREM_min,v_index, v_values,v_timestamps, S_r, M_r, E_r] = ripple_detection(HPC,Cortex,states,ss,offset1,offset2,TT,j,i) if leng...
92d0caeca3a733985688528c7f6bac13d12a44ff0c5320c3dda2d5a336c4d82d
MATLAB
5,126
151
%% if ~(exist('mainpath','var') && exist('relcrit','var') && exist('confsel','var')) clearvars % current working directory needs to be /path/to/scripts mainpath = pwd; relcrit = 5; confsel = 1:3; else clearvars -except mainpath relcrit confsel end addpath([mainpath filesep 'fmriRegAnalysis']) a...
dd78d26fac3907113a54ec3ab86fd7b3922a312c93566722465ea636cac16ee3
MATLAB
5,133
157
function [A, vA, vB, bb_rel] = crop_borders(A, bcol, padding, crop_amounts) %CROP_BORDERS Crop the borders of an image or stack of images % % [B, vA, vB, bb_rel] = crop_borders(A, bcol, [padding]) % %IN: % A - HxWxCxN stack of images. % bcol - Cx1 background colour vector. % padding - scalar indicating ...
1a7558df7378ec051a7710392a80f6cec59ed7779e06bacae4a02f490fdd6278
MATLAB
5,153
115
function [ O ] = MEG_SR_Stats_twogroups_LBPD( S ) O = []; % It computes statistics after beamforming (computed using MEG_SR_Beam_LBPD.m). % It tests the difference between two experimental groups (using ttest2). % INPUT: -S.workingdir: path where the data from MEG_SR_Beam_LBPD.m is stored % -S...
9044953c0814d9938d7f2b208cc25460499f3174913d7085aa07c945c18a56a4
MATLAB
5,153
107
%% Export recruitment-figure data so the Python plotter can render in matching style. % Inputs: figures/.../final/recruited_traces.mat (already exists) % Outputs (same dir): recruitment_data.mat, recruitment_traces.csv, recruitment_counts.csv clear; clc; WIN_FRAMES = 5; % 3 = first ~101 ms (strict pre-movement); 5 =...
a4d3c80ac2fdc8826ed9940a46408c3c7fef9ecce0e1f03850269a48c4141147
MATLAB
5,168
92
clear p = fix.subplot('tight'); p.nr = 2; p.nc = 4; p.lo = 0.04; p.wo = -0.0; c = 1; clf for j = 1:2 switch j % case 1 % Mouse 12 control % % fnl = fix_findFiles('\\uw.lu.se\research\LU22A1004-msf_fsz\Common\DATA\MIPCART pilot\Pilot MRI\MouseReference_Pilot_Feb2023\', '*RARE_MAGNITUDE.nii.gz...
5adf393e02f66119ce472d56eaa0847a4571b6c4e71a4db0bcbf209f318fc33b
MATLAB
5,171
148
function CC = bwconncomp(varargin) %BWCONNCOMP Find connected components in binary image. % CC = BWCONNCOMP(BW) returns the connected components CC found in BW. % BW is a binary image that can have any dimension. CC is a structure % with four fields: % % Connectivity Connectivity of the connected compone...
8ddf4df5f085d4e5e50c1aa6852dfe71a1201be5cd698b39a8ea45fabbdb8cb5
MATLAB
5,192
138
classdef OptimalMontageTest < 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 met...
bc0cfbfa06ce15a1193cf25543d041fecbab8f4bc8f6bceb4c69f08285858532
MATLAB
5,199
134
function LEiDA_Start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % LEADING EIGENVECTOR DYNAMICS ANALYSIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This function runs LEiDA on any given dataset. % % Since we do not know a...
267afe239d9b27eb545d08b6e3b714f9d5785162cd62a991ed853e456b1efca7
MATLAB
5,201
119
%% %%% LEADFIELD MODEL - WORKSHOP %%% %instructions %1)run the first section to start some functions up %2)run the second section playing around with the three provided settings % -source_label: nunmbers corresponding to different brain sources (voxels) % -orientation: 1 of the 3 orientation of the brain sources...
da86bb7e94579bdc8b6d174753270896655b9acbf52a6225e786d68217d66ab3
MATLAB
5,212
122
clear % Case 1 and 4 in paper switch 4 case 1 % Treated onam = 'Mouse_002'; fn_rare = '\\uw.lu.se\research\LU22A1004-msf_fsz\Common\DATA\MIPCART pilot\Pilot MRI/MouseExternalRT_PilotJune2022\221021\20221021_091729_220210_JS_221006_mouse_2_time3_1_28\NII\010_1_Bruker_RARE_MAGNITUDE.nii.gz'; ...
3f3a1162ec096202fa0c71916d962934d4b58721555f2a74509405e1584373a5
MATLAB
5,217
157
function [ a, cb ] = SurfStatViewData( data, surf, title, background ); %Basic viewer for surface data. % % Usage: [ a, cb ] = SurfStatViewData( data, surf [,title [,background]] ); % % data = 1 x v vector of data, v=#vertices % surf.coord = 3 x v matrix of coordinates. % surf.tri = t x 3 matrix o...
6547ab794f27cc60532fd288b678b94663b93eea9fb28df051b2c626e011142a
MATLAB
5,225
148
function dFC_project = compute_dFC(dFC_project,new_project) if ~isfield(dFC_project,'CONN_preprocessing_dir') dFC_project.CONN_preprocessing_dir = uigetdir(pwd,'Select folder containing output of CONN preprocessing'); end cd(dFC_project.CONN_preprocessing_dir) cd .. if ~isfield(dFC_project,'CONN_results...
1d32773c4b1c1fa2f702d03db67fec4540bfea12fc4360134eae4a93ae62f5d6
MATLAB
5,246
135
function computation_crosscorr(subject,settings) %-------------------------------------------------------------------------- % Till Habersetzer, 05.07.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % Description: % Performs a subject-level temporal cross-correlation analysis bet...
3969a3782409dda7f7c7e577e475b0ece5e858698c7fba53a7bd6308ad4f1956
MATLAB
5,259
184
function BCCT_WTA_statGUI W.fig = figure('Name','WTA_stat_GUI',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.20 0.15 0.5 0.5]); movegui(W.fig,'center'); W.OutputText = uicontrol('parent',W.fig...
29b5b03acea184a48cb608ede9e5a21adf3721c193f47d7f01bd8216dd3f11c7
MATLAB
5,268
139
function loc_list_voronoi_density_map(data) answer = inputdlg({'Color Percentile Value:','Down Sample Size:','Pixel Size (nm per pixel):','Scale Bar Size [x-axis (um)]:','Scale Bar Size [y-axis (um)]:'},'Input',[1 50],{'1 99','100000','116','2','0.5'}); if isempty(answer)~=1 pecentile_vals = str2num(answer{1}); ...
6d77c00219614a243f91e68f2173a8a531c8d3f6c2c3edf0b3e7a0cf56f9f38b
MATLAB
5,277
169
function [p]=wavesim(wsmat,mask,ep,beforeframes); %% Chris O'Shea, 05/09/2018 % Function for producing waveform similarty map from 4D matix of % (row,col,frame,windowed signal) [rows, cols, num, Nsig] = size(wsmat) %Nsig=Nsig-1; %% Normalise signals by standard norm for N=1:Nsig %ignore last AP stno...
0376de5bf64b1fbc5479e37a0990515424459f346edbbe1694c3edfcbf0ed80e
MATLAB
5,283
122
function [Ci,Q]=modularity_und(A,gamma) %MODULARITY_UND Optimal community structure and modularity % % Ci = modularity_und(W); % [Ci Q] = modularity_und(W,gamma); % % The optimal community structure is a subdivision of the network into % nonoverlapping groups of nodes in a way that maximizes the numb...
f2211ce1ba949707ce956f201a707059960e1bfdbd05d6e150f88d648d3083e7
MATLAB
5,289
146
function varargout = process_nst_separations( varargin ) % process_nst_separation: compute distances between sources and detectors % % @============================================================================= % This function is part of the Brainstorm software: % http://neuroimage.usc.edu/brainstorm % % Copyright (...
716d1615256dcd4ff7b421405b63f0194508aa74e3a51badc6f7c126733318be
MATLAB
5,298
101
function betas = f_eeg_betas_feature_signal(parameters, delete_files) %% betas = f_eeg_betas_feature_signal(mainpath, subject, delete_files) % mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; tc_struct2ws('caller', parameters.main); %% parameters tc_struct2ws('caller', para...
e3d1dfe3a7fafcbdf19cf937674d276cddba050826d7bc0c0fe45c6e703792bd
MATLAB
5,316
124
function [Ci,Q]=modularity_dir(A,gamma) %MODULARITY_DIR Optimal community structure and modularity % % Ci = modularity_dir(W); % [Ci Q] = modularity_dir(W); % % The optimal community structure is a subdivision of the network into % nonoverlapping groups of nodes in a way that maximizes the number of ...
0c0754d5470b5fdb1d24ce2fab4175cd671805cb0e8724031c75a7815c12b555
MATLAB
5,331
138
function Plot_K_boxplot_DT(data_dir,save_dir,selectedK,parcellation) % % Plot the boxplot of dwell time (DT) values by condition for each of % the centroids given by the specified K. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % se...
52fdabbc90ba04f84f27a56a2d8270623872db38fdfcc10eaa05c134c2f37516
MATLAB
5,343
111
function [I,Q,F]=motif4funct_wei(W) %MOTIF4FUNCT_WEI Intensity and coherence of functional class-4 motifs % % [I,Q,F] = motif4funct_wei(W); % % *Structural motifs* are patterns of local connectivity in complex % networks. In contrast, *functional motifs* are all possible subsets of % patterns of lo...
a976ca9739a2394c1546eaaf1501ed9f734525e61dfe25dd98f5e4b10f866021
MATLAB
5,347
137
%% Fig 2G - Number of neurons (left) and activation density (right) at threshold if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end load(FIG2_DATA); fontsize = 8; set(groot,'DefaultTextInterpreter','tex', ... 'DefaultAxesTickLabelInterpreter','tex', ... 'DefaultLegendInterp...
c4e563689caccc2e688c0a914dff4ad26168bd74d370bfdcaea3cd55f74ec9e6
MATLAB
5,348
129
function loc_list_plot_random(data) I = randperm(length(data),10); data_to_plot = data(I); figure() set(gcf,'name','Random Plot','NumberTitle','off','color','w','units','normalized','outerposition',[0.2 0.2 0.7 0.7],'menubar','none','toolbar','figure'); subplot = @(m,n,p) subtightplot (m, n, p, [0 0], [0.08 0.08],...
932e2370ea105f7a1fef4be024bef6172053f9696fc795522395d5bd04ace0f5
MATLAB
5,350
137
function Plot_K_boxplot_FO(data_dir,save_dir,selectedK,parcellation) % % Plot the boxplot of fractional occupancy (FO) values by condition for % each of the centroids given by the specified K. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected opti...