sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1c69b950ca469ba0a1164b3aca3e27d313f17609fe9b05d80651f56f6c574bd2
MATLAB
7,330
212
function [data] = fixdimord(data) % FIXDIMORD ensures consistency between the dimord string and the axes % that describe the data dimensions. The main purpose of this function % is to ensure backward compatibility of all functions with data that has % been processed by older FieldTrip versions. % % Use as % [data] =...
dc7e5a1e798ca17a4f49fce0619d5984c638ee80eefcc58d846dae63e190fa05
MATLAB
7,332
189
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(DATAMATRIX, CATEGORYNAMES) plots violins for each % ...
67d6c2e9d91b76a18ac2de4359a4897def5cd69aee9cc66e6bed068d612938d3
MATLAB
7,334
182
% GLM analysis % % This script computes a fixed-effects GLM for one or multiple runs within % one session. The script is designed for paradigms with 2-4 experimental % conditions. However, for more than 2 conditions, not all contrasts are % computed:) Stimulus parameters are read from a spm12 compatible *.mat % fil...
66a378d4a67ca508de2c256971e92816604d7e4a18876528da5afc142c770483
MATLAB
7,335
162
function h = plot_brain3D_patch(plotInfo) % plots semi-transparent 3D brain model into existing axes % plots colorcoded channels as circles % highlights selected brain areas % (c) Jiri, Apr17, Nov18 % based on previous function brain3D_model.m if ~isfield(plotInfo, 'visible_axis'), plotInfo.visible_axis = true; end i...
86483a7a569e2cdeaaf357e9482aa644d1ae7f62dec92ca281f1475284028529
MATLAB
7,336
66
function map = cividis(N) % Perceptually uniform sequential colormap from MatPlotLib. Designed for colorblind. % % Copyright (c) 2017-2020 Stephen Cobeldick % %%% Syntax: % map = cividis % map = cividis(N) % % Colormap designed by Jamie R. Nuñez, Christopher R. Anderton, Ryan S. Renslow. % % Developed with considerat...
b6f6c41408fba9d747d2d048204f3a8060ca39b32b051c65a94da89d64438d12
MATLAB
7,336
169
% STD_CUSTOM - Returns custom measure for a dataset. % % Usage: % >> [spec freqs] = std_custom(EEG, func, 'key', 'val', ...); % % Inputs: % EEG - a loaded epoched EEG dataset structure % func - a function handle that takes a data array as input % % Optional inputs: % 'components' - [numeric vector]...
e382e4b7b73a3e6c0d434af6b355d00debf978cb8ab9c73067d653e1b5cc70da
MATLAB
7,337
192
function overwriteFlag = overwritePrompt(userOptions, promptOptions) % % overwritePrompt is a function which prompts the user, either at the command % line or (when it's implemented) via a GUI dialogue box. The user will be % notified if they are liable to overwrite pre-existing data and will be given % the options to...
aad481bbf28b3a96c0e13b0dc393655c0b9a72039abe20dd2a083c241494e9d3
MATLAB
7,338
103
function outstr = GE_dumpSeriesHeader(series) % % outstr = GE_dumpSeriesHeader(series) % % Writes the series header to strimg the outstr % % Souheil Inati % Dartmouth College % May 2000 % souheil.inati@dartmouth.edu % outstr = sprintf('se_suid: %s\n' , char(series.se_suid)); outstr = strcat(outstr, sprintf('se_...
2d0ad7c505eebff370487904e266f6b5500746d7daeca62d5aadde4688fffc88
MATLAB
7,340
257
function M = spherefactory(n, m, gpuflag) % Returns a manifold struct to optimize over unit-norm vectors or matrices. % % function M = spherefactory(n) % function M = spherefactory(n, m) % function M = spherefactory(n, m, gpuflag) % % Manifold of n-by-m real matrices of unit Frobenius norm. % By default, m = 1, which c...
2c9cb50c194060783047dc0a5377f154f88aa9c1d3c86c2af2f11a1474154e69
MATLAB
7,358
230
function coactPaper_figureS03() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',9,'font','Arial','fontsize',fontsize); x=14;y=6; panel_01(x,y,fontsize); print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/figS03_%s.pdf',datestr(now,'yyyym...
761ed5f0f0db31cf9aca1e48cfe8dea9556bc71dc6951393aabee034eb8f7105
MATLAB
7,358
191
function y_embed = BF_Embed(y,tau,m,justGiveMeParams,randomSeed,beVocal) % BF_Embed Time-delay embedding % % Returns a time-delay embedding of the input time series into an m dimensional % space at a time delay tau. % %---INPUTS: % y, univariate scalar time series % % tau, time-delay. Can be a string, 'ac', 'mi', ... ...
f0e7ecaf1523c8363a89bdb36b4397c400ba23f488053b331303a689e651b589
MATLAB
7,366
238
function [] = Figure5(datadir, codedir) %Figure5 - Value computations for motivation do not depend on state % uncertainty % 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 ...
da051e0329eccd943635d785b17915d0f26cf759d61c50360671008bb01b11aa
MATLAB
7,368
163
function [valueMean, slopeMean, interceptMean, fullProbeSubj, subj, useNum] = plotStability(expInfoAll,subjectsToInspect,probeInfo,colAni,fullProbeScan,varType,paramplt) switch varType case 'count' qm = expInfoAll.unitCount'; yRng = [1 4000]; funcProbe = @sum; ...
a139d0832be2f2526b3008b8c9c368a5d9a485e33a4cec99a0e29124fc1703e2
MATLAB
7,376
181
% [p, observeddifference, effectsize] = permutationTest(sample1, sample2, permutations [, varargin]) % % Permutation test (aka randomisation test), testing for a difference % in means between two samples. % % In: % sample1 - vector of measurements from one (experimental) sample % sample2 - vect...
4870a97860781ec8c7111cfb722d1e873f782d3359eb3cfd1aa0080e3cd5390f
MATLAB
7,379
241
function [ subject ] = nmri_regenerate_cleaned(subject, workmode, backup, params) %[ subject ] = nmri_regenerate_cleaned(subject, workmode, backup, params) % % This function will re-generate the cleaned dataset with the information % stored in the backup struct % if this is not passed to the function, will try to loc...
0c922d7696bfefe904a2e7a08680be6732027ba388d07cd7a454263f8c8c9825
MATLAB
7,381
179
function varargout = tapas_physio_report_contrasts(varargin) % This function reports all relevant F-contrast-maps for physIO-created regressors % in a given GLM % % - Section plots on an anatomical overlay are created and saved as % post-script file with one page for each contrasts % % - Input parameters are speci...
10b21d53ce6eb1b61fa9b3ebde86f3fe2989f872f4b9311d534f9238bdc570d9
MATLAB
7,382
164
%% h = sepia_handle_panel_unwrap_optimum_weights(hParent,h,position) % % Input % -------------- % hParent : parent handle of this panel % h : global structure contains all handles % position : position of this panel % % Output % -------------- % h : global structure contains all new a...
52006667129d7828f942d731db63e648b6f7d5466301b7729cec508b3644e0c5
MATLAB
7,383
200
function [mri, seg, hdr] = read_asa_mri(fn) % READ_ASA_MRI reads an ASA format MRI file % % Use as % [mri, seg, hdr] = read_asa_mri(filename) % % The raw image data is returned, together with the position of the % external head markers in raw image coordinates. % % In the ASA default PAN (pre-auricular/nasion) coord...
439f3595e197dc0a1c9561340b6d1429aec8fbe66b561cb00b41fd7ea9c30835
MATLAB
7,386
198
function [cmd,cmd2]=surfing_suma_talairach(sumadirs,trgdir,varargin) % Transform surfaces and volumes to Talairach space and average them % % SURFING_SUMA_TALAIRACH(SUMADIRS,TRGDIR,...) % % INPUTS: % SUMADIRS cell with directories created by SUMA % TRGDIR directory where to store averaged results % ... ...
2b06a24585cf53bd5d7cb5d6a336a303f473b78b8c1b2c28e825564b3d103c30
MATLAB
7,387
203
function [J,h,func_evals,E,S,D]=jacobianext(func,x,varargin) % JACOBIAN CALCULATION AS A ROMBERG EXTRAPOLATION % % evaluates the jacobian of a function func at point x using romberg % extrapolation. It respects bounds. Further, the step size, no of % evaluations, an estimate of the error size and n...
d842298750667d8be6b14efa1f32431712fb6ecfa7221be232f6b6317c0e8d1a
MATLAB
7,388
287
function optim = tapas_quasinewton_optim(f, init, varargin) % This function implements the quasi-Newton minimization algorithm % introduced by Broyden, Fletcher, Goldfarb, and Shanno (BFGS). % % INPUT: % f Function handle of the function to be optimised % init The point at which to initialize...
2a164f17657411818d56631cd56ef4922d6744bdc5762c46c7f93b96e0e46a1e
MATLAB
7,389
212
function create_onset_files(subj_id, session, mod_name, do_plot) % _ % Create "names, onsets, durations" files for first-level fMRI analysis % FORMAT create_onset_files(subj_id, session, mod_name, do_plot) % % subj_id - a string, subject ID (e.g. "EDY7") % session - a string, session name (e.g. "visual") % ...
0a6ade5c25cdf00ae1822ddba6eac5db8e47b7e1139d51455722d1f43c059763
MATLAB
7,390
232
function [err,ITout,ColMapout] = ScaleToMap (ITvect,ColMap,Opt) % % [err,Mout,ColMapout] = ScaleToMap (M,ColMap,Opt) % %Purpose: % This function scales a matrix (or vector) to make it fit a % colormap. It was originally deisgned to represent functional % data onto 3D and 2D meshes, but it works for a lot of oth...
dc4d254d30f5ef3f3ec5c742bd774c90c4ee48c3ea47b82ef44d8e516c804a9e
MATLAB
7,399
181
function shuffle_icaReacCCG_REMdur(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(fullfile(rootPath,'data',[sesName '.sessions.ev...
7ff7fdd18d008c35aa531063ccff86df5e334f4f68ad80ab0ef57ba6e6fbdc4e
MATLAB
7,404
167
%% jobTesting.m % This function is a jobTesting.m file . % % A valid Osprey job contains four distinct classes of items: % 1. basic information on the MRS sequence used % 2. several settings for data handling and modeling % 3. a list of MRS (and, optionally, structural imaging) data files % ...
f114f7b22c9034ed54bdce968368400a9824d51e9430325fe30bca47777752e0
MATLAB
7,406
209
function [cpulse, verbose] = tapas_physio_findpeaks_template_xcorr(... c, pulseCleanedTemplate, cpulseSecondGuess, averageHeartRateInSamples, ... verbose, varargin) % Finds peaks of a time series via pre-determined template via maxima of % matlab cross correlations (xcorr) via going backward from search startin...
66130930a9aa0f5f2d4fc4a3522c40304b00da4b962258e78d535df0b62bb44e
MATLAB
7,408
193
% STD_LIMODESIGN - create LIMO design matrices for categorical and % continuous variables. % % Usage: % >> [catMat,contMat,description] = std_limosavedesignfiles(factors, trialinfo) % >> [catMat,contMat,description] = std_limosavedesignfiles(factors, trialinfo, 'key', val) % % Inputs: % factor...
de1dc719d47e324d8b892ac792ffba2dbdd00206f27d270aeed9438a59b589e1
MATLAB
7,408
142
%% Load data data_path ='Y:\Alice\0012_NeuroGI\NeuroGI_ephys_data\2024-11_all_ex-vivo_experiments\20241115_ExVivo-08\'; load([data_path 'EV_08_dmap_02_dist.mat'], 'EV08dmap02') load([data_path 'datafile0017.mat'], 'data') %% Preproces data reorder = (1:32:128)' + (0:31); reorder = reorder(:); yr = resa...
d0b7434f6d332c1b2f93a4cd48c2e6d3d6b2823601f4bf8bbd51781ec3ec4425
MATLAB
7,412
273
% Single-Step QSM with a Total Variation regularization with spatially variable fidelity and regularization weights. % This uses ADMM to solve the functional. % % Last modified by Carlos Milovic in 2017.06.09 % bug fix: line 165 (KC, 2 March 2020) % function out = WH_nlTV_4sepia(params) % % input: params - structure wi...
82f43020003bf8d4848b431f149d5d97c30426b694b6a4b7e65ce99271c3ee48
MATLAB
7,413
248
function [err, ErrMessage, Rules] = HEAD_Rules (FieldNames) % % [err, ErrMessage, Rules] = HEAD_Rules (FieldNames) % %Purpose: % Retrieve the rules for the different fields in AFNI % % %Input Parameters: % FieldNames is a ~ delirited list of N field names % % %Output Parameters: % err : 0 No Problem % : 1...
0332e3ef69bab156d4286436321131e6eac6ae87b0d1851c29812ff608c7a63b
MATLAB
7,414
211
function [C2,cfg] = mahal_iem_trialwise_xtime(dat,theta,cfg) % [C2,cfg] = mahal_iem_trialwise_xtime(dat,theta,cfg) % authors: M Stokes, E Spaak, N Myers if nargin < 2 help mahal_iem_trialwise_xtime error('missing input arguments!') end ntrl = size(dat,1); % number of timepoints nsens ...
79cbccb1c2a8d54f5666d17f092536fb3c2647490cdb712275b9941f16302ed3
MATLAB
7,415
213
function SyntaxAnalysis_Callback(hObject, eventdata, handles) [filename, filepath] = uigetfile({'*.mat;*.xlsx'},'Select Detection Files OR Exported Detections','MultiSelect', 'on',char(handles.data.settings.detectionfolder)); if isnumeric(filename); return; end filename = cellstr(filename); settings = inputdlg({'Max...
5ddf9acac5276f4287521cfb527bd8cc9118f3599f82742c6e8e3cefe004faf2
MATLAB
7,417
238
function fear_spkModulationShBase(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; % basename='~/data/Fear/triple/oberon200325/oberon200325'; %% load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) %% param....
87622560e33ac1fd327b9f450115c73cc42ff5ad9b4d3cdce263cdd54f78cd2d
MATLAB
7,418
205
%This simulator matches the benchmarking aim: you know the ground-truth directed matrix A, % you pass Z and rate_smooth through your pairwise/multi-predictor % linear models (with/without L1), and you score recovery (AUPRC/ROC, % weight correlation, SHD). % Get the current script name scriptName = mfilename('fullpa...
307476c15c7517f6f4f4b0c7f2ecbb906722f67c05880bfd0f73c695a3bc5511
MATLAB
7,420
208
function varargout = bucn_txt(filename, hdr, begsample, endsample, chanindx) % BUCN_TXT reads the txt files produced by the UCL-Birkbeck NIRS machines, also known % as the NTS fNIRS system from Gowerlabs. See https://www.gowerlabs.co.uk/nts % % Use as % hdr = bucn_txt(filename); % dat = bucn_txt(filename, hdr, beg...
9ffc7aa4623f128acc197050ab09389b74d85423deb3749e27609762835c6030
MATLAB
7,424
145
function [signal,removed_channels] = clean_channels_nolocs(signal,min_corr,ignored_quantile,window_len,max_broken_time,linenoise_aware) % Remove channels with abnormal data from a continuous data set. % Signal = clean_channels_nolocs(Signal,MinCorrelation,IgnoredQuantile,WindowLength,MaxBrokenTime,LineNoiseAware) % % T...
427def94edbd1878b6732e8ee20f41cbd13172fd88212e54119465ceaacb90cd
MATLAB
7,427
214
function run_permuttest2_examples %RUN_PERMUTTEST2_EXAMPLES Run two-sample permutation t-test examples. % Generates random multivariate data for 2 "independent" samples X and Y. % Each sample has 20 variables, each with a mean value of 0, except for % the first 10 variables of Y which have a mean value of -1. Ea...
50a9153208b49c3cdb70d8ea459720b3931d0a680b759cca9b524d66b45a207e
MATLAB
7,428
192
function settings = sd_config_settings(todo, varargin) % SD_CONFIG_SETTINGS Initializes empty settings variable or fills one with defaults % % DESCRIPTION % This function initializes or completes the settings variable that is used % by the sd_display function to visualize NIfTI images. % % SYNTAX % settings = sd_config...
05013021d3840acc456ecb3e04b6ed5fe8e1f78878826c40b99f9ccf5aee445e
MATLAB
7,431
206
% ANOVA2RM_CELL - compute F-values in cell array using repeated measure % ANOVA. % % Usage: % >> [FC FR FI dfc dfr dfi] = anova2rm_cell( data ); % % Inputs: % data = data consisting of PAIRED arrays to be compared. The last % dimension of the data array is used to compute A...
35e685d382f4840e6a48ccec358e81260ea17168ffcaecf171d95a9cfa70421b
MATLAB
7,431
158
%% h = sepia_handle_panel_TotalField_ROMEO(hParent,h,position) % % Input % -------------- % hParent : parent handle of this panel % h : global structure contains all handles % position : position of this panel % % Output % -------------- % h : global structure contains all new and oth...
89d20110899e000191b08a258f22e27c1ff06e2b0e961fb1ff65008b411a9160
MATLAB
7,438
235
function [y,lambda,idx_struct,XK] = simulateGLM(c,stim,ops,trial_id) %generate synthetic data from a glm model % %This is basically the core code from the gradient that calculates lambda %but the spike times are kept in real time to capture the correct spike %history filter response %how many time-dependent covariate...
a1606a8d19c47ae2e193d4b071995ce89a27ce91eef15fd9cbd8e78aa21de696
MATLAB
7,438
161
% (C) Copyright 2019 bidspm developers %% analyze decoding experiments/runs clear; clc; bidspmDir=fullfile(fileparts(mfilename('fullpath')),'..', 'lib','bidspm'); addpath(fullfile(fileparts(mfilename('fullpath')),'..', 'lib','bidspm')) bidspm(); bids_dir = fullfile(fileparts(mfilename('fullpath')),'..', '..','input...
169685064fcbd0068aac72a467eefc7a52b6858cc3b6b6f4df47b46678b36117
MATLAB
7,439
233
function hfig = tightfig(hfig) % tightfig: Alters a figure so that it has the minimum size necessary to % enclose all axes in the figure without excess space around them. % % Note that tightfig will expand the figure to completely encompass all % axes if necessary. If any 3D axes are present which have been zoomed, % ...
c3dc1f64225c4552ae51e6685f7142a641b2c13803e8c781cb6d9087bd65c203
MATLAB
7,442
179
% eeg_compare - compare EEG structures. Differences are shown on the command % line. % Usage: % eeg_compare(EEG1, EEG2); % % Input: % EEG1 - first EEGLAB structure % EEG2 - second EEGLAB structure % % Author: Arnaud Delorme, 2020 % % See also: EEGLAB, EEGPLOT, POP_REJEPOCH % Copyright (C) 2020 Arnaud...
e1b53532c4b4b0fdbfed44949a6833d92ab60f685cc00c3f0182072594c571d3
MATLAB
7,443
231
%% Figure 3 Neuropixels % A schematic % B waveforms % C rasters % load your cells and full OFC. % these take a while to load and might crash computers datpath = 'C:\Users\mld9131\Documents\GitHub\Papers\MLD\Figure2\Data'; load(fullfile(datpath,'OFC-CPi_projection_neurons_non-Stimulated.mat')); load(fullfile(datp...
0f02f47246d0a4818327c3bee60854cedcedd8a1fc34b3974e221a4125e7da7f
MATLAB
7,445
198
function [cmd,cmd2]=surfing_suma_talairach(sumadirs,trgdir,varargin) % Transform surfaces and volumes to Talairach space and average them % % SURFING_SUMA_TALAIRACH(SUMADIRS,TRGDIR,...) % % INPUTS: % SUMADIRS cell with directories created by SUMA % TRGDIR directory where to store averaged results % ... ...
6240a472590d2a042034475a27f9c008f580f6fb835c335da74232737dfb7133
MATLAB
7,445
218
function [y,lambda,idx_struct,lambda_var] = simulateGLM_logNormal(c,c_cov,stim,ops,trial_id) %generates synthetic data from a glm, but from lognormal dist %output mean as from a log-normal distribution % %This is basically the core code from the gradient that calculates lambda %but the spike times are kept in real time...
b4bb1c3e444b41509de3024d2cbb654385452b742e3fef4bf704a82436383618
MATLAB
7,447
252
function M = obliquefactory(n, m, transposed) % Returns a manifold struct to optimize over matrices w/ unit-norm columns. % % function M = obliquefactory(n, m) % function M = obliquefactory(n, m, transposed) % % Oblique manifold: deals with matrices of size n x m such that each column % has unit 2-norm, i.e., is a poin...
9e17519e9bd8cc27298bbf0d6150b6cae1599eedf67478d6d3bca0e0ae3984d8
MATLAB
7,450
261
function [traj, infStates] = tapas_hgf_ar1(r, p, varargin) % Calculates the trajectories of the agent's representations under the HGF % % This function can be called in two ways: % % (1) tapas_hgf_ar1(r, p) % % where r is the structure generated by tapas_fitModel and p is the parameter vector in native space; %...
357cf97d9424d16543bc4558b1fab9ea7882ab6a23db49c92063e70b2cf20b95
MATLAB
7,451
192
function step4_aggregate_and_plot_zScore(metricNames, Nlist, saveFigs) % AGGREGATE_AND_PLOT_ZSCORE Build aggregated_metrics.csv from simulations2/results/zScore % and plot metrics vs sparsity grouped by snr_db and N. if nargin<1 || isempty(metricNames), metricNames = {'auprc_pos','F1_at_match'}; end if nargin<2 || is...
9c8c5a3e46338ef8b93fb3cb8ce197e614696e5b2e131148574ce066e6a3467e
MATLAB
7,451
276
function DB = Meta_tables_of_variables(DB) % Constructs some tables for each variable, saved in DB.TABLES, so that we can easily see the levels and numbers of points & contrasts for each variable % % DB = Meta_tables_of_variables(DB) % % - Must run Meta_Setup.m first % - Assumes each study has one and only one unique t...
119ff6b2cba2bcb9e140dad6901ccfe71c6933f831fbfa4897215e5272186879
MATLAB
7,460
238
function savesurfpoly(v,f,holelist,regionlist,p0,p1,fname,forcebox) % % savesurfpoly(v,f,holelist,regionlist,p0,p1,fname) % % save a set of surfaces into poly format (for tetgen) % % author: Qianqian Fang, <q.fang at neu.edu> % date: 2007/11/21 % % input: % v: input, surface node list, dimension (nn,3) % i...
78f7610bc0e17eadfafb9f5020eb53f9476c111a92171383c2ca3a668255e2b2
MATLAB
7,461
211
% ADVDIFF_TASCDMD Benchmark TASC-DMD, Exact DMD, and fbDMD on the % linear advection-diffusion equation with KNOWN eigenvalues. % % NOTE: This example is NOT included in the paper. % % Equation: u_t + U0*u_x = nu*u_xx % % Analytical eigenvalues: omega_n = -nu*k_n^2 - i*U0*k_n % In the comple...
e5105febc6b3f63a69958f4b7450af7d8dbbe74ac79b1836b364cba7a1f14fa1
MATLAB
7,467
222
function [stat,p,stats,tbl,dist] = permuchi2(x,varargin) %PERMUCHI2 Permutation-based Chi-square test of independence. % STAT = PERMUCHI2(X) performs a permutation test of independence based % on the Chi-square statistic for the contingency table X, and returns % the test statistic. If X is a 3D matrix (Rows x C...
edbadc9e2c966d6dd0fc9c6342b49ed75497a8d1d3adeb9f712570ebcd8faead
MATLAB
7,468
158
function support_func_plot_legend(figLegend,varargin) %% ######################################################################## % - Add custom legend to the current figure - % ######################################################################### % Add a custom legend to your current figure. % % [Note:] Overwrite...
c52b6ba2abdb387f80ca71fa2ebe76d7708d51f4675494154c16d2d5e9deb2ba
MATLAB
7,469
147
% STD_MOVECOMP - Move ICA component(s) from one cluster to another. % % Usage: % >> [STUDY] = std_movecomp(STUDY, ALLEEG, from_cluster, to_cluster, comps); % Inputs: % STUDY - STUDY structure comprising all or some of the EEG datasets in ALLEEG. % ALLEEG - vector of EEG structures in the...
f259b31ab9e2b1e2c5425dc908606af9036a5e998fb5ba5b2c1a261ff425b6c6
MATLAB
7,470
101
function ex_hdr = GE_readHeaderExam(fid, byte_align) % % ex_hdr = GE_readHeaderExam(fid, byte_align) % % Loads the exam header from the 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) % % % So...
066c179ace3381cea95975f265a599ed720c01b9c3c5a98e05fae113a83e6b4e
MATLAB
7,472
208
function BpRF_run_pRF_analysis(subj_id, session, mod_name, ana_name, avg, conf, voxels) % _ % Estimate Voxel-Wise Population Receptive Field Model % FORMAT BpRF_run_pRF_analysis(subj_id, session, mod_name, voxels) % % subj_id - a string, subject ID (e.g. "EDY7") % session - a string, session name (e.g. "visu...
beca1a39574ff3c4b4cb175ce0cdfaf70b4fa5e5c602eebcb22f37cfd9beeb85
MATLAB
7,481
207
function singleCalcium_activity_PB_DenisH2B ( Hz ) % script that analyses ROIs for two channels at the same time, plotting them % next to each other % we will have one ROI for the green channel and two ROIs for the red % channel, so each graph will be composed of three lines % choose folder where data is stored myFol...
7734b8ce97c54297c538799a3ab95ece6a9f79fbcc0cd08f32e22a1d8aa0d821
MATLAB
7,488
220
function varargout = openpose_keypoints(filename, hdr, begsample, endsample, chanindx) % OPENPOSE_KEYPOINTS reads keypoints from a series of OpenPose JSON files % % Use as % hdr = openpose_keypoints(filename); % dat = openpose_keypoints(filename, hdr, begsample, endsample, chanindx); % evt = openpose_keypoints(f...
9000488764a892fe944d04030a0da62f69a53edeb95290355b1f81d1176f6074
MATLAB
7,493
160
function [MRSCont] = osp_saveNII(MRSCont) %% [MRSCont] = osp_saveNII(MRSCont) % This function writes all processed MRS data to NIfTI-MRS files. % % One file is produced for unedited MRS data (PRESS, sLASER, etc.), four % files are produced for MEGA-edited data (A, B, sum, difference), and % seven files are...
e222f8cf03e74392ca3d09e0e08eb24f2fc119fe7faa8677d24cd0589d0c1dd7
MATLAB
7,494
169
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
9578e90e4ee7a768e0d8ef8a3fc6b1a310dcabd3e6f99ae83f134bbf801b8645
MATLAB
7,501
169
function signalSpectra(plotInfo) % loads training sessions and computes specified signal type the PSD % - FFT % - STFT % (c) Jiri, Feb14 % known "little bug": bad recording epochs get rejected first, then PSD (-> "jumps in data") %% settings if ~isfield(plotInfo, 'signalType') plotInfo.signalType = 'EcogGrid'; en...
a9e930fa6409c0491d1326603baaf4e03619ae8391e4f689b134100a7b089929
MATLAB
7,502
269
function flag=vis_valuetype(value, valid, str); % VIS_VALUETYPE Used for type checks in SOM Toolbox visualization routines % % flag = vis_valuetype(value, valid, str) % % Input and output arguments: % value (varies) variable to be checked % valid (cell array) size 1xN, cells are strings or vectors (see below) ...
5cc37e078988703204a35e799e542d017f1e6ec881146e41cb057dd5618233f2
MATLAB
7,506
104
function osp_updatecorrOvWindow(gui) %% osp_updatecorrOvWindow % This function updates the correlation overview tab. % % % USAGE: % osp_updatecorrOvWindow(gui); % % INPUT: % gui = gui class containing all handles and the MRSCont % % % AUTHORS: % Dr. Helge Zoellner (Joh...
e0f0b9bd4c7ef1acf5a54fda4d8bd32577ebe1e43689c6ce358fbcd85ff58754
MATLAB
7,507
226
function outtable = cluster_chi2(clusters,fnames,DB) % function outtable = cluster_chi2(clusters,field list (cell array of strings),DB) % % tor wager % counts studies in each cluster % warning: does not count separate CONTRASTS, just STUDIES. % DB is a structure that contains all info from the database % % clusters is ...
4a96cc282acac0732aeb2d2773a6f89e47a8bc9726870ef46141eba0bc8b26e6
MATLAB
7,510
176
function [tbl,rm] = simple_mixed_anova(datamat, varargin) % tbl = simple_mixed_anova(datamat, between_factors, within_factor_names, % between_factor_names) % % Repeated-measures or mixed ANOVA with any number of factors. % % Function built on top of existing MATLAB functions in an attempt to % simplify user inputs and...
4428cb4cbd7580dfe24cef587d595c911a9587ff66ff90bd9b9be34cd566f110
MATLAB
7,512
178
function this = MrImage_load_from_file(this, testCondition) % Test loading from files for MrImage, in particular if additional % parameters are given. % % Y = MrUnitTest() % run(Y, MrImage_load_from_file) % % This is a method of class MrUnitTest. % % IN % % OUT % % EXAMPLE % MrImage_load_from_file % % See also ...
c1041f4e5f69bfd4074055d909d790a983c851dd19893e2ce9e1d5d46a625f29
MATLAB
7,515
235
% MAPCORR - 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). % % Finds correlation of maximum common subset of channels (using % channel location fil...
d62e5aad80b621cffb750be9aaba6909dfdfe3a60b29623a5d7f1fe6bfc25044
MATLAB
7,517
175
% Script make_example_data % Creates example data for uniQC-demos based on the ME-data in Heunis et al. % % make_example_data % % NOTE: This script has to be run only once, in order to prepare some % example files for all uniqc-demos from a publicly available imaging % dataset. % % INSTRUCTIONS: % 1. Plea...
0bca3e20fc081570576d9d1c392653eb6406b639522d77def9d9b49adaea9972
MATLAB
7,518
192
function gitInfo = TS_AddGitInfo(whatDir,whatData) % TS_AddGitInfo Appends the git information to the hctsa file % % Note that after computing, functions and results may change and thus not % reflect the commit at the time of initailizing (or whenver this is run). % %---INPUTS: % whatDir: the directory to look for a ...
7816a7517eb2a326e1bc499ba3f9571c436dc63d46122967a59cb67ce1eec1e5
MATLAB
7,519
183
% fit_OspreyMultiplex.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [fitParams] = fit_OspreyMultiplex(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 %...
c70aa076e8359e715be54e2921baaba6847aef08803e8fe03525ab10d38c7526
MATLAB
7,524
204
function [coherogram,phase,t,f] = MTCoherogram(lfp1,lfp2,varargin) %MTCoherogram - Compute LFP coherogram by multi-taper estimation. % % USAGE % % [coherogram,phase,t,f] = MTCoherogram(lfp1,lfp2,<options>) % % lfp1,lfp2 unfiltered LFP <a href="matlab:help samples">samples</a> (one channel each). % <opti...
93fc29151b9ef0261a12f60820aefaeed2ec9efe24db83e6ab7ddf6da4733a32
MATLAB
7,525
150
function triggers = getTriggers_zeroSpeed(params) % detects events of zero speed (pauses) as continuous data payches whose % |velocity| < thr [std] % pauses -> trials % binned pauses -> classes % (c) Jiri, Dec12 %% try to load the processed dataset if ismember('triggers', who('-file', params.storage.cacheFile)) ...
d0d6631b83444ed5bf4246a543df91c87e06d8af55cf93ed728023a106ff2384
MATLAB
7,527
136
function FCMap = TMSSeedFC(SeedDir,FCMaskDir,FCOutDir,AnalysisDir,subj,targetdepth) if nargin<5 error(' Error using ==> at least 5 arguments wanted.'); elseif nargin==5 targetdepth = 0 % number of voxels, distance from cortical target to c4 elseif nargin>6 error('E...
e9ee25f8e73912709366d8a7f80f63ba76c67d31456e1a9bbee19aed734684db
MATLAB
7,534
163
%% This document shows several examples of how to use nsd_mapdata.m. % NIFTI files can be viewed in ITK-SNAP. % MGZ files can be viewed using FreeSurfer's freeview. %% Setup path addpath(genpath('/home/adf/charesti/Documents/GitHub/nsdcode/matlab')) %% Map T1 anatomical to EPI space % Here we map the 0.8-mm T1 t...
991867930bcaa62c764583e9158243a2c87d07cf95c27e4b028971f925912e94
MATLAB
7,539
198
% coreg_siemens.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [vol_mask] = coreg_siemens(in, vol_image, maskFile); % % DESCRIPTION: % Creates a SPM volume containing a voxel mask with the same dimensions % as the SPM volume containing a structural image. The voxel mask will be % created with the...
57b55f92cd7b41f81a42e5b10c68f0140f84ae88cf22c37d99c7d55f33a1019e
MATLAB
7,540
233
%Analysis of the pipette deflection from micropipette force spectroscopy %experiments using a cross-correlation apporach. % %Code written by Matilda Backholm, 5.6.2018. % %NOTE: %This code assumes that there is no force acting on the pipette in %the first frame, i.e. that the pipette is in its equlibrium position %def...
7b9870dd0f255fdfbc737a5f858585bdeac49f5736f88a6af19ba993a5b595f3
MATLAB
7,548
204
load bs_results.mat %for plotting cortex load cm17.mat % colormap load dk_labels.mat %DK atlas labels %dataset to use load Hippo_data_ASB_norm.mat % data table with clinical/demographic and PAC data save_dir = './Cluster_test_results/Hippocampus/'; if ~exist(save_dir, 'dir') mkdir(save_dir); end pa=["Amplitude", "...
7847692b70ae585a20cbcc118d78a07838c985d33a882d2331f174e3d87edb70
MATLAB
7,551
218
% figure2_tf_switch_calculate.m - Calculate TF power differences: Switch vs. Repeat % % This script analyzes time-frequency power differences between switch and % repeat trials, revealing oscillatory correlates of priority switching. % % KEY ANALYSES: % 1. Load time-frequency decomposed data for each subject % 2. A...
81754cdca96b4aae623e62a2d550e6ad1513054283e5634ddb3cafdc2317492b
MATLAB
7,551
234
function [ subject ] = nmri_determine_datatype( subject ) %[ subject ] = nmri_determine_datatype( subject ) % central script to determine datatype (EEG/MEG/...) % layout (for Fieldtrip viz and ICA) % montages (for eeg_score viewer) % will also try to deal with invasive EEG data % check the call if (~exist('su...
d34ca6efa02fb04d37fd55d8d413a4ba10d4131f271424b7981c7d856cebed92
MATLAB
7,552
190
% SCHRODINGER_EQU_TASCDMD Benchmark TASC-DMD, Exact DMD, and fbDMD on % the Nonlinear Schrödinger (NLS) equation. % % This script reproduces Figures 2a–2i of: % [TASC DMD Paper — citation to be added after publication] % % Workflow: % 1. Load NLS data (run generate_NLS_data.m...
4321499b57b0ad837f13b7d87028fa360dc8ea21ad34cae8050d26c5c2aec4bb
MATLAB
7,556
192
function [data_clean, EEGartifacts, SENSAI_score, SENSAI_score_per_band, artifact_threshold_per_band] = ft_denoise_gedai(cfg, data) % ft_denoise_gedai FieldTrip wrapper for the GEDAI plugin. % % Use: % [data_clean, EEGartifacts, SENSAI_score, SENSAI_score_per_band, artifact_threshold_per_band] = ft_gedai(cfg, dat...
396ecc330021df4e0ef89009d8de3529e6fd9c9e3a26125711c35d7c12031972
MATLAB
7,561
197
function [ obj ] = vb_init( obj ) % Initialize posterior and auxiliary variabels for VB inversion of HUGE. % Requires obj.dcm and obj.prior to be intialized. % % This is a protected method of the tapas_Huge class. It cannot be called % from outside the class. % % Author: Yu Yao (yao@biomed.ee.ethz.ch) % Copyright (C...
07d816d88cb38a4d543171d154b6f3a9a61916cccaa036ea97e1ecb381fb49f8
MATLAB
7,562
186
%% ============================================================ % Main raw trace analysis script % ============================================================ clear all close all clc %% ============================================================ % Set parameters and import data % =============================...
d202e4178dc0adda780347a83a710a7720e31295a2f9a8d5c7683aee49730e7a
MATLAB
7,572
225
function [h,p,stats] = TestSkewness(control,repeat,test,varargin) %TestSkewness - Test if firing field skewness changes between two conditions. % % Current implementation only tests 1D environments. % % USAGE % % [h,p,cr,ca] = TestSkewness(control,repeat,test,<options>) % % control firing fields in cont...
5d8cb23a71adfc91567b6421c632120a9a83a73c637bb1881571399eabe3f4da
MATLAB
7,577
217
%% BiExpFitModel.m % This function contains a biexponential diffusion model % % lossFunction - calculates loss function for optimizer % forwardJacobian - calculates the forward jacobian for optimizer % forwardModel - converts parameter struct into model prediction % x2pars - converts x vector ...
bf618b892d81734f1c9a6ee85b762f77174d085c91acba1e97fceec16a501b3d
MATLAB
7,581
281
function hh = errorbar_h(varargin) %ERRORBAR Error bar plot. % ERRORBAR(X,Y,L,U) plots the graph of vector X vs. vector Y with % error bars specified by the vectors L and U. L and U contain the % lower and upper error ranges for each point in Y. Each error bar % is L(i) + U(i) long and is drawn a distance of ...
daa172d7662bc789c6f949da6e890c2948a92be8052fe70699fd4fac88372b40
MATLAB
7,581
235
function ProcessData_Figure3(BestFitEarly, codedir, savedir) %ProcessData_Figure3 - function to process data to generate Figure 3. Saves % data in savedir to be accessed by PlotFigure3 % INPUTS: % BestFitEarly - BestFit.mat file found at: Mah_CellReports_BehavorialData/FitAll_ITI_VanillaAlpha_First10/BestFit.mat % fr...
1a2227eda632808cd62143df99b519bcae0a5a1246d7d80612d6dc60ae78ac47
MATLAB
7,585
214
function [trials,Ftrials] = volbin_all_cells(all_SU,goods,all_S,all_index,win,varargin) %plot heatmats aligned to reward volume for all cells 5/10 and 40/80 binned % input: % all_SU - the data of all cells % all_behEvents - data of all cells % all_index - indexing of all cells % win - [start,end] of window you want pl...
76b4b40b456e82fad7aee6cd10e732c5c5634c82fab39ab254103c9521be27bf
MATLAB
7,585
185
function out = NL_DelayTime(y, maxDelay, past, randomSeed) % NL_DelayTime Optimal delay time using the method of Parlitz and Wichard. % % Computed natively in MATLAB. TSTOOL's own 'delaytime' code % (tstoolbox/@signal/delaytime.m, vendored in this repo under % Toolboxes/OpenTSTOOL) turned out to be pure MATLAB itsel...
d669b024d7de9e4b66f7cc4a680b95e2ab5fb759cae1635952d7e9aed1f633ff
MATLAB
7,585
186
%% ============================================================ % Main raw trace analysis script % ============================================================ clear all close all clc %% ============================================================ % Set parameters and import data % =============================...
f61c8532cc145ce66ffda90bb1d4bac1d93dadbbc4952b1dbe5e84ca419acf6c
MATLAB
7,587
231
function build_mmx(verbose) % BUILD_MMX - compiles mmx() for different platforms and provides help % regarding compilation. % % BUILD_MMX will try to compile, in this order, 3 different builds of mmx: % mmx_mkl_single - linked to Intel's single-threaded MKL library (usually fastest) % mmx_mkl_multi ...
00681cc19a358dbb5a898d65b5e01821b1a92a4f9ce685797bd4530ec927920d
MATLAB
7,591
204
function runSearchlight(Searchlight,inFiles,outFiles,analysisName,rsaFunction,varargin) % function runSearchlight(Searchlight,infiles,outfiles,rsaFunction,varargin) % Main analysis engine for searchlight-based analysis % The function deals with data loading from the infiles, concatinates the % data to a nObservation x ...
d96854afd77f88771368ad6e28170a7cb36124359cec43d7ad3c6e53ae1d5b17
MATLAB
7,595
205
function runSearchlight_subspaceGener(Searchlight,inFiles,outFiles,rsaFunction,run,tempFilesDir,varargin) % function runSearchlight(Searchlight,infiles,outfiles,rsaFunction,varargin) % Main analysis engine for searchlight-based analysis % The function deals with data loading from the infiles, concatinates the % data t...
39e591e4ca9fe3b634e62b77babfb7f83707b93627aa4e77fdb46b4ef11b97b1
MATLAB
7,598
233
function [p, h, clusterinfo] = cluster_test(datobs, datrnd, tail, alpha,... clusteralpha, clusterstat) % CLUSTER_TEST performs a cluster-corrected test that datobs is higher/lower % than the distribution as expected under the null hypothesis. The 'null' % distribution should be pre-computed (manually or using CLUST...
990d3a0d054c4ff015d63cba6e5549206ec12c79792424f05248f1ff439c78d1
MATLAB
7,598
170
function trialsData = prepare2plotTrials(params, trials) % arranges the 'trials' structure to trialsData structure used by plotTrials.m % (c) Jiri, Nov16 if ~isfield(trials, 'get_pValsBase') trials.get_pValsBase = true; end if ~isfield(trials, 'get_pVals') trials.get_pVals = true; end if ~isfield(params, 'sav...
a09de68ea0de5f60d1c7286bffb694915fd05a37a5dcf1c240a4b6c1485a8cd4
MATLAB
7,601
209
function [adjMs, coords, channels, FisCell, FdenoisedIsCell, spksIsCell, spikeTimes, fs, Params, activityProperties] = suite2pToAdjm(suite2pFolder, Params, Info, oneFigureHandle) %SUITE2PTOADJM Converts suite2p data to adjacency matrix % Detailed explanation goes here % Params = struct(); % Info = struct(); % adjMs...
f15a952f4893064b72b7010a638e6dea82976df51f1ed19a9d1f7f3f8185ebf6
MATLAB
7,602
256
function [f,p,ci,stats,tbl,dist] = permuanovan(x,group,varargin) %PERMUANOVAN Permutation-based N-way ANOVA and rank ANOVA. % F = PERMUANOVAN(X,GROUP) performs a permutation-based N-way analysis % of variance (ANOVA) for comparing the means of data in matrix X, and % returns the test statistics. X is an N-by-V m...
19db8e9d3730c0b3112eb0f60f298e99a7ee8eedd96407610837df906daefe60
MATLAB
7,604
247
function varargout = shadowplot(varargin) % SHADOWPLOT Add a shadow to an existing surface or patch plot % % For some surface plots, it can be helpful to visualize the shadow (2D % projection) of the surface. This can give a quick perspective on the % data's variance. % % SHADOWPLOT PLANE Adds a shadow plot on th...