sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f75293fdad33b2660d38c7a46790c3ecc7c4a50f0a15955e644fbc659c627b0b
MATLAB
9,064
181
% hMRI processing % % Computation of quantitative maps from acquired MPMs. The script is % based on the batch GUI of the SPM12 toolbox. To run the script, both the % hMRI and SPM12 have to be installed. The script gets the root directory % of the SPM12 toolbox from the matlab search path. All input files are % define...
0aedd8d8718131af8902b86f45ea57c0221ff48a944186a5489bab4adc2ae099
MATLAB
9,065
241
function [mainNBSPredict] = get_NBSPredictInput(NBSPredict) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % get_NBSPredictInput checks NBSPredict structure provided and set default % parameters if no provided. It also loads correlation matrices using % a directory containing correlation ma...
11827c34ea3261d984dac371cf931d880de35c05999f5ff62acb31843afee574
MATLAB
9,073
66
function map = viridis(N) % Perceptually uniform sequential colormap from MatPlotLib. % % Copyright (c) 2017-2020 Stephen Cobeldick % %%% 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...
c9e70af1f300fa22337059294dcd1c045ba66755cfb8b43643d270262a3466d8
MATLAB
9,078
220
% POP_IMPORTGROUPVAR - import a group variable from a ASCII file and % manual entry. % % Usage: % >> % % Inputs: % % Outputs: % % See also: % pop_studydesign, % % Author: Ramon Martinez-Cancino, SCCN, 2014 % % Copyright (C) 2014 Ramon Martinez-Cancino, % % This file is part of EEGLAB, see http://www.eeglab...
36a4e8056128390871329a4317c4f4e2be29a6fb2fb1c45dac61a3d8d2553456
MATLAB
9,083
274
clc; clear; addpath('/cbica/home/lihon/code/Download/cifti-matlab-master'); res_dir = '/cbica/home/lihon/comp_space_recover/ABCD_comp/dl_prediction/pred_res_cog_abcc_bl_cv/non_dl_pnc_res'; dat_dir = '/cbica/home/lihon/comp_space_recover/ABCD_comp/dl_prediction/data_cog_pnc_cv'; num_r = 400; ro_covars = 1; % 0: ba...
232537c835305c9fe69b7faecbe2ae3a1fe91614c8c903bf074242762d0c9624
MATLAB
9,084
217
function c = tapas_hgf_binary_pu_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) % for binary inputs in the *presence* of perceptual uncertainty. % % The HGF is the model introduced in ...
b360c3c6aa5c95b90dc7fb525290bd5c218540aeac748931f2532b72a014aa47
MATLAB
9,086
199
function [MRSCont] = osp_saveLCM(MRSCont) %% [MRSCont] = osp_saveLCM(MRSCont) % This function writes all MRS data loaded by OspreyLoad to separate % LCModel .RAW files. % % One .RAW file is produced for unedited MRS data % (PRESS, sLASER, etc.), four .RAW files are produced for MEGA-edited % data (A, B, su...
d2f126e3e806ac090a548e8c1ff338822180e703203d4908db9eb6ccd42b7aab
MATLAB
9,088
217
function c = tapas_ehgf_binary_pu_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) % for binary inputs in the *presence* of perceptual uncertainty. % % The HGF is the model introduced in ...
58b70fa25ec07858b50574ef6cf8ab5f58d28f264f7e91ed831a8a0261433dba
MATLAB
9,090
226
% LOC_SUBSETS - Separate channels into maximally evenly-spaced subsets. % This is achieved by exchanging channels between subsets so as to % increase the sum of average of distances within each channel subset. % Usage: % >> subset = loc_subsets(chanlocs, nchans); % select an evenl...
e76c1403dbcb523fb562f03040d83170c8ceed05df6401f11f8a38043425f9a1
MATLAB
9,099
191
%% AFM_RegionAnalysis_Mapping.m by Julia Becker, 14/10/2021 % This script combines data about analysed AFM measurements from an % experiment into a big table ('data'). It checks for several measurements % at the same x/y coordinates and only keeps one (duplicate removal). It % will also check how the actua...
cfd5462ed60b650e697d10ffbc28cffde28ab9abb2610be75012ac86028d1097
MATLAB
9,103
266
% (C) Copyright 2020 CPP visual motion localizer developpers function [cfg] = setParameters() % % Initialize the parameters and general configuration variables cfg = struct(); cfg.subject.askGrpSess = [false true];% this stops the GUI input for subject group. comment it if you want to ask for subje...
a913ab0ce0c36957f21876ab5b20bcc2c02247920759a8ba6682200377c4a96c
MATLAB
9,105
320
%% script to generate channel reductions for the EGI 257 layout %% load layouts egi=ft_prepare_layout(struct('layout','conf/layouts/GSN-HydroCel-257-layout.mat')); eeg1020=ft_prepare_layout(struct('layout','EEG1020')); eeg1010=ft_prepare_layout(struct('layout','EEG1010')); % now plot figure hold on scatter(eeg101...
5fcbb609686108f8b5f05558d61cb1a6eecf4bfe1bea1d49e09bfaeb9643e707
MATLAB
9,109
206
function [varargout] = likGaussWarp(warp, hyp, y, mu, varargin) % likGaussWarp - Warped Gaussian likelihood for regression. % The expression for the likelihood is % likGaussWarp( y | t ) = likGauss( g(y) | t ) * g'(y), % where likGauss is the Gaussian likelihood and g is the warping function. % % The hyperparamete...
d9c5f021e643c1e43f197fadf316c8e87c9dda1e8949a0402c375356bb7359e5
MATLAB
9,109
201
function [x_data,xxline] = fg_bootstrap_two_groups(fig_num,B_L,group_1_data,group_2_data,group_1_counter,group_2_counter,log_scale,frequencies,CIU,CIL,freq_lims) %Use bootstrapping for statistic of power spectra %output gives the coordinates for points of significant difference %input is figure number, the number of...
ba318047023ea92a06dfe53f69c8e11f50c16762d62a8a6a878d7d7c9c0f503f
MATLAB
9,123
200
%% ######################################################################## % demo_analysis_1_1_detect_ripples_1_f % ######################################################################### % % Main analyses on simulated data. Yields plots utilized in Fig. 1. % % -----------------------------------------------------...
d4eaf4616c87519047dc9eb44e4f818157f318b190358d22c53cc1c6e0c71026
MATLAB
9,127
243
function [Y,motion_corr] = rigid_motion_correction(data_path,varargin) % modified from NoRMCorre demo-1p % https://github.com/flatironinstitute/NoRMCorre % ZZ 2022 % applying the NoRMCorre motion correction algorithm on % 1-photon widefield imaging data % input: % data_path: folder of a pre-processed data fil...
89f27c7909249bb98cde23aeefd239f8f07e76cc4ab0e7018f220b6434c298d3
MATLAB
9,128
273
function plotFigure2_muscimol(processedMuscimolPath, behaviorPath) % Plot Figure 2. Muscimol data and inference model with lapse parameter. % YOU MUST RUN processMuscimolData BEFORE RUNNING THIS FUNCTION %INPUTS: % muscimolPath = Local path to muscimol data downloaded from Zenodo. % Folder contains the subfo...
941bfce0a7a17a61939ca72d227408aa30a8e44095361ef1959977f7a701df1a
MATLAB
9,130
242
classdef tapas_Huge %% tapas_Huge Hierarchical Unsupervised Generative Embedding % This class implements the HUGE model. HUGE stands for Hierarchical % Unsupervised Generative Embedding. It is a generative model for % (task-based) fMRI data from heterogeneous cohorts. For more details on % the theory behind the...
3f287774f4a259a9cfb7e3345585c4743231c4e043d5ba83efb145991b902091
MATLAB
9,132
267
classdef Layer < handle %LAYER Base class for a network layer in a DagNN properties (Access = public, Hidden, Transient) net layerIndex end methods function outputs = forward(obj, inputs, params) %FORWARD Forward step % OUTPUTS = FORWARD(OBJ, INPUTS, PARAMS) takes the layer object OBJ ...
60b81596d8c7794be71af05ca811e459d88e0f4d53dc93be720b2bdcd6353c5d
MATLAB
9,135
278
function plotbehav(T, depVar, outdir, pairwiseResults) if nargin<3||isempty(outdir), outdir=pwd; end if ~exist(outdir,'dir'), mkdir(outdir); end if isstring(depVar), depVar=char(depVar); end cstr = string(T.Condition); cstr(cstr=="1")="Congruent"; cstr(cstr=="2")="Incongruent"; [chosenEffect, pcol] = chooseEf...
a1823fa3ced2739cbee6ad40e1a66ef82e7e415d8d89907e362a572dbc47487f
MATLAB
9,137
224
function [Wrr,Wrf,outdegreeEE,outdegreeIE,outdegreeEI,outdegreeII,outdegreeEX,outdegreeIX,seqindX,seqindE,seqindI,presynIDE,presynIDI,presynIDX] = ... generate_weights_broad_indegree(Ne,Ni,Nx,sigmaRX,sigmaRR,Prr,Prx,P_ts,TS_th,b1,varargin) % GENERATE_WEIGHTS_BROAD_INDEGREE Connectivity with broad (Gamma-like) inde...
c837af5ae3e4fc4d0e07b317492970bfddcc1717422185f2ec4b73fe873519bb
MATLAB
9,143
267
classdef Layer < handle %LAYER Base class for a network layer in a DagNN properties (Access = {?dagnn.DagNN, ?dagnn.Layer}, Hidden, Transient) net layerIndex end methods function outputs = forward(obj, inputs, params) %FORWARD Forward step % OUTPUTS = FORWARD(OBJ, INPUTS, PARAMS) takes th...
cfb37f42230ec3a284af0f7033fef69cca4b97e9cb5555b3fcf1432ec8e63a62
MATLAB
9,161
159
%% Script to plot brain maps of cortical MIND associations. % Copyright (C) 2026 University of Seville % Written by Natalia García San Martín (ngarcia1@us.es) % This file is part of Hierarchy Longitudinal MIND Gradients Psychosis toolkit. % % Hierarchy Longitudinal MIND Gradients Psychosis toolkit is free so...
1ab43f1522dd0fcce454141744764e6d3d278a1dce0ff3a3ea24d90916b23f22
MATLAB
9,176
299
function OUT = get_contrast_indicator(DB,testfield,varargin) % OUT = get_contrast_indicator(DB,testfield,varargin) % OUT = get_contrast_indicator(DB,'Method','create') % OUT = get_contrast_indicator(DB,'valence','load',OUT) % OUT = get_contrast_indicator(DB,'valence','create',[],{'pos' 'neg'}) % OUT = get_contrast_indi...
b2d6cc9c0984fa9e6528629ffd8a1ac062c684a6cf7dfa1decc2617daa3b1f31
MATLAB
9,180
246
% ANOVA2_CELL - compute F-values in cell array using ANOVA. % % Usage: % >> [FC FR FI dfc dfr dfi] = anova2_cell( data ); % % Inputs: % data = data consisting of PAIRED arrays to be compared. The last % dimension of the data array is used to compute ANOVA. % Outputs: % FC - F-value for c...
cfd679ece888423834b64adfbe12c87b424458879c53e6454388e6dba3b35e40
MATLAB
9,184
207
function [data, settings, version] = readHD5(F) % F: Key structure or full filename including path (for example '/path/Patchfile10.h5') % % data: all variables extracted from file % settings: settings telegraphs from NPI amp % ver: file version if isstruct(F) if count(experiment.ScanBehaviorFile & F) F = f...
907a7086697cc14c5e12fe0f5f25c1a24d44e6c93e56977f7d83a09e55e5086a
MATLAB
9,185
207
function plot(segStream, cfg, varargin) % Plot the contents of a McsSegmentStream object with averages. % % function plot(segStream,cfg,varargin) % % Produces for each average object on overlay plot of the averages % % Input: % % segStream - A McsSegmentStream object % % cfg - Either em...
b826e4aefa4a6b71474a7eef649bfdcfcd94a6dae8ae6b45f60ecc6b5853a569
MATLAB
9,187
242
% sourceReconstruction_p.m % source reconstruction of preprocessed MEG data using LCMV beamformer settings.target_fs = 600; %sampling frequency settings.lcmv_reg = 0.05; settings.fres = settings.target_fs; settings.smoothcortex = 0.3; %less smoothing % epoch length settings.winlength = 2*settings.target_fs; % model or...
fedb8e41dc67a3dfa40f8eefbdc2c3d7b047a2c1ce9e6f7db47f98459a469ad7
MATLAB
9,188
176
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...
f1b26536aa7852a2f8fd91f4a0f018524a79377334054d047da1c92eeb9c5025
MATLAB
9,192
260
function [newnode,newelem,newface]=meshrefine(node,elem,varargin) % % [newnode,newelem,newface]=meshrefine(node,elem,face,opt) % % refine a tetrahedral mesh by adding new nodes or constraints % % author: Qianqian Fang, <q.fang at neu.edu> % % input parameters: % node: existing tetrahedral mesh node list % ele...
4bfce13a8f8e1835faf9ae2dcf1f1441ee3bd2d14177550c3c12a662a6e6142e
MATLAB
9,193
246
function [distmat,cfg] = mahal_iem_mds_xgen(dat,theta,task,cfg) % [distmat,cfg] = mahal_iem_mds_xgen(dat,theta,task,cfg) if nargin < 3 help mahal_iem_mds_xgen error('missing input arguments!') end ntrl = size(dat,1); % number of timepoints nsens = size(dat,2); % number of M/EEG sensors ...
bd6ebde24281ab0c8827930644d87e6db346f9489149914514cd2f1ca9b50de0
MATLAB
9,194
223
function varargout = check_logs_ui(varargin) % CHECK_LOGS_UI MATLAB code for check_logs_ui.fig % CHECK_LOGS_UI, by itself, creates a new CHECK_LOGS_UI or raises the existing % singleton*. % % H = CHECK_LOGS_UI returns the handle to a new CHECK_LOGS_UI or the handle to % the existing singleton*. % % ...
56c2e38ee6a2acbe4956c0f4330f8c3d4a00964755538887f3c80004da291c69
MATLAB
9,199
212
% pop_dipplot() - plot dipoles. % % Usage: % >> pop_dipplot( EEG ); % pop up interactive window % >> pop_dipplot( EEG, comps, 'key1', 'val1', 'key2', 'val2', ...); % % Graphic interface: % "Components" - [edit box] enter component number to plot. By % all the localized components are plotted. Comma...
6b42c2c1acadbeaf012e6c9b925fd7fd71c64800588ac631ace1a1c177d9130b
MATLAB
9,201
248
% Prepare power data for statistical analysis and plotting the results including cortical and hippocampal PSD, % and cortical region-wise Power differences between AD and control groups. resultsDir = [main_path 'Results/source/']; % Get a list of all subjects in the directory0 subjectFiles = dir(fullfile(resultsDir...
2103cecde6f94ec1cdbb6e9b19f421f2f3bd0f6ca5692f571e343ef36cdc0820
MATLAB
9,203
254
addpath(genpath(pwd)); % load data load(fullfile('data', 'doseResponseData.mat')); % define the curve type [rowTotal, colTotal, ~] = size(conc); maskPlot = SetCurveType(rowTotal, colTotal); % manually define the type of the dose-response curves % set up the fitting hillEq = @(a, b, c, x) a./(1+ exp(-b*(x-c))); ft ...
1d493a5891e0108e19796bc5578d404fd17339773e68ccab57b312ffbbfc3b79
MATLAB
9,206
220
%% 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 =...
7e816280d3b83e43a77da57033bbada5e19ea418ee8c4f95076a1a1157ebbf7e
MATLAB
9,217
212
function c = tapas_hgf_binary_pu_tbt_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) for binary inputs in the % *presence* of perceptual uncertainty with the additional twist that percep...
b22c9ef60ddc9f7576f6bc2eec9b4786165ffe4ffc87aba8c7baa3e92970fe79
MATLAB
9,217
257
function [J,Jfd,CRLB] = fit_Osprey_CRLB(dataToFit, basisSet, minKnotSpacingPPM, fitRangePPM,fitParams,refShift); j = sqrt(-1); % i nMets = basisSet.nMets; nMM = basisSet.nMM; nBasisFcts = nMets + nMM; % number of basis functions lineShape = fitParams.lineShape; ph0 = fitParams.ph0 * pi/180; %...
3d556ffd533fa72f6399acd15dbd04804d5b5961fc4997d4d3083df45bea12a5
MATLAB
9,222
238
%% fitglm_allpredictors_network.m clear; close all; clc; warning('off'); scriptName = mfilename; %% Ensure workers can see current code path (parfor safety) p = gcp('nocreate'); if isempty(p); p = parpool; end % Replicate current path on workers pctRunOnAll addpath(genpath(pwd)); %% ---- Inputs (same dialog as before...
af81405c13f5e6f67f8cc268a9bc0ad7a32a51b158c2168f73f1b14dfb708f6f
MATLAB
9,223
205
% op_preref.m % USAGE: % [refShift_ind_ini]=op_preref(in); % % DESCRIPTION: % We will use a frequency cross-correlation approach on the % Choline and Creatine singlets to generate a robust initial % frequency guess for the robust spectral registration. This is % especially useful for data with heavy frequency drift. T...
b5f109ab435f4550ce007f0d1abf0f2ffe1c54af44cc8c2ee9da44146fa40e01
MATLAB
9,225
156
% Clear all variables clear all % Initialise SPM with fMRI defaults spm('Defaults', 'fMRI'); % Initialise cfg_util configuration and set path accordingly spm_jobman('initcfg'); % Define the directory for TPM files tpm_dir = '/Users/az/Documents/MATLAB/spm12/tpm'; % Define the preprocessing directory prepro_dir...
de8be091a80e9ba5b66ef03d33f424eec78096d917d55131b58ef3be8339a494
MATLAB
9,234
205
function c = tapas_hgf_ar1_binary_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) for AR(1) processes % for binary inputs in the absence of perceptual uncertainty. % % The HGF is the mod...
ed82129e0b17308613ae0443b3fad00fa5c19c04a9405010532d3754e88cd013
MATLAB
9,241
276
function [cfg] = checkParameters(cfg) % % Check that all parameters are sets. If not it uses the defaults. % % ``cfg.design.localizer``: switching this to ``MT`` (default) or ``MT_MST`` % % - ``MT``: translational motion on the whole screen % % - alternates static and motion (left or r...
e891baa5330894c9e81aa8143f9aec19b116adb7299e79313ab4616494b1500e
MATLAB
9,242
237
%% fitglm_allpredictors_network.m clear; close all; clc; warning('off'); scriptName = mfilename; %% Ensure workers can see current code path (parfor safety) p = gcp('nocreate'); if isempty(p); p = parpool; end % Replicate current path on workers pctRunOnAll addpath(genpath(pwd)); %% ---- Inputs (same dialog as before...
05eb7006e75e3605fea2f273b078043516c07da470ed3b23a1454469ceaf3910
MATLAB
9,243
210
%*************************************************************************% %*************************************************************************% %fitTemplates: Detect spike and calculate the templates %Simplified and commented by Madeny belkhiri 30/01/18. %********************************************************...
989102370da20c079933ec38503d6b76837313f86e52c0060bd998c1ac35b8bc
MATLAB
9,245
261
function SOMResults = Meta_Multivariate(MC_Setup,DB,nSOM,nIter,varargin) % SOMResults = Meta_Multivariate(MC_Setup,DB,nSOM,nIter,[additional args]) % % Additional args: % 'mask', then mask image name % 'data', followed by data matrix % % This is a clearing-house function to run multivariate-...
ed4baea84b130f2093be9776a248614a96810f911cf0f545b2241725313f7d31
MATLAB
9,246
203
classdef McsTimeStampStream < McsHDF5.McsStream % Holds the contents of an TimeStampStream % % Fields: % TimeStamps - (1xn) cell array, each cell holding a (1 x timestamps) % vector of time stamps for each time stamp entity. % % The Info field and the other attributes provide general info...
83de92ebcde050d0a5fde0b8ffdac0ccdd57755eb03f7266fd7ef6939456439c
MATLAB
9,248
263
function SuppFigure_V1(varargin) %SUPPFIGURE_V1 Generate supplementary figure showing V1 experimental data analysis % % Purpose: % Creates a three-panel figure showing V1 experimental data including % normalization index distribution, correlation analysis, and tuning % similarity control analysis. % % Inputs: % ...
b284bda315597ff8c9c54e53d9664ebb7e405f75efea62c781343f707555a7f8
MATLAB
9,256
216
classdef StoreDB < handle_light % The StoreDB class is a handle class to manage caching in Manopt. % % To create an object, call: storedb = StoreDB(); % Alternatively, call: storedb = StoreDB(storedepth); to instruct % the database to keep at most storedepth stores in its history. % (Note that clean up only happens whe...
54bc3dd09743bfeca4a2ecbf695e877258b25f07252c2bc9da66c4c46581c83f
MATLAB
9,257
239
function this = MrDimInfo_split(this, testVariantsDimInfoSplit) % Unit test for MrDimInfo split % % Y = MrUnitTest() % run(Y, 'MrDimInfo_split') % % This is a method of class MrUnitTest. % % IN % % OUT % % EXAMPLE % MrDimInfo_split % % See also MrUnitTest % Author: Saskia Bollmann % Created: 2018-02-14 % Co...
9c4f8e28c074ac6d6a0cb6200d153bc29b444d1cab881c8ed1fbe127cc7998cd
MATLAB
9,257
225
function [data, beta, popt] = parse_data_from_mysql(S, varargin) %concatenate data over days. data.date = []; data.trainingstage = []; data.nic = []; data.catch = []; data.prob_catch = []; data.adapt_block = []; data.test_block = []; data.reward = []; data.reward_delay = []; data.block = []; data.hits = []; data.vios =...
a37973cbfd4a23f2716abffaad44a05c8a92298ca0734d46c96fa74063fac38a
MATLAB
9,257
226
% POP_READEGI - load a EGI EEG file (pop out window if no arguments). % % Usage: % >> EEG = pop_readegi; % a window pops up % >> EEG = pop_readegi( filename ); % >> EEG = pop_readegi( filename, datachunks, forceversion, fileloc); % % Inputs: % filename - EGI file name % datachunks - desi...
5de3799119a96841a9872a5c8050e58e215bf36f45bb4e0c457b52dfa81c78be
MATLAB
9,259
304
function turnDistribution = RadialMazeTurns(data,mode) %RadialMazeTurns - Compute distribution of successive turn angles in radial maze. % % In order to detect stereotypic egocentric strategies that a rat could employ to % solve a radial maze task, this function determines the distribution (over trials) % of success...
77c204fcf9bbd23225a7b6e9f4bc5e4d0e82a0a39303f29ca9844d4033785a55
MATLAB
9,264
264
clear all; close all; clc; warning('off') scriptName = mfilename; %% Ensure workers can see current code path (parfor safety) p = gcp('nocreate'); if isempty(p); p = parpool; end % Replicate current path on workers pctRunOnAll addpath(genpath(pwd)); % ---------------- I/O and paths ---------------- fullpath = mfilena...
40af601e77745154ee23da851b5d7184ea694adb6793d026b22a9a1a4a6fbd20
MATLAB
9,269
201
function data = placefields2(data,bins,method,varargin) % Take a dataset and detect whether each cell in this dataset has a place % field defined by the following criteria based on the dFoY traces. For % analysis of significance, the dF values in one bin are compared to the % distribution of dF values in the 20% bi...
43411f18e7fef334083177d8692cc7fdc0059fc23f4be66556607f9cc9bcf575
MATLAB
9,275
328
function coactPaper_figureS14() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',4,'font','Arial','fontsize',fontsize); x=15;y=7; panel_01_02(x,y,fontsize); panelLetter2(x-letGapX-3,y-letGapY+1,alphabet(1,labelCase),'fontSize',labelSize,'isB...
e4c3fbe4773b8b99349749b7fa8b5000acc51fbdb4a4d95814a12db31f165155
MATLAB
9,285
245
function [x, info, options] = stochasticgradient(problem, x, options) % Stochastic gradient (SG) minimization algorithm for Manopt. % % function [x, info, options] = stochasticgradient(problem) % function [x, info, options] = stochasticgradient(problem, x0) % function [x, info, options] = stochasticgradient(problem, x0...
3412e28e815052beb49ac3baba927ed544a10d761e585779857b0147caaf7fec
MATLAB
9,288
226
function [data, beta, popt] = parse_data_from_mysql(S, varargin) %concatenate data over days. data.date = []; data.trainingstage = []; data.nic = []; data.catch = []; data.prob_catch = []; data.adapt_block = []; data.test_block = []; data.reward = []; data.reward_delay = []; data.block = []; data.hits = []; data.vios =...
4e0300dd358f29d338d2e1546742f048f5b7b480da1d4ff65119fc75c8c7eb0f
MATLAB
9,289
227
% POP_EXPORT - export EEG dataset % % Usage: % >> com = pop_export(EEG); % a window pops up % >> com = pop_export(EEG, filename, 'key', 'val', ... ); % % Inputs: % EEG - eeglab dataset % filename - file name % % Optional inputs: % 'ica' - ['on'|'off'] export ICA activities (or ERP)...
290185562f6f4b33907909ac845ea21961ecc65caabd1bb5b52e87998310f2ce
MATLAB
9,292
188
%% [chi] = Wrapper_QSM_LSQRandHEIDI(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 t...
65dacc4fc3143ec398aa24153214003dd7ae6e95b1d7bd806d0ff960925aa818
MATLAB
9,293
270
function run_lassoglm_grid_a1(param1Name, param1Vals, param2Name, param2Vals, seeds, outdir) % RUN_LASSOGLM_GRID Sweep two parameters and seeds, run full pipeline, aggregate metrics. % Positional args: % run_lassoglm_grid_a1(param1Name, param1Vals, param2Name, param2Vals, seeds, outdir) % Example: % run_lassoglm_gri...
0775326e836b7877da2a5df2fabb311ffabf76792825c0ba9674edbd31130b2f
MATLAB
9,303
302
function ch2roi_plot_stackFreq(GRUP, groupInfo) % groups channels into defined ROIs (anatomic areas), averages & plots % FIG: % - subplots = freqBands x ROIs % - 1 subplot = 1 class imagesc of stacked FB (y-axis) x time (x-axis) x activations (c-vals) % based on the following criteria: % - selected anatomical ar...
2e57f5bf5be07c31d853ead914b0a40a876c458c0c6c3a85aeb30876c29ca905
MATLAB
9,305
183
function [status, res] = BF_TiseanSystem(tiseanCommand, timeoutSecs) % BF_TiseanSystem Run a TISEAN command-line call with a bounded timeout. % % All TISEAN-based operations shell out to a compiled binary via system(). % Verified empirically that these binaries do not always error on a bad % invocation: false_nearest...
375ed8ebf360749cffe3c2b0035760fe1979926591080a4da809141321759c3a
MATLAB
9,307
244
function [odm,clusters] = i_density_diff(XYZ,XYZ2,radius,niterations,varargin) % function [odm,clusters] = i_density_diff(XYZ,XYZ2,radius,niterations,[resume at iteration]) % % iterated density algorithm, to mask out significant areas from % density analysis and re-run on remaining points, until convergence % this is...
b71011ba5df26c87febe1dcfc509e7e0c247a10ab04b4e55ae350deffb4e1eef
MATLAB
9,307
343
function [U,S,V,bnd,j] = lansvd(varargin) %LANSVD Compute a few singular values and singular vectors. % LANSVD computes singular triplets (u,v,sigma) such that % A*u = sigma*v and A'*v = sigma*u. Only a few singular values % and singular vectors are computed using the Lanczos % bidiagonalization algorithm...
fc263f4a0eacd31fdaa172701fde80768db6fa13c9ef48d3932d91748a6b531e
MATLAB
9,310
268
function [t,p,ci,stats,dist] = permuttest(x,m,varargin) %PERMUTTEST One-sample and paired-sample permutation-based t-test. % T = PERMUTTEST(X) performs a one-sample permutation test based on the % t-statistic of the hypothesis that the data in X come from a % distribution with mean zero, and returns the test sta...
d1f35c8b15f146150fb4c0f3b538a21906501a077706a9fa83c1f262bf45691a
MATLAB
9,311
231
% POP_CROSSF - Return estimates and plots of event-related spectral coherence % % Usage: % >> pop_crossf(EEG, typeproc, num1, num2, tlimits,cycles, % 'key1',value1,'key2',value2, ... ); % Inputs: % INEEG - Input EEG dataset % typeproc - Type of processing: %...
7934fa00c7a620acbb4451c4055e6c0668a80300fd85d17628547c91ea80af6e
MATLAB
9,322
223
function c = tapas_hgf_ar1_mab_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) for AR(1) % processes in multi-armed bandit situations. The template for such % a situation is the task from...
24cfa1c11eafbaa818a521f9e32a08c7b029dcc7579d585ffe37ef8cafa16856
MATLAB
9,328
259
% Script demo_dim_info % Exemplifies creation and usage of MrDimInfo class for retrieving and % manipulating indices of multi-dimensional array % % demo_dim_info % % % See also MrDimInfo % Author: Saskia Bollmann & Lars Kasper % Created: 2016-01-23 % Copyright (C) 2016 Institute for Biomedical Engineering % ...
d52bababe5394e03da1ea27b7fbf2811c49b749b591c08c68041052e27d8513d
MATLAB
9,334
264
function [r,p,ci,stats,dist] = permucorr(x,varargin) %PERMUCORR Linear or rank permutation-based correlation. % R = PERMUCORR(X) returns a matrix containing the pairwise linear % correlation coefficients between each pair of columns in X based on % Pearson's r. For nonlinear correlations, the raw data may be % ...
9695f7ae34c11aab69f8a3142ad2e99ecc2bfe647283c43aaac38f87006da77d
MATLAB
9,345
218
function r = tapas_simModel(inputs, prc_model, prc_pvec, varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This is the main function for simulating responses (or only perceptual states) from a combination % of perceptual and observation models, given para...
ab0688dc39c0e4c1da69013ae496582c70c2d4a5c18adf2f3a364dc81299396c
MATLAB
9,348
275
%__________________________________________________________________________ % violin.m - Simple violin plot using matlab default kernel density estimation % Last update: 10/2015 %__________________________________________________________________________ % This function creates violin plots based on kernel density estim...
a8f8cba49b15ec53f97ca690172e4208107ee5ea287a6e7267a69493f103525d
MATLAB
9,349
283
% % 'overseer' function for performing & logging subtraction in a tapered % approach. % % [data,cfg]=m_do_taperedhann(data,cfg) function [data,cfg]=m_do_taperedhann(data,cfg) % this code needs some severe cleanup. % several variables are unused, and some matrices could be defined as a bit % smaller. % verbose=0;...
f892ad3b03258831165fe2b50e103ac54469b02cac9ced95f50ceb3db1587e1d
MATLAB
9,351
347
function str=struct2string(stuct_to_be_formatted) % EXAMPLE USE WITH ARGUMENTS % struct2stringstuct_to_be_formatted - use 1 % % HELP % This function takes a sturcture or an object and goes transform all the fields into strings in the recursive manner. Fields with big arrays are not processed - instead the size and a ty...
243b10cdf3b4b6d6ede8857a92b65081ed40b975fe4aba80e695e354ed586e0a
MATLAB
9,352
228
function [X, maxdot] = packing_on_the_sphere(d, n, epsilon, X0) % Return a set of points spread out on the sphere. % % function [X, maxdot] = packing_on_the_sphere(d, n, epsilon, X0) % % Using optimization on the oblique manifold, that is, the product of % spheres, this function returns a set of n points with unit norm...
3499a902458ece0a6da1910a91b3ed8719f6a59ea2fd8d8b8f1bb70801a075d4
MATLAB
9,358
200
function eps2pdf(source, dest, crop, append, gray, quality, gs_options) %EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, dest, crop...
7e53f811eea6f50e718c14ba8983f1bf78dd7014b9ba253d14753c69224c97f7
MATLAB
9,360
213
function c = tapas_ehgf_binary_pu_tbt_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the *enhanced* Hierarchical Gaussian Filter (HGF) for binary inputs in the % *presence* of perceptual uncertainty with the additional twist...
764a4c9b05ba9633fb19060b6701c207225a07d1abfb7e019ab0bab05983c714
MATLAB
9,363
239
% POP_IMPORTERPLAB - import ERPLAB event list file and bin file into % EEGLAB event structure for use in STUDY processing % % Usage: % >> OUTEEG = pop_sample( INEEG, file1, file2); % % Inputs: % INEEG - input EEG dataset % file1 - ERPLAB event list text file % file2 - ERPLAB bin file...
26d80d88141575ce5e1865195fb4bf77f630820f9dc7d4968199aa82dfc25a4d
MATLAB
9,367
206
function [realignedImage, realignmentParameters] = realign(this, varargin) % Realigns n-dimensional image according to representative derived 4D image(s), % and applies resulting realignment parameters to respective subsets of the % n-d image % % Y = MrImage() % rY = Y.realign('representationIndexArray', representa...
88054e148e64860bebf4a5d64c90bca9e71dab6e130e854444c83bbb79463640
MATLAB
9,368
271
clear all close all clc % Calculates subspace generalization between simulated voxels. % Each voxel is an average over simulated grid cells. Cells are sampled % randomly. This script examine the signal as a function of the numer of % voxels per module. % noise is added to the voxels' activity map. global cells_in_vox...
7932e2d548db90fc82cd4e4fc536d284410c7706c397f8fd7eb142750d403da2
MATLAB
9,371
166
function AFI_OptimizeSmoothing(MyelinInput, AFIVolume, TRone, TRtwo, TargFlipAngle, LeftPial, LeftMidthick, LeftWhite, RightPial, RightMidthick, RightWhite, SmoothLower, SmoothUpper, LeftVolROI, RightVolROI, GroupCorrected, Output) %take all numbers as strings, for unified compiled/interpreted handling TRo...
59aea262312b9a194472c4544266093b578557d08a8669b844e77b419d4eb180
MATLAB
9,372
254
%% cell_selectivity_and_population_plots.m %NOTE THIS IS USED TO AUTOMATICALLY SELECTING PHENOTYPE SPECIFIC NEURONS, %EXCLUSIVE FROM OTHER PHENOTYPES % Reads: % Calcium.xlsx -> rows = timepoints (~3000 for 10 min @ 5Hz), cols = cells % Behavior.xlsx -> 6 sheets, each sheet = [start, stop] times in seconds...
bb9e97bb4580ef5665dab3116b4861a9228414aac14e486630f4b6646f674ac1
MATLAB
9,380
222
% Copyright 2025 Laura Schmid % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the % “Software”), to deal in the Software without restriction, including % without limitation the rights to use, copy, modify, merge, publish, % distribut...
55a4783a383c3dda3cc9a62d9321d3235427ebbb3e083d6a4fa6a5f210e4aa37
MATLAB
9,382
301
function Fig4Sup1_DecoyTitrations(varargin) % Fig4Sup1_DecoyTitrations % Plots EC50 dose-response curves for GABA and various decoy ligands. % Reads XLS/CSV files from current directory, fits 4-parameter sigmoid, % and saves figure + EC50 table. % % USAGE: % Fig4Sup1_DecoyTitrations() % process all XLS/CSV fil...
2a8ea05605bdf5b90227aa38d854a7781a2c83141ca931fc6e9e2a2985e12599
MATLAB
9,386
258
function [celldata] = plot_2E(all_unitinfo, all_ps, all_etas, all_etas_imperm_boot, all_etas_qperm_boot, level) % plot_2E Generate boxplot visualization of partial eta squared values % % plot_2E creates a figure displaying the distribution of partial eta squared % values across different effect types (stimulus, contex...
7a873611ced0c9c36c1e63e740b957fa4ddd414ee54347d761c1bc81995b2570
MATLAB
9,393
285
% ########## This function is deprecated. Use eegmovie instead. ########## % % HEADMOVIE - Record a Matlab movie of scalp data. % Use SEEMOVIE to display the movie. % % Usage: >> [Movie,Colormap] = headmovie(data,elec_loc,spline_file); % >> [Movie,Colormap,minc,maxc] = headmovie(data,elec_loc,sp...
a42eba1b1764036465a967a4f7eb76d02c7dd48f166b2d103fb79a32afa4bc85
MATLAB
9,396
246
function varargout = run_oopsi(F,V,P) % this function runs our various oopsi filters, saves the results, and % plots the inferred spike trains. make sure that fast-oopsi and % smc-oopsi repository are in your path if you intend to use them. % % to use the code, simply provide F, a vector of fluorescence observations, ...
d3ede634092a4b252f979929948f5fe2451ca4e17bbe7a9b3bb1de038b4d9302
MATLAB
9,398
230
function [K,dK,D2] = covMaha(mode, par, k, dk, hyp, x, z) % COVMAHA Mahalanobis distance-based covariance function. % % Report number of hyperparameters % s = COVMAHA (mode) % s = COVMAHA (mode, par) % s = COVMAHA (mode, par, k) % s = COVMAHA (mode, par, k, dk) % s = COVMAHA (mode, par, k, dk, hyp) % % E...
5cfde84845576e9915215da21ee036c554aa1dbd1154d5eaac683b1629cf25e4
MATLAB
9,399
295
function [f,G,H,evidence,penalty,f_offset] = nll_poiss(st,c,stim,ops,trial_id) %calcs neg. log-likelihood and gradient, hessian %for glm with parametrized spike history filter and multiple filtered stimuli % % %Inputs: %st: either i) [nt,ns] matrix of spike times, nt=# time points,ns=# samples % or ii) [nt x ns,...
5368fd95acb4e2423c5593b0ec5e231d8fb098159925a6267fdaf2389bdb55bb
MATLAB
9,400
217
% function poolSubjects_brain3D_activity(params, groupInfo) % plots 3D brain & activations (ERP + freq.band + spectra) % pools together subject processed by a given job % settings (subjects, directory names, ...) are stored in 'params' % (c) Jiri, Apr18 disp('Plotting channels: 3D brain & activations ...'); %% came...
215e5ffbfa1a71d87b7983472df19b6a77adca0f4e0cd2faeb6933a3b40e63ad
MATLAB
9,408
257
function [varargout] = gen_synthData(varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % gen_synthData generates synthetic network data and embed contrast of % interest in a given number of edges. Using this function scale-free, % small-world and random networks can be generated. It ...
8104fb1083573b476b4b54fb4fdc877669b0df21c1cdbbb7e29eda18874339de
MATLAB
9,422
252
clear all close all clc % Calculates subspace generalization between simulated voxels. % Each voxel is an average over simulated grid cells. Fraction of cells are selected % according to their phase such that grid cells with closer phases are averaged within the same voxels % and fraction that is selected randomly. % ...
ee6661ef634309fdd7987112860bb5c119463444a7c404f724797052ab22e63f
MATLAB
9,426
267
% TESTICA - Test the RUNICA function's ability to separate synthetic sources. % Use the input variables to estimate the (best) decomposition accuracy % for a given data set size. % Usage: % >> testica(channels,frames); % No return variable -> plot results % >> [testresult] = test...
80234dabf8ab2062537b555d7f3852f42ea1de4edc35c95110acad5c19774d5a
MATLAB
9,430
305
function ht = plotsign2 (h,s,Opt); % ht = plotsign2 (h,s,[Opt]); % h is the figure handle, if you need to specify a subplot within the figure % pass the figure handle and the subplot number in h, like: [1 213] % or [1 2 1 3] % s is the text string, if s is not supplied, a default string is used % the default i...
6f32140a4cc7f765c1ab92b6d20158268689468ff6feed7c8fff2fcc4c414b9b
MATLAB
9,435
220
%specify clusters to load clear inx Cluster1 = 3; Cluster2 = 19; % inx1 = find(rez.st(:,end)==Cluster1); inx1 = inx1(inxT1); % inx2 = find(rez.st(:,end)==Cluster1); inx2 = inx2(inxTO1); % inx{1} = inx1; % inx{2} = inx2; inx1 = find(rez.st(:,4) >= 0); inx2 = find(rez.st(:,4) >= 0); inx{1} = intersect(find(rez.st(:,e...
ca0ecb1b1c643b422910000993cf60214eb19f4f9d079ad9a6cb3900c540c5d2
MATLAB
9,435
206
% fit_Osprey.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [fitParams] = fit_Osprey(dataToFit, resBasisSet, fitOpts); % % DESCRIPTION: % This is the function describing the Osprey fitting model, which is % performed with the resampled basis set resBasisSet on the data contained % in the FID-A data...
9dcfeda871798732f9fa398ae75691ed532fc6560e05292c2706372ae9981461
MATLAB
9,443
233
% POP_READLOCS - load channel location file (pop up an interactive window % if no arguments). % % Usage: % >> chanlocs = pop_readlocs; % a window pops up % >> chanlocs = pop_readlocs( filename, 'key', val, ...); % no window % % Inputs: % filename - Electrode loc...
f39d7b88e88a832782cff7e96aea13f15fcb5d62c9c12df9c4bc864cbad2afe1
MATLAB
9,443
200
% STD_FILECHECK - Check if ERSP or SPEC file contain specific parameters. % This file must contain a Matlab structure with a field % named 'parameter'. The content of this field will be % compared to the 'params' input. If they are identical % the out...
109efd3346491ae93ff271726c25f51d337d0d644c40e293689a9009a07349b3
MATLAB
9,450
258
% BIOSIG2EEGLAB - convert BIOSIG structure to EEGLAB structure % % Usage: % >> OUTEEG = pop_biosig2eeglab(hdr, data, interval); % % Inputs: % hdr - BIOSIG header % data - BIOSIG data array % % Optional input: % interval - BIOSIG does not remove event which are outside of % the data range when im...
315abc7bd150689047c2ffcef6080b4f60f48d0429519bc9a2e2500b2ca359b8
MATLAB
9,451
213
% POP_ENVTOPO - Plot envelope of an averaged EEG epoch, plus scalp maps % of specified or largest contributing components referenced % to their time point of maximum variance in the epoch or specified % sub-epoch. Calls ENVTOPO. When nargin < 3, a query window % ...