sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0737507f60ab01f9698d583cc4fa989a74054cc0e6f16cf381e7c34895e42bc9
MATLAB
9,452
311
function fear_coactTrigWavelet_shuffle(basename,varargin) % basename='~/data/Fear/triple/feuillien180830/feuillien180830'; % basename='~/data/Fear/triple/karmeliet190901/karmeliet190901'; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName); l...
33943d4abc0f8e801a5f261f7d5af343087eed42f6388a7f46713724fb650093
MATLAB
9,458
238
%% Calcium Imaging Analysis Script % This script analyzes processed calcium imaging data from CaImAn/ezcalcium % It calculates burstiness, firing rates, spike probabilities, functional connectivity, and synchronization metrics %% Clear workspace clear; clc; %% User-defined parameters (modify these as needed) ...
bcc0acfde81c133f526e2b353629648620c2962b43d61867ba51fde107b14a00
MATLAB
9,464
217
% POP_RMBASE - remove channel baseline means from an epoched or % continuous EEG dataset. Calls RMBASE. % Usage: % >> OUTEEG = pop_rmbase( EEG ); % pop up an interactive arg entry window % >> OUTEEG = pop_rmbase( EEG, timerange, pointrange, chanlist); % call RMBASE % % Graphic interface: % "Basel...
665ed628abf9ee1ab613a8a8e8cf84dabe383c7dab8d7a50c245ea5ca665441f
MATLAB
9,465
283
function varargout = events_tsv(filename, hdr) % EVENTS_TSV is called from FT_READ_EVENT to read the events from a BIDS _events.tsv % file. Although this function also reads the header for the sampling rate, it cannot % be used to read data. Please see BIDS_TSV for reading data. % % Use as % hdr = events_tsv(filenam...
de5db5d47b8f62debc4f50f4d913a471df34616d445edb56264eb8e4b5b7c012
MATLAB
9,465
257
function varargout = spm_prf_fcn_numerosity(P,M,U,varargin) % Template pRF response function. This example models neuronal % activity as a scaled version of the inputs: % % z(t) = alpha * u(t) % % Where alpha is a parameter estimated from the data. % % % Inputs: % % P - parameter structure % M - model struct...
034926a671c0b44420b1a08126b0ece48f65eef0fe4ce2c8c814b9b4a10f4825
MATLAB
9,467
272
function [np_marker] = np_readmarker (filename, idx_begin, data_length, option) % % function [np_marker] = np_readmarker (filename, idx_begin, data_length, option) % % np_readmarker reads marker from a NEURO PRAX marker file (*.EE_). % % Syntax: % % [np_marker] = np_readdata(filename,idx_begin,data_length,'samples');...
13209c481aebd26fbf9360178a7bb3b7d2db1f7a85c8a374bea508d7922f2ee9
MATLAB
9,469
309
function [] = Figure4(datadir, codedir) %Figure4 - Block sensitivity for wait times requires structure learning % datadir = directory of dataset % codedir = director of code %% Set up paths s = pathsep; pathStr = [s, path, s]; onPath = contains(pathStr,... codedir, 'IgnoreCase', ispc); if ~onPath % only add ...
931886c4399f52f990d38964e18f9b6dc6ebf6b7d9b50fa07d99fb15c5d3bdec
MATLAB
9,469
251
function [spikeTimes, spikeWaveforms, trace, threshold] = detectSpikesCWT(... data, fs, Wid, wname, L, Ns, multiplier, nSpikes, ttx, ... minPeakThrMultiplier, maxPeakThrMultiplier, posPeakThrMultiplier, ... multiple_templates, multi_template_method, channelInfo, plot_folder, ... run_detection_in_chunks,...
92e13223569807c2154b691fd56cfe98b8c558f3a3a6d065d1e282bb588d4466
MATLAB
9,475
200
function TOL_fig_wilson2018(config,params,dat) % TOL_fig_wilson2018, figure of Wilson and Wilson's (1948) apparatus and design % Figure S4 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 Neuros...
1dcb22c6560855b5c5d6d15ffa4387c2fe7a89cf99e8644dc9d3d7935ae5a35a
MATLAB
9,477
201
%% ===================================================================== % EEG PRE-PROCESSING AND ERP EXTRACTION PIPELINE (EEGLAB) % --------------------------------------------------------------------- % Author : Suong Welp % Date : 2025-07-24 % Purpose: pipeline for cleaning raw EEG,removing ocular / spe...
24aaddead55caa9ba9e492b8fd9047c4c5476600bea8eaaabc6c2d6cf7a24f30
MATLAB
9,479
244
function PlotMap(data, I, ui0, PathName, layer_names, markertype, markersize, bar_intervals, colourmap, x_lim, y_lim, varargin) % by Julia Becker, 14/10/2021 %PLOTMAP Plots heatmaps based on modulus values from data and specified % scale on cropped image with optional scalebar % OPTIONAL INPUTS % - Answers t...
1e34bbe1272e0826f72d27a3862ff78ac937b78816b66f5b6179b2665261a5f9
MATLAB
9,487
231
function [B1temp, T1temp, MP2RAGEcorrected] = T1B1correctpackage(Sa2RAGEimg, B1img, Sa2RAGE, MP2RAGEimg, T1img, MP2RAGE, brain, invEFF) % Usage: % % [B1corr, T1corr, MP2RAGEcorr] = T1B1correctpackage(Sa2RAGEimg, B1, Sa2RAGE, MP2RAGEimg, T1img, MP2RAGE, brain, invEFF) % % Sa2RAGEimg (and B1) and MP2RAGEimg (and T1i...
c9e0f8f3dd807350e459c601d1697b06dd1bf38322efd60d762b61c8ce7c67fb
MATLAB
9,490
258
function ProcessData_Figure4(pstruct, bstruct, BestFitEarly, BestFitLate,... codedir, savedir) %ProcessData_Figure4 - function to process data to generate Figure 4. Saves % data in savedir to be accessed by PlotFigure4 % INPUTS: % pstruct - photometry data struct. Not public until all papers using this % data a...
1140c0abd0425fe3182011a838567706d48e8875d476bdf119ae04fc9f9592b9
MATLAB
9,498
264
function run_github_examples %RUN_GITHUB_EXAMPLES Run GitHub examples. % Generates random multivariate data for 2 samples X and Y and runs the % following examples for GitHub README: % 1. Plots the permutation distribution and test statistic % 2. Tests for differences in multivariate sample variances (...
dcff7265e941b4087865cd2e06ca65eb0c105fd463ad75d473eef4303d55abc9
MATLAB
9,499
220
function triggerAnalysis(params) % determines trigger events and uses those samples to extract response in % given time range % triggers{clz}(sample,sess) are indicated by METHOD in params.triggerOnMETHOD % (c) Jiri, Apr12 (in whitenoise), Mar16 if ~params.triggering.doTriggering disp('Triggering on events not se...
8dc1d7cd4a2253616e1e7e23ac8e378ea10cb3159c14e2e8da1e69d524b89358
MATLAB
9,503
304
function [ obj ] = simulate( obj, clusters, sizes, varargin ) % Generate synthetic task-based fMRI time series data, using HUGE as a % generative model. % % INPUTS: % obj - A tapas_Huge object. % clusters - A cell array containing DCM structs in SPM's DCM format, % indicating the DCM network str...
cefcc7d21d0656b35a1e39e25f7699f3676f0a57c5bde046d1dbd5bc2c270f8b
MATLAB
9,505
209
function MRSCont = osp_extract_minmax_fit(MRSCont, which_spec, conc) %% out = osp_extract_minmax_fit(MRSCont, kk, which_spec, conc) % Creates a figure showing data stored in an Osprey data container, as % well as the fit to it, the baseline, the residual, and contributions % from the individual metabolites. % % ...
5966df961707ee669e888db0e681d23fad7558c407f471bb7203de9a85a17e0a
MATLAB
9,510
327
% Script for testing singular values computed using LANSVD, LANEIG and % EIGS. % Rasmus Munk Larsen, DAIMI, 1998. global MxV MU MUTRUE NU NUTRUE MU=[]; MUTRUE=[]; NU=[]; NUTRUE=[]; rand('state',0); setup = 1; % set setup=1 to set up testproblem. k=10; % Number of singular values to compute HB_dir = 'Harwell-Boein...
4dcbd8d6f0851031a0b5053640f8a6ae2aac1ee46bc46315a8de2d53bc64fe66
MATLAB
9,511
310
function ft_tcontrast(cond_input, path_contrast, name_output, ... name_sess, hrf_derivative, regressor_nointerest) % Get t-contrast % % ft_tcontrast(cond_input, path_contrast, name_output, ... % name_sess, hrf_derivative, regressor_nointerest) % % Inputs: % cond_input - cell array containing filename...
caebe3c16156d642b59c5d89aa061c37c042fe5816976670134247d35f059420
MATLAB
9,511
241
%% BiExpFitModelT2Relax.m % This function contains a T2 corrected biexponential diffusion model % modelled as a 2D problem. % % lossFunction - calculates loss function for optimizer % forwardJacobian - calculates the forward jacobian for optimizer % forwardModel - converts parameter struct into model p...
99ff5696b041db5f02d60a7c4df8bc21076eb4407e5a99a385d9f386a49a3ad1
MATLAB
9,518
249
clear all; clc; load('vik.mat'); % Load class labels for proper labeling class_label = load("meta.mat"); rdm_type = 'cosine'; % 'cosine' 'pearson' wv = load('cifar100_ss20_wordvec.mat'); wv_data = struct2array(wv); ct = load('cifar100_ss20_ni1e-1_ychen_trail1.mat'); ct_data = struct2array(ct); % Clustering parame...
5e3170366e55c16dcaa0b82859e1dec10728aea140229af77bbb145054cf1658
MATLAB
9,524
192
function out = EX_ExtremeEventOrder(y, extremeThresh) % EX_ExtremeEventOrder Temporal patterning of positive vs. negative extreme events. % % Labels each point in the top/bottom extremeThresh fraction of the % distribution as a positive- or negative-direction 'extreme event', then % asks not just how often each type ...
561d45bf084b876159341ebf2d3bca230e0019c3a8005b32fc9a174b46d02f5c
MATLAB
9,525
201
function shuffleResults = stimShuffleTest(spikeData, allStimTimes, Params, Info) % STIMSHUFFLETEST Circular-shift shuffle test for trial proportion significance. % % Builds a null distribution of trial proportion values by circularly % shifting each electrode's spike times by a random offset (with % wrap-around within...
1666d4b51f0279fea2a294423b500f71c67ba25d7c5fdcb2ec74dafb2e23cd45
MATLAB
9,529
178
%% ch2roi_wrapper: assignment of iEEG channel to ROI (region of interest) % assignment based on: % - brain atlas: isarg_atlas from RJ (brain_atlas_v07_standalone.m) % - frequency band: in struct trialsData_freqBand (e.g. trialsData_hiGamma) % - significance of activation: was*, not*, any* % coded in structure 'gr...
fde4ee4c3a4794922f75b37dbf36929b5baf9a508a3e08f5e247a4aaccf3d8ac
MATLAB
9,533
257
function SuppFigure_Tuning_vs_NormInd_MI(varargin) %SUPPFIGURE_TUNING_VS_NORMIND_MI Generate supplementary figure for tuning vs normalization index mutual information % % Purpose: % Creates a figure analyzing the relationship between preferred orientation % and normalization index across model and experimental data...
9c3101e6efed24a1d28411def622f4482d522d4f43d50efb6b3ae9a60c7328ac
MATLAB
9,540
234
function MSMregression(inputspatialmaps,inputdtseries,inputweights,outputspatialmaps,outputweights,wbcommand,Method,Params,VN,nTPsForSpectra,BC,VolParams) %function [ output_args ] = MSMregression(inputspatialmaps,inputdtseries,inputweights,outputspatialmaps,outputweights,wbcommand,Method,Params,VN,nTPsForSpectra,BC,Vo...
cf7d248b4b52452707240882bfd7256192eef4c11d485b2d85a953c8a88f1295
MATLAB
9,555
234
% POP_SELECTCOMPS - Display components with button to visualize their % properties and label them for rejection. % Usage: % >> OUTEEG = pop_selectcomps( INEEG, compnum ); % % Inputs: % INEEG - Input dataset % compnum - vector of component numbers % % Output: % OUTEEG - Output dataset wi...
22134727469d1a172c5771750131d589b536f0f64e3788f61bbc136ab4465d03
MATLAB
9,556
311
function ft_tcontrast(cond_input, path_contrast, name_output, ... name_sess, hrf_derivative, regressor_nointerest) % Get t-contrast % % ft_tcontrast(cond_input, path_contrast, name_output, ... % name_sess, hrf_derivative, regressor_nointerest) % % Inputs: % cond_input - cell array containing filename...
9e4697281e8bc4f995c7d218a9e528cf1dd88d8087d7a01fbb40b753763cdc1e
MATLAB
9,556
388
function s=afni_niml_print(p, format) % takes a NIML data structure and converts it to string representation % % S=AFNI_NIML_PRINT(P) takes an NIML datastructure P and returns a string % representation S. % % This function is more or less the inverse of AFNI_NIML_PARSE. % % The current implementation will take any stru...
e4f95e6db7ee9deac0508096651a22705d785b53c6f2271fc3866c15352376f7
MATLAB
9,562
275
% parse up the beliefs into a 2d discrete distribution function [output] = dSTR_decode_parsedata(usetorch, varargin) %% general appraoch that should work for all cases % for each neuron, get the following % session_id % neurons' average firing over time (2s after reward) % p_mix and p_high for that trial % which bi...
89d95af24611f2d27ab510793cc3359944cde325da33f89073bee19d7084c614
MATLAB
9,563
120
function se_hdr = GE_readHeaderSeries(fid, byte_align) % % se_hdr = read_series_header(fid, byte_align) % % Loads the series header from a file with filed id fid % and returns it as a structure. % if byte_align = 1 then 32-bit alignment (SGI, LX2 format) % if byte_align = 0 then 16-bit alignment (Sun, 5.X format) % % %...
842bdbb90cdfe64db60dfa08ecb3725605856ae04959bf6543c28a494e25c017
MATLAB
9,564
237
function [this, affineTransformation] = read_single_file(this, fileName, varargin) % reads single file of MrImage from different file types % allowing property-name/value pairs to be set for parameters % % Y = MrImage(); % Y.read_single_file(fileName,'PropertyName', PropertyValue, ...); % % This is a method of clas...
27adc7f41e6a4feeff5a092acdf516142fee9f5b8b79de864149981d9b1d610c
MATLAB
9,565
212
function [offset,chai,knee_freq,log_spec,freqs,aperiodic,periodic,peak_params] = st_fit_LFP(frequencies, spectrum, fitting_range, peak_analysis) %Function to fit 1/f to LFP data. % Aperiodic component has 3 terms: offset, slope (chai), and knee % output gives the absolute, aperiodic, and periodic spectra in log...
3d072711b8ab6a9dda2c5fa80954de8a95a2bbf8142fe3f7348d864dbc5c9490
MATLAB
9,586
261
function create_surface_meshes(input_img, numvertices, input_coordsys, ... output_coordsys) % % Input: input_img <string> fullpath to folder, where the results of % mysegment.m are stored % numvertices <integer> number of desired mesh...
a55d4e6f8ddda665ab2e55ae5351e18a2fdad35c7ca0711cedb5a6fa658dd2e6
MATLAB
9,587
204
function [signal,removed_channels] = clean_channels(signal,corr_threshold,noise_threshold,window_len,max_broken_time,num_samples,subset_size) % Remove channels with abnormal data from a continuous data set. % Signal = clean_channels(Signal,CorrelationThreshold,LineNoiseThreshold,WindowLength,MaxBrokenTime,NumSamples,Su...
8ea1201ee1d9f12116e31071b162bf47d32866e8175a123c93d4718101d18131
MATLAB
9,594
323
function ft_tdm(img_input, cond_input, TR, stim_duration, sigma, mask_threshold, ... fir_steps, basename, output_folder) % TDM analysis % % ft_tdm(img_input, cond_input, TR, stim_duration, sigma, mask_threshold, ... % fir_steps, basename, output_folder) % % Inputs: % img_input - cell array of filenames of...
29ed9c95cd221bc4fd3bd93d7f35e6823dd9109a1ac742008580d1400fe8aa77
MATLAB
9,596
252
%% Loading data generated by the Multi Channel DataManager % As an example, lets load a data set with at least 1 analog stream: % % data = McsHDF5.McsData('SOME_DATA_FILE.h5'); %% % Up to this point, only the metadata has been read from the file. The % actual data within the stream will be loaded as soon as y...
5c360ce26851c515dba1ab5bedebd8c06273db5857acc2813c647994e159c20e
MATLAB
9,599
236
% POP_TIMEF - Returns estimates and plots of event-related (log) spectral % perturbation (ERSP) and inter-trial coherence (ITC) changes % timelocked to a set of input events in one data channel. % % Usage: % >> pop_timef(EEG, typeplot); % pop_up window % >> pop_timef(EEG, typeplot, lastcom); %...
64a313175d4553b020597cce50e28ca78eca345c46efb96cf053ab762caeb6a6
MATLAB
9,599
265
function SuppFigure_Superimposed(varargin) %SUPPFIGURE_SUPERIMPOSED Generate supplementary figure for superimposed stimulus condition % % Purpose: % Creates a figure showing model analysis under superimposed stimulus conditions, % including normalization index distribution, correlation heatmap, and tuning % simil...
35e90dc3a8dcf156f64b053d04c148475afa7045f24e3815696bbd1e2b453b3a
MATLAB
9,601
242
function [mahal_dist,cfg] = mahal_dist_xgen(dat,theta,task,cfg) % [mahal_dist,cfg] = mahal_dist_xgen(dat,theta,task,cfg) if nargin < 3 help mahal_dist_xgen error('missing input arguments!') end ntrl = size(dat,1); % number of timepoints nsens = size(dat,2); % number of M/EEG sensors nti...
6f306cd2c64b5e5a45e10e865807d8cd86e54de3d8a249074ec5bd7f2d543845
MATLAB
9,602
316
function [traj, infStates] = tapas_ehgf_jget(r, p, varargin) % Calculates the trajectories of the agent's representations under the eHGF model of the jumping % Gaussian estimation task (JGET) % % This function can be called in two ways: % % (1) tapas_ehgf_jget(r, p) % % where r is the structure generated by fit...
18aeb2708ad79362ac9ea0f1acb66410ad654b7ff25d701ebe2c1898f2f0a580
MATLAB
9,605
233
%% h = sepia_handle_panel_utility_mask_ventricle(hParent,hFig,h,position) % % Input % -------------- % hParent : parent handle of this panel % hFig : handle of the GUI % h : global structure contains all handles % position : position of this panel % % Output % -------------- % h ...
de6c876679aac8a68864752b7b5e0c9e28c93345017654962eafaa74d84fa0d2
MATLAB
9,620
321
function plotFigureS9_naiveBehSupp(processedBehaviorPath) %Plot figure S9 - raw wait time block transition dynamics for the first 15 % sessions and divisive normalization model predictions. Sigmoid fits to % z-scored % YOU MUST RUN processRawWaitTimes BEFORE RUNNING THIS FUNCTION %INPUTS: % processedBehaviorPat...
376580c38df688d46bb1c594f7ee15f33943093e1c0ca0868e0957b481560465
MATLAB
9,623
289
% EEG_PV - Compute EEG.data 'percent variance ' (pv) of the whole EEG data versus the projections % of specified components. % Can omit specified components and channels from the computation. Can draw a plot % of the scalp distribution of pv, or progressively compute the pv fo...
2bfb9f94d1fa9f5bf0e3d298ae058863a469212bd2d66afc9ad3760195c8abbf
MATLAB
9,631
308
function [exploration,sws,rem] = BrainStates(s,t,f,q,emg,varargin) %BrainStates - Determine brain state using LFP, EMG and movement. % % USAGE % % [exploration,sws,rem] = BrainStates(s,t,f,q,emg,<options>) % % s spectrogram % t time bins for spectrogram % f frequency...
41733a1187d03d1f9eed6a03e47ecfa230dd8b5c8a6d52f526a34928b1628d35
MATLAB
9,631
353
function varargout=sigstar(groups,stats,nosort) % SIGSTAR Add significance stars to bar charts, boxplots, line charts, etc, % % H = SIGSTAR(GROUPS,STATS,NSORT) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The user specifies the groups and associated p-values. The fu...
ba52b33e1a5897cd294189b1e54ce3d860aff242c7af73e7620f1f8d5a7d02c5
MATLAB
9,631
232
function [trl,dataselep] = iEEG_func_detectRipples_detector3(fsettings,data) %% ######################################################################## % [trl,dataselep] = iEEG_func_detectRipples_detector3(fsettings,data) % ######################################################################### % % Ripple detection...
65a1dbde0408ecbed1ce6e5d0119c16635fbbfafb0af6026c5af0859a1af8287
MATLAB
9,638
286
% analysis_FeaturePrediction Run feature prediction % % Author: Tomoyasu Horikawa <horikawa-t@atr.jp>, Shuntaro C. Aoki <aoki@atr.jp> % clear all; %% Initial settings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Data settings % subjectList : List of subject IDs [cell array] % dataFileList : List of ...
43a139445c2907be74a448bb629bc8b93ac3f2e11f6cc00c779561afea3374cd
MATLAB
9,641
344
%% clear; working_dir = 'G:\CEST-fMRI'; % the actual directory to put the codes SPM_modified_path = [working_dir,'\scripts\SPM_modified']; addpath(SPM_modified_path); ds_dir = [working_dir,'\datasets\exp3']; % directory of datasets saving_dir = [working_dir,'\scripts\saving\exp3']; % directory for saving resul...
935b570abde1bac7759e35371ffb0b1e1e3f87035628cc4c1324031b1a60fcae
MATLAB
9,641
171
function analyze_communication_subspace(group) close all clearvars -except group clc % Analyze communication subspace. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) switch group case 'control' load('behavior_control.mat') load('activity_control.mat') behavior ...
1f103482c0e7abdae9ad0fdebcb85dcc8b0c62776282a0c05946df8f21a8120f
MATLAB
9,644
75
function map = magma(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = inferno % map = inferno(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM02-...
c8cf1ed3d0935180311815aad23eba7b834c1ac81771efb19cb6b221b522534d
MATLAB
9,645
75
function map = magma(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = inferno % map = inferno(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM02-...
1e7d384bd36067192ce869b53156b1f9b061bf008cb573ee792bbad643fa4c90
MATLAB
9,648
289
% Cross-correlation analysis ft_defaults clearvars %% Select data files and event types %sbj1_session1 cd('Q:/MEG_data/20190724_b64d/190724/'); dataset{1,1} = 'B64D_S1P1.fif'; dataset{1,2} = 'B64D_S1P2.fif'; %sbj1_session2 cd('Q:/MEG_data/20190801_b64d/190801/'); % dataset{1,1} = 'B64D_S2P1.fif'; dataset{1,1} = 'B64...
87b82524260b8791716d0ba5978753ed2adf355ea3c5ed675ff10fe73cebdf10
MATLAB
9,648
75
function map = plasma(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = plasma % map = plasma(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM02-U...
3b0ced9798102994b591eec905d2e5a6b1d3ee8e8ffba30037457df07815d5b9
MATLAB
9,649
75
function map = plasma(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = plasma % map = plasma(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM02-U...
aabf1a1afda5ceb3b0c4bdb1cff7bf11071c117001878b43d9bef88dcb78c0e1
MATLAB
9,656
75
function map = inferno(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = inferno % map = inferno(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM0...
27165ed71bd8fe622d5ebbf43d927187d5cc0fe71c0dfaf5e74cdd96a34f5fe4
MATLAB
9,657
259
% (C) Copyright 2018 Mohamed Rezk % (C) Copyright 2020 CPP visual motion localizer developpers %% Main Decoding Experiment 2 % Adapted by Iqra for tactile stimulation % modifying trial_type data for log files % check the order of blocks - randomised in two chunks % 7 stimuli in 1 block, targets = 0,1,2 addpath(genpath...
7950d7a9ec9072561b82227b5a23b045ef278a28a6b7bacd8a9fdcd4bca6104f
MATLAB
9,657
75
function map = inferno(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = inferno % map = inferno(N) % % Colormap designed by Nathaniel J. Smith and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform colorspace CAM0...
90401546ee0aa00b3a56522d288952344658a480c3134973db245e29fd754879
MATLAB
9,659
306
%% generating script for the areas in each atlas % -> Yeo7 % -> Yeo17 % -> Destrieux (incl. laterality) % -> Mars (incl. laterality) % (c) Jiri, Aug22 %% Yeo7 Networks outDir = 'G:\shareData\visualization_normBrains\atlasAreas_MNI\yeo7'; assert(exist(outDir,'dir') == 7); cd(outDir); % load .nii file pathBeg ...
c67008cfd4c8ca48546cd87a6d24c438d0064c81e4c54da91e200b56786147be
MATLAB
9,659
268
function ellipse_t = fit_ellipse( x,y,axis_handle ) % % fit_ellipse - finds the best fit to an ellipse for the given set of points. % % Format: ellipse_t = fit_ellipse( x,y,axis_handle ) % % Input: x,y - a set of points in 2 column vectors. AT LEAST 5 points are needed ! % axis_handle - optional....
dc7490c325c865f0ad64e442d2562a6bf6a169c1e183756998bd5b3514dac497
MATLAB
9,659
157
function collected = hlp_collect_datasets(directory,varargin) % Find all loadable data sets in some directory tree and collect arbitary properties. % Collected = hlp_collect_datasets(Directory, Options...) % % In: % Directory : the directory to be searched for eeg data sets % % Options... : optional name-value...
c3a20b4c8a00a9f4c9466b6b839347eafb74b596214d509431dffd721de7dfa3
MATLAB
9,661
228
%% extract the beta parameters from ROIS %from peak coordinates or centre of individual ROIs % TACTILE MOTION LOCALIZER % across two runs clear all %% from peak cooridinates %get roi coordinates r=readtable('/Volumes/IqraMacFmri/visTac/fMRI_analysis/code/roi/coordinates4.xlsx'); % check the roi label order roiLabels =...
3406551bc3413dfc3055b9ffac84e5706aa941ab2a251a4bf83f4827e3fdbc27
MATLAB
9,662
288
function H= plot_scalpEvolutionPlusChannel(erp, mnt, clab, ival, varargin) %PLOT_SCALPEVOLUTIONPLUSCHANNEL - Display evolution of scalp topographies % %Synposis: % H= plot_scalpEvolutionPlusChannel(ERP, MNT, CLAB, IVAL, <OPTS>) % %Description: % Makes an ERP plot in the upper panel with given interval marked, % and dr...
a1168418ecdae0c1cb29e01a4279c8f2f0fa00f50cfee28a3ca2f5c0386980ed
MATLAB
9,663
204
% STD_LOADALLEEG - constructs an ALLEEG structure, given the paths and file names % of all the EEG datasets that will be loaded into the ALLEEG % structure. The EEG datasets may be loaded without their EEG.data % (see the POP_EDITOPTIONS function), so many dat...
c067cc5ed3e8d715455adf4cec542d26d0ab439cecb853efe8630c78f5ff06a1
MATLAB
9,667
362
function [ subject, data ] = nmri_autodetect_artifacts( subject, data, params ) %[ subject, data ] = nmri_autodetect_artifacts( subject, data, params ) % This function will do automated trials and channel artifact selection % similar to the vft_rejectvisual % % subject = subject structure, see nmri_read_subject ...
59f7da9b0537349ecbb3e527fe3d719417c4033c3c0b32bac9cc52603cc9dd45
MATLAB
9,668
288
function out = perc_barplot(studycount,totalstudycount,code,varnamecode,regionnames) % out = perc_barplot(studycount,totalstudycount,code,varnamecode,regionnames) % % given counts, does barplot and CHI2 analysis % easy to use with output from dbcluster_contrast_table.m % % perc : counts or percent studies to plot; r...
296b289a92dcfaaff05a85c39dd0336f74461d5504a322ae32254d3f9f8828d7
MATLAB
9,669
213
function out = NL_SSA(y, L) % NL_SSA Singular Spectrum Analysis of a time series. % % Constructs the trajectory (Hankel) matrix of the time series using a % window length L (i.e., a time-delay embedding with delay tau = 1), and % performs an uncentered singular value decomposition of the result. % % Unlike NL_EmbedPCA...
8e9d55186ca41521d3a3c43c65db8cba27fd7018280522f2599c5f4f535dc3dc
MATLAB
9,670
75
function map = viridis(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = viridis % map = viridis(N) % % Colormap designed by Eric Firing, Nathaniel J. Smith, and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform c...
d9df701401218698bbe9b73597c5b7176800df40dd7420254f088f7f4489dd05
MATLAB
9,670
273
function M = sympositivedefinitesimplexfactory(n, k) % Manifold of k product of n-by-n symmetric positive definite matrices % with the bi-invariant geometry such that the sum is the identity matrix. % % function M = sympositivedefinitesimplexfactory(n, k) % % Given X1, X2, ... Xk symmetric positive definite matrices, ...
c9d2869fa7f8cdbfaa22c62043d168db8b292cb937430d1611ce1074d97ccf4e
MATLAB
9,671
75
function map = viridis(N) % Colormap from MatPlotLib 2.0. Perceptually uniform and very attractive! % %%% Syntax: % map = viridis % map = viridis(N) % % Colormap designed by Eric Firing, Nathaniel J. Smith, and Stefan van der Walt. % % For MatPlotLib 2.0 improved colormaps were created in the perceptually % uniform c...
7f034cfae5c7ca6177049b27b4291eeb646bdd84c90d8ccaa164c4a302317e3b
MATLAB
9,672
338
%% %%%%%%%%%%%%%%%%%%%%%%% RUN ANALYZEPRF (VERY EXPENSIVE) % Matlab (matlab2b) run some parpools on: % $stone: 2 x 12 % atlas8: 16 % $surly: 16 % atlas9: 12 % $atlas10: 16 % $atlas11: 12 % surly: 12 % $atlas13: 32 % -atlas12: 2 x 32 % -atlas2: 16 % -atlas4: 16 % -atlas13: 32 % -atlas3: 12 % ~256 cores ... ...
e684d71c8a78fcd8dc242fcfc67444125ac70e63f345fb18e7b9c11507a00b0d
MATLAB
9,684
260
function PlotFigure4(datadir, codedir) %PlotFigure4 - Plots Figure 4. % INPUTS: % datadir - Local directory where ProcessData_Figure4.mat was saved after running ProcessData_Figure4 % codedir - Local directory where code (e.g., published/EstrousRPE/) was saved %% Set up paths s = pathsep; pathStr = [s, path, s]; ...
400a7fc63831afef77acea01042b3296e0dfb8b1357db1ffbd7176e2ed5b9a6d
MATLAB
9,689
182
function [MRSCont] = osp_LoadSDAT(MRSCont) %% [MRSCont] = osp_LoadSDAT(MRSCont) % This function reads raw (but coil-combined) data from Philips SDAT files. % % USAGE: % [MRSCont] = osp_LoadSDAT(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data container. % % OUTPUTS: % MRSCont = Osprey...
c5bfaa843e9dc79bc5bb7b0772aaff54f9a7bdd9dcf5ba5a7f25c4ef046ee9d4
MATLAB
9,695
374
function [V,D,bnd,j,work] = laneig(A,nin,k,sigma,options) %LANEIG Compute a few eigenvalues and eigenvectors. % LANEIG solves the eigenvalue problem A*v=lambda*v, when A is % real and symmetric using the Lanczos algorithm with partial % reorthogonalization (PRO). % % [V,D] = LANEIG(A) % [V,D] = LANEIG('...
77c50610a1c4d55ed96c3458f8a58363903cf4c765fa3ffb1105e012d9652505
MATLAB
9,696
233
%% %%%%%%%% Manually define parameters nsdsetup; %% %%%%%%%% Run FreeSurfer % install the runtime into the FS60 folder: % curl "https://surfer.nmr.mgh.harvard.edu/fswiki/MatlabRuntime?action=AttachFile&do=get&target=runtime2012bLinux.tar.gz" -o "runtime.tar.gz" % tar xvf runtime.tar.gz % prepare an expert options...
d7d1bb3bffc43f408b4f9bfe70d490fb3b2013271ba3311fbaa2b828b4a66547
MATLAB
9,697
279
function [t,p,ci,stats,dist] = permuttest2(x,y,varargin) %PERMUTTEST2 Unpaired two-sample permutation-based t-test. % T = PERMUTTEST2(X,Y) performs a two-sample permutation test based on % the t-statistic of the hypothesis that the data in X and Y come from % distributions with equal means, and returns the test ...
5a54362e949df1b8721031071f1f20a2e5ae870b768ad84bea5531a31e0a71a1
MATLAB
9,698
240
function out = SY_SlidingWindow(y, windowStat, acrossWinStat, numSeg, incMove) % SY_SlidingWindow Sliding window measures of stationarity. % % This function is based on sliding a window along the time series, measuring % some quantity in each window, and outputting some summary of this set of local % estimates of that...
9eecf67bd3ba13439a2eba7c7e22fd7cf8949b128016c9322e914b1108ff5a70
MATLAB
9,710
240
function fix_3_clean(fixlist,aggressive,domot,hp,WBC,DOvol) % fix_3_clean(fixlist,aggressive,domot,hp,WBC,[DOvol]) - CIFTI processing only (do not process volumetric data) % % fixlist is a vector of which ICA components to remove (starting at 1 not 0) % % aggressive = 0 or 1 - this controls whether cleanup is aggressiv...
68fef7b91bf53bd276ef6e5db92d572c1376c18ecbb77b5c1ed375ed5791cbc0
MATLAB
9,711
266
function [] = plotTaskComplexity(saveFigures) % Plot results from task complexity analysis. % save figures by default if nargin==0 saveFigures = true; end % get file paths paths = addPaths(); analysisName = 'task_complexity'; % load results results = load(fullfile(paths.outputs, analysisName, "task_complexity_re...
8a324bfd3cc3881eaaefb0fe4a5b954ce3257312c4dc4c3a08497afde84020ce
MATLAB
9,714
215
function c = tapas_hgf_ar1_binary_mab_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) for AR(1) processes in a % multi-armded bandit situation for binary inputs in the absence of percept...
b7a2cdda3d238082a3f3ffb60a6c8ccb8d8e93d55bf19466d5a9fc1c6fb8d2bc
MATLAB
9,715
338
function plotFigure6_naiveBeh(behaviorPath, processedBehaviorPath) %Plot figure 6 - behavior for the first 15 sessions of training % YOU MUST RUN processBehaviorData BEFORE RUNNING THIS FUNCTION %INPUTS: % behaviorPath = local path to behavior data downloaded from zenodo % savedBehaviorPath = path to where you hav...
b9b0f0a72e88d6a7e150454c978b38937263d314aa8bc3bf1bbcff2fd82183ab
MATLAB
9,718
268
% script read_database % reads a neuroimaging coordinate database with fields % and transforms T88 coordinates to MNI coordinates % When you set up your own database, several rules apply. Formatting the spreadsheet % so it loads correctly can sometimes be the hardest part of running a % meta-analysis. % % See https://c...
91025a8aeef55bf486f2b7ea17cbb5db35bad71d19bdb13a23775758c0bdd6b6
MATLAB
9,723
207
function [ output_args ] = ARTIFICIAL_CALCIUM_FLUORESCENCE_GENERATION( output_directory , id , N_units , T_durationRange , dT_durationRange , assembly_configuration_list , i_assembly_configuration , calcium_T1_2Range , eventFreqRange , eventMultRange , noiseSTDRange , saturationKRange ) %ARTIFICIAL_CALCIUM_FLUORESCENC...
c0a34bd39e0c5ba185d74f1412073cd6da1aedfb008197810369cf069caa5c93
MATLAB
9,728
250
clear all close all clc exp_root = 'C:\Users\User\Documents\fMRI_EXP\'; more_code = fullfile(exp_root, 'cells_data_muller'); data_folder = fullfile(more_code, 'wetransfer_neil-s-data_2023-09-25_1057'); addpath(genpath(more_code)); addpath(genpath(data_folder)); grid_rats = [1, 3, 4]; num_grid_rats = length(grid_rats)...
8d6d5b0f01bffb162bf6fbd59d9b5d1800e9395e59a14848e557401c8ce5bf0e
MATLAB
9,739
221
set_up_paths_and_data_directories; bold_suffix = 'space-MNI_desc-ppres_bold.nii'; tr_length = 1.3; stim_names = { 'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ... 'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ... 'Superhero', 'Tears_of_St...
5d72a5bf887241e385b1fefe149704f304bbabd3f55e96d2b00909cfbd5b936d
MATLAB
9,741
278
function [xbest, fbest, info, options] = pso(problem, x, options) % Particle swarm optimization (PSO) for derivative-free minimization. % % function [x, cost, info, options] = pso(problem) % function [x, cost, info, options] = pso(problem, x0) % function [x, cost, info, options] = pso(problem, x0, options) % function [...
20bdebce418dbe4ec5c43f2f860e0b32be71a590a0ef5ec9c0f39aded513677e
MATLAB
9,745
217
% Please cite this paper if you use any component of this software: % D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017. % Re...
827ce50eb2e0fccefbdeb89c159810a8e53c39a63d039c69aeaf39c2be36acdd
MATLAB
9,746
225
% std_getindvar - get independent variables of a STUDY % % Usage: % [indvar indvarvals] = std_getindvar(STUDY); % [indvar indvarvals] = std_getindvar(STUDY, mode, scandesign); % % Input: % STUDY - EEGLAB STUDY structure % mode - ['datinfo'|'trialinfo'|'both'] get independent variables % linked to STU...
9956352c7c0ef71d0ccf604e3fe88a881a292cfd4b624b9eb8bcc5ebfd5bb1b0
MATLAB
9,748
281
clear all, close all load fig5data figure('Resize', 'off', 'Units', 'centimeters', 'Position', [0 0 svgData.figureWidth svgData.figureHeight], ... 'PaperSize', [svgData.figureWidth svgData.figureHeight], 'PaperPosition', [0 0 svgData.figureWidth svgData.figureHeight]); population_type = 'patient'; % population...
931fe711e28b83f2456260799225c026bc2b1d12c582fdf874a77e087cbb5352
MATLAB
9,755
316
function [traj, infStates] = tapas_hgf_jget(r, p, varargin) % Calculates the trajectories of the agent's representations under the HGF model of the jumping % Gaussian estimation task (JGET) % % This function can be called in two ways: % % (1) tapas_hgf_jget(r, p) % % where r is the structure generated by fitMod...
a144cfdf29389b700fb6b54125278df89701038a14c6abbd9c3e9d15a47014c3
MATLAB
9,759
294
function [ subject ] = nmri_read_subject(subj_id,exam_id,analysis_dir,raw_dir,raw_dataset) %subject=nmri_read_subject(subj_id,exam_id,analysis_dir,raw_dir,raw_dataset) % % This function will read a MEG or EEG dataset from the % raw_dir/subj_id/exam_id directory and create the necessary directories, % links and.m file...
9d4d09c7f0eb451e78c4dac4d7a04b9c8d084ae3d5173008a3cd84cbf82cd66e
MATLAB
9,774
249
function [distMat_cl,cluster_Groupi,ord,handles] = BF_ClusterDown(distMat,varargin) % BF_ClusterDown Reduce a pairwise distance matrix into smaller clusters. % % Yields a visualization of a pairwise distance matrix, including a set of % clusters of objects showing highly correlated behavior. % %---INPUTS: % distMat,...
00b3741fb5ff74446688898e047c6a214710a1b88dcd85f080662f205e53060d
MATLAB
9,780
255
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add paths currloc=string(pwd); homeDir=("C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC"); % For inputs str='\AtlasAndOtherInputs'; addpath(strcat(homeDir,st...
ed2b30242cda953d9588f8153e0b2ea96590e778f5666de936f96ff4a49ecb0b
MATLAB
9,782
209
function [gain,shGain,predictions,er,sh,w] = GLMgain(source,target,varargin) %GLMgain - Train a GLM on your "source" data and see how well it predicts % the "target" data. This is measured as a gain improvement relative to % shuffled versions of your data. To prevent overfitting, the data is % divided into a number ...
3a758f304c9a981fd77d7a08750d429b3292927071cb032cb85fee5013f6fb0f
MATLAB
9,785
209
classdef McsCmosSpikeStream < McsHDF5.McsStream % Holds the contents of a Cmos spike stream object % % Important fields: % SpikeData - (struct) Contains fields SensorID and Timestamp. If % cutouts are present, it will also have a field % Cutout. SensorID and T...
dda937c20d5c95617466bd4dca0520588cfd4792237345e90154e770e55d0804
MATLAB
9,788
298
% COMPMAP - Plot multiple TOPOPLOT maps of ICA component topographies % Click on an individual map to view separately. % Usage: % >> compmap (winv,'eloc_file',compnos,'title',rowscols,labels,printflag) % % Inputs: % winv - Inverse weight matrix = EEG scalp maps. Each column is a % ...
089f37f5f7556316d60ba8ffc675efc4c8b69609388848e6745b4f8ea0ad8314
MATLAB
9,792
282
function [c, r, t, cpulse, acq_codes, verbose] = tapas_physio_read_physlogfiles_siemens_tics(... log_files, cardiac_modality, verbose, varargin) % reads out physiological time series of Siemens logfiles with Tics % The latest implementation of physiological logging in Siemens uses Tics, % i.e. time stamps of 2.5 ms...
0767c976abd7f0b68607e7034d1b593a9835409b6144c97e5e891ba141b683b5
MATLAB
9,795
238
function out = SP_PhaseFluctuationScaling(y, halfWidthFrac, numWindows, maxN) % SP_PhaseFluctuationScaling Multi-scale fluctuation analysis of instantaneous phase % % Isolates the dominant oscillatory component of y (the frequency band % carrying the most spectral power, excluding DC and Nyquist), takes its % instan...
25ce662d804ede95fae46180bb8c25bdc11af35590743590bb80b47c47d13911
MATLAB
9,795
236
function [msg] = printLog(Module,kk,ll,nDatasets,progressText,GUI,MRSI,LCModel) %% [MRSCont] = printLog(MRSCont) % This function allows you to rebase your derviatives folder and files in % case you have processed them on another machine % % USAGE: % MRSCont = OspreyRebase(MRSCont); % % INPUTS: % MRS...
f71ada9c53e3ce211d3538bf1df696ff8bfbc5c2e290c97fafe13a0c30ab436e
MATLAB
9,816
251
function [Wrr, Wrf] = generate_weights_default(Ne,Ni,Nx,sigmaRX,sigmaRR,Prr,Prx,P_ts,TS_th,varargin) % GENERATE_WEIGHTS_DEFAULT Recurrent & feedforward connectivity (spatial + tuning). % % Syntax % [Wrr, Wrf] = generate_weights_default(Ne,Ni,Nx,sigmaRX,sigmaRR,Prr,Prx,P_ts,TS_th, Name,Value, ...) % % Description % ...