sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d64674a60a2f88038830cd26f2fadf71b7896525bb02523100b52b5fe0449589
MATLAB
6,382
172
function frequency = Frequency(timestamps,varargin) %Frequency - Compute instantaneous frequency for a point process (e.g. a spike train). % % Compute instantaneous frequency either by smoothing the point process using a fixed % or adaptive Gaussian kernel, or by simply taking the inverse of the interevent intervals. ...
7a345f4e59aee09948c04447bbfee12a2d7dfb83c4b0746623ef1e06a47fee73
MATLAB
6,383
137
function [MRSCont] = osp_saveJMRUI(MRSCont) %% [MRSCont] = osp_saveJMRUI(MRSCont) % This function writes all MRS data loaded by OspreyLoad to separate % jMRUI-readable .TXT files. % % One .TXT file is produced for unedited MRS data % (PRESS, sLASER, etc.), four .TXT files are produced for MEGA-edited % dat...
1a3ed5551d30478103361406ceb11b5103790fad92f9c948ba529dff155d3350
MATLAB
6,392
165
function M = smc_oopsi_backward(S,V,P) % this function iterates backward one step computing P[H_t | H_{t+1},O_{0:T}] % Input--- % Sim: simulation metadata % S: particle positions and weights % P: parameters % Z: a bunch of stuff initialized for speed % t: current time step % % Output is a single structure ...
1225d105c3ef2238a7b10ac73fb1f8d46fdd81333b89e10f212c0c2dbf32e47b
MATLAB
6,393
185
% Main script for analyzing laminar depth profiles of SANDI intra-soma signal fraction % across von Economo atlas % % Reference: % Lee H, ..., Huang S, Communications Biology, 2026 % % Requirements: % - FreeSurfer installed and configured % - FreeSurfer fsaverage surface and annotation files available % - Economo-Koski...
3db9368b71852eab84b09abd96b28e084d92c6e349a9fe94e205be1fe61936c2
MATLAB
6,393
178
function [niiSOS, niiSENSE, noise_array] = osp_cpx2nii(cpxFile, sinFile, niiSOSFile, niiSENSEFile, launchViewer) %%[niiSOS, niiSENSE] = osp_cpx2nii(cpxFile, sinFile, niiSOSFile, niiSENSEFile, launchViewer) % Reads complex Philips data (*.cpx) and geometry (.sin) files and % converts the image to NIfTI (*.nii) form...
a12528c7958ee5445b9b897ac1898e51901e44f2ff9ecfadbdd206764e092902
MATLAB
6,393
264
function OUT = db_cluster_table(clusters,DB,varargin) % function OUT = db_cluster_table(clusters,DB,varargin) % % tor wager % counts studies and contrasts in each cluster % % clusters is a struct in which XYZmm field has list of points % --should be output of database2clusters, which contains all fields % DB is databas...
1e4a7a26c5c010410981e9d63b3e04ff4feb9c2ebbfdcdc8269c98565ef7c897
MATLAB
6,394
189
function [net, info] = fast_rcnn_train(varargin) %FAST_RCNN_TRAIN Demonstrates training a Fast-RCNN detector % Copyright (C) 2016 Hakan Bilen. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). run(fullfile(fileparts(m...
e8ce2652bba4a4f4ac1105637dbf832619a90bfb97ccc953ecfbcfdab92d197f
MATLAB
6,396
215
function [merged unused] = tapas_uniqc_propval(propvals, defaults, varargin) % Create a structure combining property-value pairs with default values. % % [MERGED UNUSED] = TAPAS_UNIQC_PROPVAL(PROPVALS, DEFAULTS, ...) % % Given a cell array or structure of property-value pairs % (i.e. from VARARGIN or a structure of pa...
4029a63f77adc9d68f8ae3e2dc5f281de6a33a1ffd118385e984ff241b88a25c
MATLAB
6,397
176
% POP_FUSECHANREJ - Make sure the same subject and session have the same % removed. If not remove channel not in common. % Usage: % >> ALLEEG = pop_fusechanrej(ALLEEG); % % see also: pop_clean_rawdata % Copyright (C) 2022 Arnaud Delorme, UCSD % % This file is part of EEGLAB, see http://www.eegl...
24bcd54c91f12d94e8332ef8a1bf2affe94858cbc0d0b90f99caf9a262067f91
MATLAB
6,398
143
% std_topomovie - make movie in the frequency domain % % Usage: % >> [STUDY] = std_movie(STUDY, ALLEEG, key1, val1, key2, val2, ...); % % Inputs: % STUDY - STUDY structure comprising some or all of the EEG datasets in ALLEEG. % ALLEEG - vector of EEG dataset structures for the dataset(s) in the STUD...
6c86573353ba7747ef806426813d8daeb5df706d060a367422c735bab93be3f5
MATLAB
6,399
168
function info = step1RunSearchlight(opt) % Step 1 : running searchlight (SL) % get the smoothing parameter for 4D map funcFWHM = opt.funcFWHM; % set output folder/name savefileMat = fullfile(opt.pathOutput, ... [opt.taskName, ... '_SL_VisDirSel',... ...
c8ce88aab778c3163365c9f440bd2fc4bca0126bda3747be9bbc229bdf8b6f44
MATLAB
6,399
189
function [net, info] = fast_rcnn_train(varargin) %FAST_RCNN_TRAIN Demonstrates training a Fast-RCNN detector % Copyright (C) 2016 Hakan Bilen. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). run(fullfile(fileparts(m...
a38543c7cf1818c069564cb569297b484250e0bf1fbdf18bd39ecf24d75bb84a
MATLAB
6,401
212
%% Add path addpath('H:\Kaizhen\Anxiety_behavior_phenotyping_analysis\Ethological_Behavior\Markov_Chain_Analysis') %% Define file names for 16 mice fileNames = {... 'C1_behavior_states_timestamps.xlsx', ... 'C2_behavior_states_timestamps.xlsx', ... 'C3_behavior_states_timestamps.xlsx', ... 'C4_...
1fdafe68f4b375ab68e17fc9c2a4ecef483501000d937c0858a8b2ed6007f59b
MATLAB
6,402
114
% This function loads a single file and gathers all of the needed % information. fOutID should be the output file handle from % main_diagnostics. singleSetFile should reflect its name. function single_diagnostic(fOutID, singleSetFile) % Storing what's going to be written to the csv in a variable to act as % a b...
8151993c03cc812e353a6d2c9507ee6daf52730a65fb2355d9ab46f19eda4d1f
MATLAB
6,403
154
function [cov_signal_epoched, cov_noise_epoched, artifact_threshold_out,Treshold1] = clean_SENSAI(artifact_threshold_in, refCOV, Eval, Evec, cov_total, signal_type) % This GEDAI function estimates signal and noise covariances analytically %% Creative Commons License % % Copyright: Tomas Ros & Abele Michela % ...
b82d47a4d3f05f5a4864cf5be64e388f8c68d710cf9830cf223e88fcbbad8167
MATLAB
6,403
148
clear; close; %specify ages to include in analysis ages = {'05', '08', '12', '18', '24'}; %specify other info about data tasks = {'hand', 'social'}; cohorts = {'gm', 'uk'}; % create empty table columnNames = {'ID', 'Cohort', 'Task', 'Age', 'Channel', 'Homer_Pruned_Total', 'Average_SCI', 'Average_PSP', 'Percentage_Mo...
a156011d50a9a115f5c0698bbafcded0659d063b77f6cdb66aa0d73673265afc
MATLAB
6,404
170
function varargout = pdftops(cmd) %PDFTOPS Calls a local pdftops executable with the input command % % Example: % [status result] = pdftops(cmd) % % Attempts to locate a pdftops executable, finally asking the user to % specify the directory pdftops was installed into. The resulting path is % stored for future refere...
df2627db1d86fec5db1128f1ef8b19a6fadc06fd20dcf211ecfda69c6b9e4853
MATLAB
6,408
223
function [MI_td,shuffmean,shuffstd,shuffsig,Hs]... = MutualInformation(fname,ops) %calculates mutual information between a stimulus or behavior of %interest, and the firing rate, based on the underlying GLM % %%Inputs: % fname: glm fit file % ops: main structure with following info % masktype: 'test' ...
6d859f274fffad14de29934afd3e16e0f7122c99aecff6c7bc2679328d490e32
MATLAB
6,409
187
function setpos(h,fmt,href) % SETPOS Set graphics object position in a flexible way. % SETPOS(H,FMT) sets the position property of graphics object % with handle H, according to FMT that can be expressed using different % units. H must have a "Position' property. % % FMT is a char array containing 4 strin...
dfde73e2b71166dffa89906f0df8978970f5254903bdd62ffe124bd9252a5d04
MATLAB
6,409
126
function chGroups = getChannelGroups(params, groupSpecification) % returns channel groups (cell array) based on group specification % (c) Jiri, Apr16 chGroups = []; %% load 'H' & selCh name_selCh = ['selCh_H_' params.thisData]; load(params.storage.cacheFile, 'H', name_selCh); selCh_H = eval(name_selCh); selCh_raw = ...
200cbaeaf39ba17d74ba479c58feabbf9749593deadd41367f39288589dbd084
MATLAB
6,413
168
function out = SY_SpreadRandomLocal(y, l, numSegs, randomSeed) % SY_SpreadRandomLocal Bootstrap-based stationarity measure. % % numSegs time-series segments of length l are selected at random from the time % series and in each segment some statistic is calculated: mean, standard % deviation, skewness, kurtosis, PermEn...
a16d7ca9dac33dd8180e8d30d1dba11b79e061711fab79b3aacbac09b6a5ec85
MATLAB
6,414
136
%% TestQSMMatrixPhantom - Tier 2 synthetic-phantom QSM method regression matrix % % Runs the one-stop SEPIA pipeline on a small, deterministically-generated % synthetic phantom (test/phantom/generate_synthetic_phantom.m) once per % QSM dipole-inversion method in methodQSMName (sepia_universal_variables.m) % AND per mat...
44436a2dd029dd5f5e64f9b74f67870e0108aaa9eadd62907858b72d2f3c3b1c
MATLAB
6,418
188
% PLOTPROJ - plot projections of one or more ICA components along with % the original data (returns the data plotted) % % Usage: % >> [projdata] = plotproj(data,weights,compnums); % >> [projdata] = plotproj(data,weights,compnums, ... % title,limits,chanlist,channames,co...
c09e8a653e78a4e1c1f135e0b65708c1966a3afc24e8058cd05297cd9910d9ec
MATLAB
6,421
167
function [MRSCont] = OspreyAddImages(MRSCont) %% [MRSCont] = OspreyAddImages(MRSCont) % This function allows adds the three plane images into the container to % make it transferable % % USAGE: % MRSCont = OspreyAddIamges(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data container. % % OUTPUTS:...
ead44a75259ac1d63391e4922678f24419b6bfbb6e05befaf3e6f57f5fea0bee
MATLAB
6,421
153
function out = IN_MultivariateAMI(y, tauMethod, estMethod, extraParam) % IN_MultivariateAMI Multivariate automutual information, I(x_t; x_{t-tau}, x_{t-2tau}) % % Measures how much information the past two points (spaced tau apart, with tau % estimated from the series' own autocorrelation structure) jointly carry abo...
096c06dec6182e1c38d008d66602357fb7bbdedc303cdf20ed118e88e31bae02
MATLAB
6,422
210
function info = plotTCA_ephysFig(K, drawLines, varargin) %VIZ_KTENSOR Visualize a ktensor % % Xticks = cell array (one per mode) % Xticklabels = cell array (one per mode) % Xlims = cell array (one per mode) % Ylims = cell array (one per mode) % Hrelspace = Relative Horizontal Space Between Plots (.1) % HspaceLeft = Abs...
75e23e9a8d0e4a6131e04fd30ab31c039350cc585d7abdac04681f84cc0469bf
MATLAB
6,422
183
function [c, r, t, cpulse, acq_codes] = tapas_physio_read_physlogfiles_brainproducts(log_files, ... cardiac_modality, verbose) % reads out physiological time series (ECG, PMU, resp belt) and timing vector for BrainProducts .eeg file % % [cpulse, rpulse, t, c, acq_codes] = tapas_physio_read_physlogfiles_brainprodu...
3d8932c63cf8aeb7ffc69b590de6a7acfdf221f60a8007a9ab543f9750d04c4b
MATLAB
6,424
164
function out = NL_nlpe(y, de, tau, maxN, theilerWin) % NL_nlpe Normalized drop-one-out constant interpolation nonlinear prediction error. % % Computes the nlpe for a time-delay embedded time series using Michael Small's % code, nlpe (renamed MS_nlpe here): % % ---INPUTS: % y, the input time series % de, the embedding...
c1a41d00580513054794cd0cb65b9f49819067c0a61a712833d7898c3e86d32c
MATLAB
6,426
192
function [handle,pltchans,epos,Zi] = topoplotIndie(Values,chanlocs,varargin) headrad = 0.5; GRID_SCALE = 64; CIRCGRID = 201; HEADCOLOR = [0 0 0]; HLINEWIDTH = 1.7; BLANKINGRINGWIDTH = .035; HEADRINGWIDTH = .007; plotrad = .6; Values = double(Values); SHADING = 'int...
0d4b8ad8d315c073de90b341afd70826d1666ebeafc77d76e8d9c76db0355e6d
MATLAB
6,427
178
%%Figure S3A %PCA analysis and visualization of 32 molecular descriptors for the 690 %odorants from the DoOr database (gray dots), and the 35 odorants in %our panel (red dots) %% clear workspace clear all; clc %% read data %define and load the .xlsx file filename = 'eDragon Descriptors for Panel of 35 Odorants'; %...
3c1f9962ce141de6629f05c10b9fda4f1b28dbc4d2f8896bf131cbaeecc4deda
MATLAB
6,428
212
% createfigure Create figures for generic decoding results % % Author: Tomoyasu Horikawa <horikawa-t@atr.jp>, Shuntaro C. Aoki <aoki@atr.jp> % clear all; %% Data settings resultsDir = './results/'; resultsFileFeatPred = fullfile(resultsDir, 'FeaturePrediction.mat'); resultsFileCatIdent = fullfile(resultsDir, 'Cate...
86ce4969a1cb4562c14c971d486d62a21062b4a850c5b29e8d132324220490b4
MATLAB
6,429
168
function PCs = pca(this, cutoff, pcDimension) % Computes principal component analysis (PCA) of image time series % % Y = MrImage() % PCs = pca(this, cutoff, pcDimension) % % This is a method of class MrImage. % % Spatial PCA (default): % The principal component analysis report representative spatial % distributions...
44783d5aced14af1b1aba154f08e2619a8f386cf09976b2f19309b2676526483
MATLAB
6,432
178
function [obj] = ft_determine_units(obj) % FT_DETERMINE_UNITS tries to determine the units of a geometrical object by % looking at its size and by relating this to the approximate size of the % human head according to the following table: % from 0.050 to 0.500 -> meter % from 0.500 to 5.000 -> decimeter % ...
20be288aba81d2d76620e02c0f46cf257c4cafcb6a9e85392faf844ef8a033fb
MATLAB
6,433
227
function images = get_stimulusimages(username, accessKey) % get_stimulusimages Get stimulus images from ImageNet % % Note: % % This script is for downloading all 1200 training and 50 test images of % experimental stimulus used in Horikawa and Kamitani 2017 % "Generic decoding of seen and imagined objects using hier...
ef67cf1619560d8698a0062f94edf7751a70e156a648404ae335afad29b39071
MATLAB
6,433
174
% EEG_EVENTTABLE - returns all events contained in the EEG structure (and % optionally exports them to a CSV file) % % Usage: % >> events = eeg_eventtable(EEG); % % Inputs: % EEG - EEG structure % % Optional inputs: % 'unit' - Unit of events containing time samples, can be either...
b467e1f493d2cc09814a2d6b79bb5d59f9821b1c95f9475645681bd9cb2d6fde
MATLAB
6,434
221
clc; clear; close all; % subj_files = dir("*_eeg.mat"); similarity_over_coherences = struct("subj_n",{},"coh_sig",{}); similarity_over_conditions = struct("subj_n",{},"cond_sig",{}); MY_rdmSets = struct("subj_n",{},"rdmSet",{}); %load delay files directory = 'D:\Program Files\MATLAB\Joint_Perception_P...
f1258ef6140be684460d25497995708b29fe1daf0af36e1b4a9b052f2b8e8f14
MATLAB
6,442
221
function [output]=pieceWiseUnmixing(signal, reference, Fs, varargin) % for now, only work with vectors for both inputs % first scale is always correspond to 4 slices. % alternatively, use 1sec window with overlap (from 0% to 90% ovlp) % Output strucutre: % output.residual % output.coefficient % Variable Input Ar...
b6d52a470bc5325eab15a4bec3fd912546eecdffe2c2a1a046c6d5bee73f7e10
MATLAB
6,443
152
function data = speedcells(data) % function data = speedcells(data,vbins,ngaussigma,maxlag) % setting some inital parameters (user input) vbins = 0.02:0.01:0.2; % m/s ngaussigma = 2; % sigma of the Gaussian filter (in number of datapoints, i.e. [ngaussigma/framerate] sec). Put ngaussigma=0 if not using Gaussian f...
4837534fbcfb395b0e5e6031ad553e9cddbbfcf616cd4305da4ceb1805244190
MATLAB
6,446
230
function sx = gen_input_spikes(fr, T, varargin) % GENERATE_INPUT_SPIKES - Generate spike trains from firing rates % % H1 Line: Create Poisson spike trains with optional noise modulation % % Syntax: % sx = generate_input_spikes(fr, T) % sx = generate_input_spikes(fr, T, F, NI, sigma_n, tau_n) % sx = generate_input...
f6911b4fb430f5c72c2c2e4ada88f45acb18953cb36ee8157d238b0964396e0e
MATLAB
6,447
153
function [cov_signal_epoched, cov_noise_epoched, artifact_threshold_out,Treshold1] = clean_SENSAI(artifact_threshold_in, refCOV, Eval, Evec, cov_total, varargin) % This GEDAI function estimates signal and noise covariances analytically %% Creative Commons License % % Copyright: Tomas Ros & Abele Michela % ...
32a7f4743f9f0a4ef01cc4b93e802f15c2d030e9b104a6e084669244a15c2e88
MATLAB
6,449
152
% EEG_IMPORT - Import data files in a variety of supported format % % Usage: % >> EEG = eeg_import(fileIn); % >> EEG = eeg_import(fileIn, 'key', 'val', ...); % % Inputs: % fileIn - [string] input file name. The function used to import the file is % based on the file extension. % '.set' - POP_LOADS...
2e7ef24f2b0e1e24bbac7735cfe4f92b6f81afbac68a70a7d5171be569a9b31a
MATLAB
6,451
141
function out = BF_CumSumBridgeStats(p) % BF_CumSumBridgeStats CUSUM/bridge stationarity statistics on a cumulative sum. % % Given a series p_t whose mean is being tested for stationarity, forms % cumsum(p) and computes: linear-fit statistics on the cumsum (cf. SY_Trend), % a CUSUM 'bridge' relative to the endpoint-to-...
807e7f9da1558165795a583ba6fc895e75a8d76655547cc9df4dd38ec6bbedfe
MATLAB
6,452
166
%% [chi] = Wrapper_QSM_MEDI(localField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData) % % Input % -------------- % localField : local field map (tissue fields), in Hz % mask : signal mask % matrixSize : size of the input image % voxelSize : spatial resolution of each dimension of the data,...
3d8e9aa364e96c57b0e07301987920f7762e6401d589d93a73937542d0eca07c
MATLAB
6,454
179
function [dataPlot, displayRange, resolution_mm] = extract_plot_data(this, varargin) % Extracts (and manipulates) data for plotting with arguments from MrImage.plot % % Y = MrImage() % Y.extract_plot_data('ParameterName', 'ParameterValue' ...) % % This is a method of class MrImage. % % IN % varargin 'Parameter...
0c4aea1f39704442cf4453f236d2cdea2c67803dd0ae8201ef613ab113dfabf1
MATLAB
6,455
176
function [rvt, timeRpulseMax, timeRpulseMin, verbose] = ... tapas_physio_rvt_peaks(fr, t, sample_points, verbose) % computes respiratory volume per time from filtered time series % % [rvt, rpulseMax, rpulseMin] = tapas_physio_rvt_peaks(fr, t) % % % NEW: % The respiratory volume/time is computed by interpolating ...
cca8b3357449ff891ce4cbae2010977a8bdfed790ee5a2dedf66a58d10c76447
MATLAB
6,456
186
function [ suma ] = nf_read_suma( suma_dir, ld, surf_class) %[ suma ] = nf_read_suma( suma_dir, ld, surf_class) % Will read in the SUMA surface of a specific ld from the specified dir % will return a strcut with % .pos = vertices % .tri = faces % .curv = curvature % .annot = annotations % .annot_key = annotations k...
0e5d5f2984f71ca5c1e1f2ed98534c242f54f92a98e123847c85a1cfabccd9c0
MATLAB
6,458
152
% POP_TIMTOPO - call the TIMTOPO function for epoched EEG datasets. % Plots the epoch mean for each channel on a single axis, % plus scalp maps of the data at specified latencies. % Usage: % >> pop_timtopo( EEG, timerange, topotimes, title, 'key', 'val', ...); % % Inputs: % EEG ...
b6a0792dfc84c0d5982a0d58d48a491dd1b4c121ec9eec3a31e07c2770339b73
MATLAB
6,459
169
function info = step1RunSearchlight_noMask(opt) % Step 1 : running searchlight (SL) % get the smoothing parameter for 4D map funcFWHM = opt.funcFWHM; % set output folder/name savefileMat = fullfile(opt.pathOutput, ... [opt.taskName, ... '_SL_VisDirSel_n...
acae30cb618c3d5582b14bbea9e50946c0dd9b4d306ad77bbee69ebcc22a519b
MATLAB
6,461
201
function varargout=getLFPpowerSpec(lfpFile,nCh,targetCh,saveFile,varargin) % [spec,t,f]=getLFPpowerSpec(lfpFile,nCh,targetCh,saveFile,...) % % spec is power spectrum density in uV^2/Hz % (as long as I understood mtcsglong() correctly) % % options and defaults % whitening=true; % nFFT=2^11; % samplingRate=1250; %1/...
21937d5144c3d857b7a04aefa0f7a54ce50352c838fd9470a6e4edbaa980040f
MATLAB
6,462
157
function [VOLLOCS, LOCS, verbose] = tapas_physio_create_scan_timing_from_end_marker_philips(log_files, thresh, sqpar, verbose) %extracts slice and volume scan events from gradients timecourse of Philips % SCANPHYSLOG file % % [VOLLOCS, LOCS] = tapas_physio_create_scan_timing_from_gradients_philips(logfile, % thresh...
663537581b5b6622a48c94d738bab94620629e937b3943661fdf0d86b5bb36d4
MATLAB
6,463
174
function [freq] = ft_datatype_freq(freq, varargin) % FT_DATATYPE_FREQ describes the FieldTrip MATLAB structure for freq data % % The freq data structure represents frequency or time-frequency decomposed % channel-level data. This data structure is usually generated with the % FT_FREQANALYSIS function. % % An example o...
edad5d11423bc6ae19be50e5011d9e7b370f970e91ef34225b5ca7078ef5dcb7
MATLAB
6,468
207
function visualMotionLocalizer(cfg) % % (C) Copyright 2018 Mohamed Rezk % (C) Copyright 2020 CPP visual motion localizer developers if nargin < 1 cfg.design.localizer = 'MT'; end getOnlyPress = 1; % Clear all the previous stuff clc; if ~ismac close all; cle...
29a6a00be7384e6fd68a0237545a920425298c3bced61e654087208a6a3b7b0c
MATLAB
6,469
160
function PlotExtendedData10(datadir, codedir) %PlotExtendedData10 - Plots Extended Data 4. % INPUTS: % datadir - Local directory where ProcessData_ExtendedData10.mat was saved after running ProcessData_ExtendedData10 % codedir - Local directory where code (e.g., published/EstrousRPE/) was saved %% Set up paths s ...
86275eb7df44cb809aa3d11c996c8f9b5ed1d1c8fadc45e0c968ef4615d6af54
MATLAB
6,469
188
function run_permucorr_examples %RUN_PERMUCORR_EXAMPLES Run permutation correlation examples. % Generates random multivariate data for 2 "dependent" samples X and Y. % Each sample has 20 variables, each pair with a correlation of 0, except % for the first 5 variables which have a weak positive correlation, and %...
8385219649e7116c6250fd54d0bc6cbc25a8c8e33ff12905ea063eb372a88c51
MATLAB
6,472
155
function fig = plotSingleSensor(parentFIG,UOI,coordinates) %Plots a figure with 3 axes % (1) The signal of all direct neighboor of a UOI within a neighborhood % specified by the user % (2) The signal of the UOI itself in large % (3) STA Video corresponding to that unit of the entire chip % % INPUT: ...
8f5dcc21b49013969195fd95a1c315d47db47484f6e6876a9bec4de43ef970ea
MATLAB
6,474
172
% examine burst dynamics in mice % user must select files they wish to analyze from the list below (lines % 38-60). The code will automatically run with the sample data in the % Github. If the user would like to analyze any of the other data, they % must add it to the current folder from FigShare. Be sure to have t...
eb137c713d399f4c8f1c450fe4119aaa7ac9c31c2e0ce2a4faf7515a3095a571
MATLAB
6,474
164
function shuffle_icaReacCCG_chamberCondDur(basename) [~,ratName,~]=fileparts(basename); [rootPath,sesName,~]=fileparts(basename); fprintf('%s load files for %s\n',datestr(now),sesName); load(fullfile(rootPath,'data',[sesName '-icaReac.mat'])) load(fullfile(rootPath,'data',[sesName '.sleepstate.states.mat'])) load(ful...
0fee8bdd69c44e5ef435b0100e06b53c4a639c9d9e439df5c97c2c2f0b7f67ac
MATLAB
6,480
142
function triggers = getTriggers_locExtrema(params) % triggers on local extrema of predictor variable, defined in: % params.locExtrema = struct(... % 'predictor', params.response, ... % 'minOrMax', 'both', ... % options: min, max, both % 'deadPeriod', 1, ... % in [...
0486b55c3f5c73ecc5fc2fc83e08ab2a75180199e367e00cad4548f6c089b198
MATLAB
6,483
146
function this = subsasgn(this, subs, A) % Subscript assignment for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: subsasgn.m 6513 2015-08-05 17:52:13Z guillaume $ switch subs(1).ty...
4000a4ed15ee671135a16efdc573008f9aae79a3392833bc32aa63d27013ae5c
MATLAB
6,483
241
function [avgSpk] = Vol_all_cells(all_SU,goods,all_S,all_index,win,varargin) %plot heatmats aligned to reward volume for all cells %plots the average psth for reward volume at each task event. %plots a hmat % input: % all_SU - the data of all cells % goods - cells you want to include % all_S - data of all cells % all...
777127fac94a6af09565fcf10a4a9fd346d3736e13c119a489926b55fd1001b7
MATLAB
6,486
121
function [PC_norm,PC_residual,PC,between_mod_k] = participation_coef_norm(W,Ci,n_iter,par_comp) %PARTICIPATION_COEF_NORM % % [PC_norm,PC_residual,PC,between_mod_k] = participation_coef_norm(W,Ci,n_iter,par_comp); % % Participation Coefficient (Guimera and Amaral 2005,Nature,433:895-900) is a measure % of di...
39beb4aa73c8033d724b12198f7df778a65254d2d168b9e0abe9e081bd72c7fc
MATLAB
6,488
128
function plot_task_performance close all clear all clc % Plot task performance. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) % Control. load('behavior_control.mat') behavior = behavior_control; clear behavior_control % Initialize. correct_rate_animal_session = []; for animal_num = 1:n...
95d680fdd8e2813e02fac950cc86052454eca9e04ea8df086c6697697d7177af
MATLAB
6,495
128
% DEMO1_RSA_ROI_sim is a script. It is a sample recipe file which will % simulate some fMRI data and then run through an "RoI-based" RSA pipeline for % the simulated data % % Cai Wingfield 5-2010, 6-2010, 7-2010 %__________________________________________________________________________ % Copyright (C) 2010 Medical Re...
faaaf99d382c719f64815ce2ff8ff9e671d32a8939fe7b4e04222845fea549cf
MATLAB
6,496
204
classdef nnconv < nntest properties (TestParameter) bias = {false true} fw = {0 1 3 5} fh = {0 1 2 3} stridex = {1 2 3} stridey = {1 2 3} emptyw = {false true} pad = {0 1 2} stride = {1 2 3 4} padx1 = {0 1 2} padx2 = {0 1 2} pady1 = {0 1 2} pady2 = {0 1 2} dilatex =...
8b63f2ba0bd43d5b2e596b7e335816bab01b3d247510bd030be1ec830ec3c3d7
MATLAB
6,498
204
classdef nnconv < nntest properties (TestParameter) bias = {false true} fw = {0 1 3 5} fh = {0 1 2 3} stridex = {1 2 3} stridey = {1 2 3} emptyw = {false true} pad = {0 1 2} stride = {1 2 3 4} padx1 = {0 1 2} padx2 = {0 1 2} pady1 = {0 1 2} pady2 = {0 1 2} dilatex =...
b2e0479abc0a58f5a06f80fb0aa44498b247ae358ab6eee4d277b9c846132fa6
MATLAB
6,501
224
function [hdr, nameFlag] = read_buffer_offline_header(headerfile) % function [hdr, nameFlag] = read_buffer_offline_header(headerfile) % % This function reads a FCDC buffer header from a binary file or text file % % On return, nameFlag has one of the following values: % 0 = No labels were generated (fMRI etc.) % 1 ...
6fb7a2cf4e8dc8ed9df6134a823a3979bf8829bd2b431937a3af83de4e8b1943
MATLAB
6,504
205
function M = realphasefactory(n, z0, zmax) % Returns a manifold struct to optimize over phases of fft's of real signals % % function M = realphasefactory(n) % function M = realphasefactory(n, z0) % function M = realphasefactory(n, z0, zmax) % % If x is a real vector of length n, then y = fft(x) is a complex vector % wh...
5cf74500b7652b5f9a6ec0981a0de4795c62fc309419f416fde55ce17aa5e542
MATLAB
6,507
237
% load original network NT = NetworkObj('../networks/circlenuchexresv_N20.net',struct('dim',2)) %% NT.plotNetwork() hold all %% set up and mesh single flat perinuclear sheet % pick out reservoir nodes resvnodes = []; for nc = 1:NT.nnode if (~isempty(NT.nodelabels{nc})) if (NT.nodelabels{nc}(1)=='R') ...
c54f71d07d7a88219229792e627cf18cea5a0343bdc7fd276f47f9cf94205eb1
MATLAB
6,512
173
function [ci_lo, ci_up, p] = bootConfint(x, B, alternative, user_opts) % bootConfint % Compute confidence intervals based on bootstrap distribution using % various methods and use them to derive p-values for hypothesis testing. % % [ci_lo, ci_up, p] = bootConfint(x, B, alternative, user_opts) % % Currently tw...
5c60f9fd90877a188e384c801e3cd50835c2c75b888fd33c07450cef3174c0b8
MATLAB
6,517
129
function MRSCont = osp_scale_yaxis(MRSCont,Module) switch Module case 'OspreyLoad' ppmmax = 4.5; ppmmin = 0.2; Range = zeros(2,MRSCont.nDatasets(1),MRSCont.nDatasets(2)); for kk = 1 : MRSCont.nDatasets(1) for ll = 1: 1:MRSCont.nDatasets(2) ...
435926733d2e2f51d9ebc75c6995056c8738712acd344e8d4dd7ff8935b00902
MATLAB
6,523
163
function spectra = spectra_hilb_sessions(params, trials) % computes spectra for each trial using band-pass filtering + Hilbert % transform + amplitude envevelope % extracta trials % trials = % data: [3073x125x500 double] % time: [3073x1 double] % sessTime: [3073x500 double] % labels: ...
5683b53c44b48baece7fd291b1627ae7ad0a031502d10f67adb4097044ed18d9
MATLAB
6,523
207
% (C) Copyright 2018 Mohamed Rezk % (C) Copyright 2020 CPP visual motion localizer developpers % Adapted by Iqra for repeated targets task % Direction 0 dots move right % Direction 180 dots move left % Direction 90-up, 270-down %% Visual motion localizer getOnlyPress = 1; more off; % Clear all the previous stuff c...
408d17343e3bbf818af4accddbc0dee14a9689f50e7833df29bbd30b8f6b05e6
MATLAB
6,527
196
% MATCORR - Find matching rows in two matrices and their corrs. % Uses the Hungarian (default), VAM, or maxcorr assignment methods. % (Follow with MATPERM to permute and sign x -> y). % % Usage: >> [corr,indx,indy,corrs] = matcorr(x,y,rmmean,method,weighting); % % Inputs: % x = first input...
2dfe51ebfc473517a2e62a4c28e8f477994f0bd92efabfa0640548685df8fe66
MATLAB
6,529
146
% Main script for computing depth-averaged group-mean fsaverage surface maps of % laminar SANDI metrics % % Reference: % Lee H, ..., Huang S, Communications Biology, 2026 % % Requirements: % - FreeSurfer installed and configured % - FreeSurfer recon-all completed for each subject % - Depth-resolved Group-mean SANDI su...
b16267749518b7f8d1836b99ecae055fec53e0122dbdc31d152c74f2fcc3df2a
MATLAB
6,529
221
% the commands to make the preprocess data usetorch = false; savedir = '~/projects/dynamics/data/maggie/'; %% reward epoch disp('reward epochs') epoch = 'reward'; decodertype = 'psth'; usemlb = true; if usemlb savename = strcat(savedir,'preprocess_mlb_shuffle_',epoch,'_',decodertype,'.mat'); else savename = ...
8f706604a98374aa81a4a24ad9768cbe90d3496b6ecb981cf43241eca0518fbd
MATLAB
6,530
266
function x = tapas_uniqc_resizeNd(x,newsiz) %RESIZE Resize any arrays and images. % Y = TAPAS_UNIQC_RESIZEND(X,NEWSIZE) resizes input array X using a DCT (discrete % cosine transform) method. X can be any array of any size. Output Y is % of size NEWSIZE. % % Input and output formats: Y has the same class as...
979160972031ff8cf2d8b596e3ca48825bae87d601893e78b50de87323fcb09d
MATLAB
6,530
201
%% This script compares the overlap between ROIs drawn by hand and freesurfer projected ROIs from the adult average brain clear all; clc; subj = { 'bb02_mri0_mask', 'bb11_mri0_mask', 'bb56_mri0_mask', 'bb22_mri0_mask',... 'bb62_mri0_mask', 'bb07_mri0_mask', 'bb67_mri0_mask', 'bb28_mri0_mask',... 'bb14_mr...
ae21148e9d0647bd54eb1ecd1e977fa5d8b40c7fb15894623041afe9e9e5a96e
MATLAB
6,533
161
function [A, R] = generalized_procrustes(A_measure) % Rotationally align clouds of points (generalized Procrustes problem) % % function X = generalized_procrustes(A_measure) % % The input is a 3D matrix A_measure of size nxmxN. Each of the N slices % A_measure(:, :, i) is a cloud of m points in R^n. These clouds are % ...
afce9050b7b18247000d5876e1bdd52d52968a05a7fea65d7fd25619c3004a27
MATLAB
6,533
158
function TOL_fig_young1967(config,params,dat) % TOL_fig_young1967, figure of Young et al.'s (1948) apparatus and design % Figure S5 for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80 % years on: A meta-analysis reveals poor replicability and little evidence for % shortcutting. European Journal of Neuroscience....
e3a852a795e6c6e9cc6d6d8110df881d4676042ffc7e23bee106eb80502365e2
MATLAB
6,536
228
function str = hlp_tostring(v) % Get an human-readable string representation of a data structure. % String = hlp_tostring(Data) % % The resulting string representations are usually executable, but there are corner cases (e.g., % certain anonymous function handles and large data sets), which are not supported. For % gen...
11163765399381dfdf9f48bcaa5a173be4c1c2aa7698ed94d3da0ef359d15c25
MATLAB
6,537
211
function M = fixedrankfactory_2factors_subspace_projection(m, n, k) % Manifold of m-by-n matrices of rank k with two factor quotient geometry. % % function M = fixedrankfactory_2factors_subspace_projection(m, n, k) % % A point X on the manifold is represented as a structure with two % fields: L and R. The matrix L (mxk...
7f52412a874241096b54edf66602acfba12a2850c041f924f4546f53403bac4c
MATLAB
6,537
139
classdef McsCmosSpikeSorterSource < handle % Holds the contents of a SpikeSorter source in a CMOS-MEA file % % Important fields: % UnitEntities - (cell array) List of McsCmosSpikeSorterUnit % objects, one for each sorted unit in the data % source. Hol...
26c74eea7e98bd91b4e10c493b84528977871c00db7f58b18607db7020f29465
MATLAB
6,541
156
%% single trials: brain + DMN or DAN + selCh % plots 3D brain with highlighted NN + selCh % (c) Jiri, Feb24 %% settings sel_AA = { 'Default'; 'Dorsal Attention'; }; sel_viewAngles = { % 'sagittal L', [-90, 0]; % sagittal R = 100,10 (90, 0) % 'axial', [0, 90]; % axial = 0,90 ...
fe658afce0356e1199177af59de1a0a2c225413a25c8474f0dd15d69ef3b91e5
MATLAB
6,541
206
function [f,p,ci,stats,tbl,dist] = permuanova1(x,group,varargin) %PERMUANOVA1 Permutation-based one-way ANOVA and Kruskal-Wallis test. % F = PERMUANOVA1(X) performs a permutation-based one-way analysis of % variance (ANOVA) for comparing the means of two or more groups of data % in matrix X, and returns the test...
6eb9e9f66d2c1f6dce36b1c58d37a9346fe82f0158796716ad2b84d552482053
MATLAB
6,543
176
% surrogdistrib - Build surrogate distribution % % surrog = surrogdistrib(data, varargin); % % Inputs: % data - [cell] data arrays for which to compute a surrogate % distribution. % % Optional inputs: % 'method' - ['bootstrap'|'perm'] use either 'bootstrap' or 'permutation' % method. Bootstr...
9f6f30dc18338cf933d7dee1f101e8a14b88ac5fc629c8753b7c5c7793583dbb
MATLAB
6,547
146
%% paths = generate_synthetic_phantom(outputDir, matrixSize) % % Description: deterministically builds a small multi-echo GRE-like % synthetic phantom (magnitude + phase NIfTI, a brain mask NIfTI, and a % sepia_header.mat) under outputDir, for use as Tier-1 regression-test % input. Fully self-contained: no external too...
ec98d850d0116d5729a027395281b9dde69d8cc614e817dd448e1adcba6f7003
MATLAB
6,549
219
function B = medfilt3_nan(A,siz,padopt,CHUNKFACTOR) %MEDFILT3 1-D, 2-D and 3-D median filtering. % B = MEDFILT3(A,[M N P]) performs median filtering of the 3-D array A. % Each output pixel contains the median value in the M-by-N-by-P % neighborhood around the corresponding pixel in the input array. % % ...
8d47e4d571aeb1bc569261c14451530d67e3ddd47eee6db0d54ba200b0a6f700
MATLAB
6,550
223
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % res = fitDispersion(Dpara_in,Dpara_ex,Dorth,vf,vf_csf,snr,noisedeg, proto,Smeas,dirs256,disptypes,fod) % % fits dispersion depending on ratios of SH coeffs % Dpara_in,Dpara_ex,Dorth,vf,vf_csf - parameters of the micromodel % snr,noisedeg ...
56f75f78a83b5e43a232d9d34e034eeca31e764fd01a8f9a59faa2c1a57320dd
MATLAB
6,553
202
function [MC_Setup,activation_proportions,icon] = meta_prob_activation(DB,Xi,contrasts,connames,Xinms) % [MC_Setup,activation_proportions,icon] = meta_prob_activation(DB,[X indicator mtx],[contrasts],[con. names],[Xinms]) % % This function writes 'Activation_proportion.img' % --a weighted map of the proportion of indep...
9d745e85936136282e8db3f579315fa87e9b14dbb7d91eb0192c1700d4d21c8b
MATLAB
6,553
208
function writeFileNifti(ni) % Write a VISTASOFT nifti structure into a file compatible with the NIFTI-1 % standard. % % writeFileNifti(ni) % % INPUTS: % ni - a nifti file structure (.nii or .nii.gz) % % OUTPUTS: % none. % % Web Resources: % mrvBrowseSVN('writeFileNifti') % % Example: % ni = ...
1ea1f282194b4594f8527b0505b25f0f0f670d07444679c9a07cc4571d0da040
MATLAB
6,554
142
function [evaltermin,TermCondDataAdd] = EvalTermCond % Function determines whether prespecified set of termination conditions % have been satisfied. % Termination conditions (case 1): % (1) The algorithm must have progressed at least 2 generations following % the implementation of memory structure-de...
52532cba7acadbcdf93ddcfe4502b1652570cccf306a0798a7ee54ffb093256a
MATLAB
6,556
186
function [z,p,ci,stats,dist] = permuztest(x,m,sigma,varargin) %PERMUZTEST One-sample permutation-based Z-test. % Z = PERMUZTEST(X,M,SIGMA) performs a one-sample permutation test based % on the Z-statistic of the null hypothesis that the data in X come from % a distribution with mean M, and returns the test stati...
a769e9ed87b29ad49e080b0a526c6ac3fa5df3b20f3b2c7c37f1f2ea0c630c85
MATLAB
6,557
172
function out = WL_DetailCoeffs(y, wname, maxlevel) % WL_DetailCoeffs Detail coefficients of a wavelet decomposition. % % Compares the detail coefficients obtained at each level of the wavelet % decomposition from 1 to the maximum possible level for the wavelet given the % length of the input time series (computed usi...
f2b08a99de708836be9959e92d1f36b3c4d31245f4e1b5bf96ff14eb2aa0ae07
MATLAB
6,558
175
function NetMet = plotNodeCartography(adjMs, Params, NetMet, Info, originalCoords, ... originalChannels, HomeDir, fileNameFolder, oneFigureHandle) % Plot individual node cartography plots per recording. % Part of Step 4A of MEANAP. % Parameters % ---------- % adjMs : struct % structure where each field contai...
3c64c45907630dcfffe4cdae64dabc871d85445e3e437de1910c0b17f11bc6bf
MATLAB
6,559
185
%% ---------------------------------------------------- % Load data % ----------------------------------------------------- load('FeaturesSelect_forPub.mat') %% ---------------------------------------------------- % Experiment parameters % ----------------------------------------------------- numIter = 100;...
4c07832a5d66f1479457bc6e0f2f8937a78bb188b2812c898f9f12aca09c1349
MATLAB
6,559
189
%% ASCII clearvars % Load data folder = 'Q:\EYELINK_data'; files = dir([folder, '\*.asc']); % Get trial info trials = cell(size(files,1),1); for i=1:size(files,1) fprintf(1,'#%d\n',i); %print file nr % load data data = read_eyelink_asc([folder,'\',files(i).name]); % define trials trial...
1cafabf5b4a9ced5fc9c6f4e33990f93be07b08576c8800aedb1c97af52e2eaa
MATLAB
6,565
197
function check_dump(path) % This is used to explore Cytosim's linear system in matlab % - load the matrices and vector from Cytosim's dump % - plot convergence pattern of BICGstab, with and without preconditionning % % F. Nedelec, 16.10.2014, 03.2018, 06.2018, 26.01.2019, 30.06.2019 if nargin < 1 path = '.'; end ...
7e004b71616028648f5c84df3ae3d13c3f89020106bac466acd99588e2b009fd
MATLAB
6,565
174
function volumes = sero_pulseq_recon2DEPI_siemens_per_bval(fn_data, fn_seq, xps_fn, rec_delay) % volumes = pulseq_recon2DEPI_siemens_per_bval(fn_data, fn_seq, xps_fn, rec_delay) % Reads Siemens raw data and performs ghost correction per unique b-value. % Based on pulseq_recon2DEPI_siemens. % All processing downstream (...
c0126f90087d828998352550edc4f94257d87b4acb2dd3c738a89a49b506bdaa
MATLAB
6,566
148
function [coeff,score,explained]=SpinalCompCor(basedir,spinemask,fMRIpath,prefix,options) % SpinalCompCor performs PCA in spinal cord fMRI noise ROI and outputs % components % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ****************************** IMPORTANT! ***************************...
5ae9e727dd0297a1d48843b27605e643daf2b4579494257b11379f67ab1d2696
MATLAB
6,568
147
function out = DN_SimpleFit(x, dmodel, numBins) % DN_SimpleFit Fit a simple model to the distribution of time-series values. % % Uses the 'fit' function from Matlab's Curve Fitting Toolbox to fit a simple % parametric model to an estimate of the distribution of values in the time % series, ignoring their temporal orde...