sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
7ed11fbc0e1e9a20933b19ef0dece68f947fe677885526a4f04c12d756081135
MATLAB
4,902
113
function plot4fit(Age,Data_rremain,fitresult,name,ylabelname,pvalue,rsq) N=0; pwhile = pvalue; if(pvalue>0) while(pwhile<1) pwhile = pwhile*10; N=N+1; end pstr = num2str(pwhile); if(length(pstr)<3) pstr = pstr; else pstr = pstr(1:3); end pstr = ['p = ',pstr, ' x 10^{\bf\fontsize{28}-' num2str(N)...
0d4d04219b4664b980b04850725a492ca12da1ef0aced57e9df191ac2219f691
MATLAB
4,905
128
function [MRSCont] = osp_LoadDICOM(MRSCont) %% [MRSCont] = osp_LoadDICOM(MRSCont) % This function reads raw (but coil-combined) data from DICOM files % produced by Siemens sequences (*.dcm or *.ima). % % USAGE: % [MRSCont] = osp_LoadDICOM(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data contain...
d00c539c3820685ceb95aeca08db46d798ad820a7fb80837bfe6eb55f32a56eb
MATLAB
4,905
105
%Axon analysis and quantification code associated with Gutman-Wei et al., %2025 - function to calculate tracing statistics with a grid overlaid %Generates quantification of length, branchpoints, and endpoints in each %grid for cell input, as well as convex hulls at each level specified. The %location of grid vertices a...
c179352c1bbc37edd9cbe6d0e8452a93cd0b03fbf7534fb150fa714a4195616c
MATLAB
4,907
140
%% This file is used to crop regions for two-color STORM analysis clear all; close all; clc; binpath = '\\E1-054867\Jinyu\20250324 b3_AF647 CHC_CF583R\Analysis'; %%%%%%% path that you saved your png and bin files mkdir([binpath '\diat_regions']); ipath=[binpath '\diat_regions\']; filename = dir(fullfile(strcat([binpat...
c0edaf63f01f39eb8fe46f03318292dfde0492d4f10eeeba62c07d14a7df9073
MATLAB
4,909
120
%{ trippy.RF (computed) # receptive fields from the trippy stimulus -> rf.Sync -> pre.Spikes ----- nbins : smallint # temporal bins bin_size : float # (ms) temporal bin size degrees_x : float # degrees along x degrees_y...
c289c2407e141b4aa9b9354e8965dfb936f87ad3baa91ab4247927085bf8bcf2
MATLAB
4,910
158
function [hdr,data]=read(filename) machineformat='ieee-le'; ind=findstr(filename,'.'); if ~isempty(ind) fileprefix=filename(1:ind-1); else fileprefix=filename; end if exist(strcat(fileprefix,'.hdr'),'file') & exist(strcat(fileprefix,'.img'),'file') type=0; hdr_filename=strcat(filepre...
0c9309c78eafe90db94f2327b46037296ed76af11ebea49ae5b85f0e51f10bd2
MATLAB
4,911
165
function plot_fig3h_right(datadir) % Plot dopamine AUC at the reward cue (0-0.5 s) vs -delta trial initiation % time, averaged across rats. N = 10 rats. % % INPUTS % datadir: file path of data downloaded from Zenodo. Link to download can % be found in README. fname = fullfile(datadir, 'data-published/deltaITI_vs_AUC_S...
5b8c3574c1503fce4d8b63eb89bb1480a06819544b1ff76f0fc4b73519f14f4b
MATLAB
4,912
134
function out = MF_hmm_Fit(y, trainp, numStates, randomSeed) % MF_hmm_Fit Fits a Hidden Markov Model to sequential data. % % Actually highly stochastic, so for reproducible results helps to reset the % random seed... % % ---INPUTS: % y, the input time series % trainp, the proportion of data to train on, 0 < trainp < ...
631fe532747da840c12ab378b271b0604bdd18f61de2cde52dd1411399ecfb36
MATLAB
4,916
140
%% get_set_bfr_lbv(h,mode,input) % % Input % -------------- % h : structure contains all handles of SEPIA % mode : 'set' - extract information from GUI to config file % 'get' - extract information from config file to GUI % input : if mode is 'set' then input should be fid % ...
77717ac5b0f48d06a213be00e090bc3f88c510ad73b00477725b501d584dda32
MATLAB
4,923
133
function [delta_rats, E2_rats, ratlist_elisa] =... Estradiol_vs_DeltaInit_bystage(SerumTable, SerumBehData, detrend_arg) %relate change in estradiol expression to change in delta initiation times, ie "behavioral sensitivity" (pro - %di) only for sessions with blood samples %calculates mean concentration for repeate...
940e51922471775ae961d55d375198727eeeb1e625ea90c95acf5c9980f83309
MATLAB
4,925
144
function res = permutation_null_coexp(img_data, geneset, expressions, gene_symbols) % PERMUTATION_NULL_COEXP(IMG_DATA, GENESET) performs permutation testing to examine % whether imaging profiles associate with gene expression profiles, based % on the null-coexpression model (where random genes with similar % coexpressi...
443a5fdf6e4897b09323e3890a55c971f5040c11b232aa68aad8bdb7595d7c8b
MATLAB
4,927
120
% Analyse behvioural responses % % For all those subjects where they have been recorded, calculate responses % to the task. clear; clc; warning('off'); % % add spm to the path % initiate bidspm % Initialize report % Start a new report report = {'subject','run','trial_type','keyPress','response_type'}; reportExtr...
dce085bcd059f2f56258595e24cf0b5172f119a1c6adc22e43eb832bc88c7a31
MATLAB
4,928
108
function [masterlist,alignlist,pairedlist,grouplist,STRlist] = modelKernelLists() %a running list of all kernel names used in the models. These lists %dictate how kernels are plotted and used in most of the analysis %script. if you make a typo in your kernel, it could get missed! % %naming convention is Java style: no ...
131676618b3cae5b5fa1b4c93ab6935cf72435f8add7cc6aea76bc1046bb3ddd
MATLAB
4,929
99
%{ pre.ScanCheck (imported) # average frame before image corrections -> pre.ScanInfo -> pre.Channel --- avg_frame : longblob # raw average frame min_intensity : int # min value in movie max_intensity : int ...
d19c9ee5edd0efc839b843ae4382e6238ed9c0ce0ae48a65af8ee681a410c757
MATLAB
4,931
153
function [ all_metrics, all_suma, all_subjects, active_hdm_class ] = nmri_load_metrics( all_subjects, metric_txt, freq, params ) % [ all_metrics, all_suma, all_subjects, active_hdm_class ] = nmri_load_metrics( all_subjects, metric_txt, freq, params ) % will load a specific connectivity netric (or power/normalized pow...
c5dc6418226f526b82e41a3c3d313fbd2a25eefd92805b902553f75d5a7ee7ae
MATLAB
4,932
151
% this is a one-off to create a really nice big figure. % goal: fsaverage. all sessions, all subjects. mean and R2 (from onoff) % NOTE: this was all achieved BEFORE we reset the cvnlookup cache. thus, the annotations have to be updated too. %% %%%%% Map various 1mm volume results to subject surfaces and then to fsave...
4b6339b8eeb301f4694ded4db819dea1f1fe92626c974435cc3b33ce359361da
MATLAB
4,933
117
% Analyse behvioural responses % % For all those subjects where they have been recorded, calculate responses % to the task. clear; clc; warning('off'); % % add spm to the path % initiate bidspm % Initialize report % Start a new report report = {'subject','run','trial_type','keyPress','response_type'}; reportExtr...
1c49af2aa1bfa0209c839dac42a82b78df77a1ff23e9f63b36dff5982e79630c
MATLAB
4,934
93
% The goal here is to generate basic surface visualizations % relevant to the NSD dataset. %% DEFINE % name color range color map threshold outname atlasesMASTER = { ... {'curvature' [] [] 1000 []} ... {'Kastner2015' [0 25] ...
2667587bf23d22fa7c6001bb2c39fb6528ad3b0741635d1f9a276c042d4ca07a
MATLAB
4,936
180
%% Prepare workspace clear all; close all; clc; commandwindow; % Grab date t.the_date = string(datetime('now', 'Format', 'yyyyMMdd')); t.the_time = string(datetime('now', 'Format', 'HHmm')); % Generate unique seed for rng rng('shuffle'); t.my_rng_seed = rng; %% Input device name p.device_string = 'Apple Internal ...
c64aff20bcf8916f64536762cf684240df251f8d3059fb8cc4361cb2eac89849
MATLAB
4,936
139
function [recov_params,results] = parameterRecovery_happy_model_responsibility_redux(mtx,params,noiseLevel,Nrep,displayFlag) % mtx are input regressors %assumes that each row of the cell array is a different subject %% Settings constant = NaN; % has always been like that rptfit = 5; % repeat N times jittering ...
185ae176ea5dc401ad86c9e714c38d0125b3ba5cd2784976bdd56bba9468c67b
MATLAB
4,937
144
function coactPaper_tableS02() close all height=9.6; fontsize=6; fh=initFig('width',18.6,'height',height,'font','Arial','fontsize',fontsize); panel_01(7) drawnow() print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS02_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','-r300') end function panel_01(fs) o...
21a1e292c63f7a5377c84cc63992c318ce392ddf6fa8d65d6d0aece6d86beee0
MATLAB
4,938
113
function [varargout] = likNegBinom(link, hyp, y, mu, s2, inf, i) % likNegBinom - Negative binomial likelihood function for count data y. % The expression for the likelihood is % likNegBinom(f) = 1/Z * mu^y / (r+mu)^(r+y), Z = G(y+1)*G(r)/(r^r*G(y+r)) % with G(t)=gamma(t)=(t-1)!, mean=mu and variance=mu*(mu+r)/r, wh...
f6ce2b72986ffcd5bc38fcf88ad11082ac1c485fb213623a208879b4f95a04a6
MATLAB
4,939
117
% Analyse behvioural responses % % For all those subjects where they have been recorded, calculate responses % to the task. clear; clc; warning('off'); % % add spm to the path % initiate bidspm % Initialize report % Start a new report report = {'subject','run','trial_type','keyPress','response_type'}; reportExtr...
104885ff5d0ec40edc647d915865a12c4f88b5fd78e3b29374608ed333b5c8bf
MATLAB
4,940
176
function [ subject, data ] = nmri_artifactrejection_reviewICA(subject, data, params) %[ subject, data ] = nmri_artifactrejection(subject, data, params) % % This is an interactive function to review and reject the ICA components % % % subject = subject structure, see nmri_read_subject % could be a...
7cb7b81d093e2f6e43ea4b7c2f52b467c34f6a41bf2694382e8590e9551985fb
MATLAB
4,940
171
function fear_spkModulationByMoving_ShBase(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; %% load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) %% param.sesIdx=2; param.tBinSize=0.02; param.nIte=500; par...
37dcf28e0096c985ef9d55206747b52e0d3853ae31c1100454b6d7dc6e76282f
MATLAB
4,942
144
% READLOCSOLD - Read electrode locations file in style of TOPOPLOT or HEADPLOT. % Output channel information is ordered by channel numbers. % % Usage: >> [nums labels th r x y] = readlocsold(locfile);% {default, polar 2-D} % >> [nums labels th r x y] = readlocsold(locfile,'polar'); % 2-D % ...
af2955656421f94be9886ba8ee7ef5c661cd06aa8d1f7540cce7ae11fce8cef9
MATLAB
4,942
157
function [Rlatt,Rrp,ind_rp,eff,met] = latmio_und_v2(R,ITERATIONS,D,metric, plotIterations) %LATMIO_UND_V2 Lattice with preserved degree distribution % % [Rlatt,Rrp,ind_rp,eff,met] = latmio_und_v2(R,ITERATIONS,D,metric); % % This function "latticizes" an undirected network, while preserving the % degree...
c317744a31cea70e4944eb240cd0313a0841accd033622305a144e47f619e82a
MATLAB
4,942
152
function run_permuvartest2_examples %RUN_PERMUVARTEST2_EXAMPLES Run two-sample permutation F-test examples. % Generates random multivariate data for 2 "independent" samples X and Y. % Each sample has 20 variables, each with a standard deviation of 1, % except for the first 10 variables of Y which have a standard...
186d79a4b84a508df46eea46005a5d62d7b30b3c55bd5ae15f3b05db02ef253f
MATLAB
4,943
138
% EEG_MERGELOCS - merge channel structure while preserving channel % order % % >> mergedlocs = eeg_mergelocs(loc1, loc2, loc3, ...); % % Inputs: % loc1 - EEGLAB channel location structure % loc2 - second EEGLAB channel location structure % % Output: % mergedlocs - merged cha...
358ad818ef85ba1555aaa9a71706822d044f2dabc07935f27b7f3dbc2b05276f
MATLAB
4,943
120
function figureRDMs(RDMs, userOptions, localOptions) % figureRDMs(RDMs, userOptions[, localOptions]) % % figureInterleavedRDMs is a function which accepts a multidimensional struct of % RDMs, puts them into a 1D struct, and then shows them. % % RDMs --- A struct of RDMs. % All RDMs in here will...
6246aab6a81bfd96f1decb89c118ae3e9f63653c87ffb2db6d919d3f06da7097
MATLAB
4,944
122
function plotBrainTopo_trialsData(params, trialsData) % plots trialsData onto brain topology (slices or 3D model) % trialsData = % info: [1x1 struct] % xVals: [1025x1 double] ~ 1D: time, in [s] % yVals: [1025x110x2 double] ~ 3D: time x channels x classes % yErrs: [1025x110x2 double] ~ 3D:...
a4874901f46c4ccedd608703856166f8ef89cc43246216ff6b6b8da5ace7f31d
MATLAB
4,945
146
% GETKEYVAL - get variable value from a 'key', 'val' sequence string. % % Usage: % >> val = getkeyval( keyvalstr, varname, mode, defaultval); % % Inputs: % keyvalstr - string containing 'key', 'val' arguments % varname - string for the name of the variable or index % of the ...
0f6f3cd74e8c7bd230d24ecfefea7ad369cadcb209a33c60ecd017b3d85004d9
MATLAB
4,947
173
function RGB = HSLuv_to_RGB(varargin) %{ RGB = HSLuv_to_RGB(HSV) Returns RGB values for an n by 3 matrix of [H, S, L] values. RGB = HSLuv_to_RGB(n) Returns n columns of RGB values for a pastel colormap. RGB = HSLuv_to_RGB([n], 'H',H, 'S',S, 'L',L) Returns n columns of RGB values for linearly spaced value...
083d9f6b4e0da70511a518616f188cc54d8d560aad38cb817562df07b61b1dd8
MATLAB
4,950
165
function fear_icaCoactTrigWaveletCueRet_optShift(basename,varargin) % basename='~/data/Fear/triple/karmeliet190901/karmeliet190901'; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName); load([basicMetaData.AnalysesName '-nremWaveletPow.mat']) ...
76887d3f9a8b6c76b92870e31e7dee586017f20618d9169435be7d4a9c70f302
MATLAB
4,953
129
function [colormap]=cbrewer(ctype, cname, ncol, interp_method) % % CBREWER - This function produces a colorbrewer table (rgb data) for a % given type, name and number of colors of the colorbrewer tables. % For more information on 'colorbrewer', please visit % http://colorbrewer2.org/ % % The tables were generated fr...
8df83f8e16d781b01677b9108ccfda524a9a0e7ebd150ff0ae8ef85d414fa76e
MATLAB
4,954
144
function axislabel_rotation(~,ax) % This function rotates x, y and z labels to the direction of their % corresponding axes when a rotate operation has finished. So that labels % will be parallel to axes. % The function is used as an 'ActionPostCallback', which is a callback % function of a rotate3d object. % I...
9ec512c34df89ba7db155a4b6837d41a8bbf5936d2771a4a013d9b3c9b315801
MATLAB
4,954
87
% Script from Tor Wager's canlab github to compare an image to a "neural % signature", a multivariate predictive pattern, for example for guilt % ("Guilt-Related Brain Signature", or GRBS, from Yu, Koban et al., CerCor % 2020) or reward ("A neural signature for reward", Speer et al., % Neuroimage 2023). %% Set up dire...
edb29704f42ab1dfb31d52184f9292176b1b426160b84bccfecd2de5a7243fe1
MATLAB
4,955
136
function ch2roi_plot_allFreq(GRUP, groupInfo) % groups channels into defined ROIs (anatomic areas), averages & plots % FIG: % - subplots = freqBands x ROIs % - 1 subplot: time x clz % based on the following criteria: % - selected anatomical areas (groups) % - selected freq. band % - significance (difference ...
47db11da47ffea4ae5e0cb51cb311f37e641ac5a96f88b070bc924f85dc05759
MATLAB
4,957
173
function [B1, B2, B1iti, B2iti,... dwt1, dwt2, diti1, diti2,... pcatch1, pcatch2, pvio_iti1, pvio_iti2] =... macro_regress_overtraining_V2(nsess, ratList, Sdir) %this version compares early sessions in training stage 9 from the S %struct, instead of the A struct, which has already been curated. cmc %11/16/...
ed93ac19f47b7fef0bffe6f3e22b76040df4a9979d537e73b14648067748213e
MATLAB
4,959
114
function filePath = BF_WriteTempFile(dataVector,whatPrecision) % BF_WriteTempFile Write a temporary file in the system temporary directory % % All ~26 TISEAN-based master operation instances for a given time series % call this with the SAME z-scored data, x_z (computed once per time series % in TS_CalculateFeatureVec...
68584b0de5ff47274ef0eabaa1393e9a3170d315c0811045e83e24838786aeff
MATLAB
4,962
137
% TRANSFORMCOORDS - Select nazion and inion in anatomical MRI images. % % Usage: % mewcoords = transformcoords(coords, rotate, scale, center, reverse); % % Inputs: % coords - array of 3-D coordinates (3 by N or N by 3) % rotate - [pitch roll yaw] rotate in 3-D using pitch (x plane), % roll (y...
2220b6f1c128339b73eb16d9df6a7d4a4f62eb320d3326500cd29a6f3778f759
MATLAB
4,963
123
function out = MD_hrv_classic(y) % MD_hrv_classic Classic heart rate variability (HRV) statistics. % % Typically assumes an NN/RR time series in units of seconds. % % ---INPUTS: % y, the input time series. % % Includes: % (i) pNNx % cf. "The pNNx files: re-examining a widely used heart rate variability % ...
338fb7c6fe3cb090f662c74a56f19f0ecfb875ede26dacb2b4a2103d2a2e25ea
MATLAB
4,964
147
% pop_dipfit_gridsearch() - scan all ICA components with a single dipole % on a regular grid spanning the whole brain. Any dipoles that explains % a component with a too large relative residual variance is removed. % % Usage: % >> EEGOUT = pop_dipfit_gridsearch( EEGIN ); % pop up interactive window % >> EEGOU...
fbd63136cad8dc26bc7915c172e664e0ca8bcff7f99f17b63cba9692da430ead
MATLAB
4,964
188
function [dt1,dt2,travel,index] = FitCCG(t,ccg,varargin) %FitCCG - Fit dampened sinewave to the cross-correlogram of a pair of theta-modulated cells. % % USAGE % % [dt1,dt2,travel,index] = FitCCG(t,ccg,<options>) % % t time bins % ccg cross-correlogram % <options> optional lis...
34aceaf13757ebef1279552ba83c5e9a9a4e1c194dba0f55b0d7cf7c9e1836b1
MATLAB
4,967
144
models = {'alexnet','flynet'}; do_bootstrap = false; for m = 1:length(models) %% get some information about file structure and number of subjects t = readtable(['naturalistic_betas.' models{m} '.only_sc.csv']); yhat = table2array(readtable(['naturalistic_pred.' models{m} '.only_sc.csv'])); %alexn...
2f5d3e93b2d6b04307a3a4bb9f511ff6dbdee11ae0a418b299c3ebdab6c74538
MATLAB
4,968
147
function [output,status] = plugin_urlwrite(urlChar,location,method,params) % URLWRITE Save the contents of a URL to a file. % URLWRITE(URL,FILENAME) saves the contents of a URL to a file. FILENAME % can specify the complete path to a file. If it is just the name, it will % be created in the current directory....
4fbaf19a06c86988f2b97fa17c0056bb747e77ed35414cb0c4d545e0142e27dc
MATLAB
4,968
186
function hdr = load_nifti(niftifile,hdronly) % hdr = load_nifti(niftifile,hdronly) % % Loads nifti header and volume. The volume is stored % in hdr.vol. Columns and rows are not swapped. % % Handles compressed nifti (nii.gz) by issuing a unix command to % uncompress the file to a temporary file, which is then deleted. ...
6e870726924b3853b088448713e1f0444839e1684c9536808f27a735a2956850
MATLAB
4,968
114
%% TestUnwrapMatrixPhantom - Tier 2 synthetic-phantom phase-unwrapping method regression matrix % % Mirrors TestQSMMatrixPhantom.m: runs the one-stop SEPIA pipeline on the % synthetic phantom once per phase-unwrapping method in methodUnwrapName % (sepia_universal_variables.m) AND per matrix size (the same 5 odd/even % ...
dfc4742d70a638afe82bae1019cdba301ed0c92a20fb9787f2cd18f2244d4c36
MATLAB
4,968
130
% ¶¨Òå×´Ì¬×ªÒÆº¯Êý£¬ÓÃÓÚÉú³ÉеĺòÑ¡½â function [ElementNew, sensorNew, update_sign] = UpdateLocationNew(sim_vol,Element,sensor,kgrid) Pitch = Element.Pitch; Kerf = Element.Kerf; ElementLength = Element.ElementLength; ElementNew = Element; CoorList = Element.CoorList; CoorSubList = Element.CoorSubList; PitchVoxelNum =...
0022028e55812de2febef3d6a71b9fe939fd7e66630e6789875568d65be3bc2b
MATLAB
4,969
130
function [MRSCont] = osp_LoadRDA(MRSCont) %% [MRSCont] = osp_LoadRDA(MRSCont) % This function reads raw (but coil-combined) data from RDA files % produced by Siemens sequences (*.rda). % % USAGE: % [MRSCont] = osp_LoadRDA(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data container. % % OUTPUTS...
cef6ad705cf1e6dee05c66f19aa35c4187ae16061f78d73a5189564fd0114d1a
MATLAB
4,972
108
function varargout = binaryGP(hyper, approx, covfunc, lik, x, y, xstar) % Approximate binary Gaussian Process classification. Two modes are possible: % training or testing: if no test cases are supplied, then the approximate % negative log marginal likelihood and its partial derivatives wrt the % hyperparameters is co...
41254413526e3454ce791048d490a430fc1ff11691232001374d05da20a07036
MATLAB
4,974
101
% MAKEHELPFILES - generate function help pages % % Usage: % >> makehelpfiles(list); % % Input: % 'folder' - [string] folder name to process % 'outputfile' - [string] file in which to write the help % 'title' - [string] title for the help % % Author: Arnaud Delorme, UCSD, 2013 % % Example: Generate EE...
9d58fcc1b4140e398b1989cf96c3936d2e0f3ccdbf0b87fd08e32ca09df447b5
MATLAB
4,974
160
%GHOSTSCRIPT Calls a local GhostScript executable with the input command % % Example: % [status result] = ghostscript(cmd) % % Attempts to locate a ghostscript executable, finally asking the user to % specify the directory ghostcript was installed into. The resulting path % is stored for future reference. % % Once ...
b21a4f4f0fc7dd1b7ba0f324734215321a6cd3b67ddfcf75650fff2431ad9f4b
MATLAB
4,974
145
function cl = threshold_pa_overall(OUT,varargin) % cl = threshold_pa_overall(OUT,[task level name]) % % if no opt. argument, works with overall pa and pa_overall.img % Otherwise, restricts analysis to specified task level only % % saves output struture OUT in STATS_VARS.mat % saves cl structure to file % % called by db...
62a216f153ce6f82712c8bde60a8e251a4f9a60bc26a63ac04d42d397807a5b2
MATLAB
4,975
167
% LOGSPEC - plot mean log power spectra of submitted data on loglog scale % using PLOTDATA or PLOTTOPO formats % % Usage: % >> [spectra,freqs] = logspec(data,frames,srate); % >> [spectra,freqs] = logspec(data,frames,srate,'title',... % [loHz-hiHz],'chan_locs...
93229cf45deb13318aebc21d5498cffc63408ba072015a415e7a8dd0007ff806
MATLAB
4,977
136
%PLUGIN_MOVEPATH- Given a path to a plugin folder, this function will % put the plugin at the bottom of the path. % % Usage: % plugin_movepath('x','begin'); % Put plugin 'x' at the top of the path % plugin_movepath('x','end'); % Put plugin 'x' at the bottom of t...
447e83cad0dfe58b1f2eeb765e4a1f935ffd7136069d8e176f05d3e67fc26bf3
MATLAB
4,980
97
%% load libraries run('set_library_paths.m'); addpath(SPM_PATH); % per spm docs, do not genpath it addpath(genpath(CANLABTOOLS_PATH)); %% VARIABLES THAT MUST BE DEFINED BEFORE THE SCRIPT IS SOURCED % This script is designed to estimate predicted-observed correlations % for a _combined_ encoding model pre-fit on a give...
164cb01247263623178d752414fde7c2cc5b75d225dd243ed92ff567a398bacd
MATLAB
4,982
162
function [Burst SpikeBurstNumber] = BurstDetectISIn(Spike, N, ISI_N) % ISI_N burst detector % © Douglas Bakkum, 2013 % % [Burst SpikeBurstNumber] = burstDetectISIn( Spike, N, ISI_N) % % 'Spike' is a structure with members: % Spike.T Vector of spike times [sec] % Spike.C (optional) Vector of spike channe...
131e4a6ee97dab6b82c836354607a460722944e7c06ad0ed2be130b8f91114b4
MATLAB
4,984
133
% pop_firwsord() - Estimate windowed sinc filter order depending on % window type and requested transition band width % % Usage: % >> [m, dev] = pop_firwsord; % pop-up window mode % >> m = pop_firwsord(wtype, fs, df); % >> m = pop_firwsord('kaiser', fs, df, dev); % % Inputs: % wtype - char arra...
7fcc6dbc0912f96ee1a4d96c76397d061aa9b280acb6ff01b7fd1cffe03340b4
MATLAB
4,984
128
function spectra = computeSpectra(params, trials) % computes spectra for each trial using STFT % trials = % data: [3073x125x500 double] % time: [3073x1 double] % sessTime: [3073x500 double] % labels: [1x500 double] % sessNumber: [1x500 double] % (c) Jiri, May16 display('Computin...
326d0a7a138fd84d4554afb85ccb8a4e19abffb46bb241ed07faff70caa79d80
MATLAB
4,985
154
% CHANGEUNITS - Takes one or more points in one axes and gives its position % in another axes. Useful for drawing lines between % sbplots (see SBPLOT). % % Usage: >> newpoint(s) = changeunits(point(s),curaxhandle,newaxhandle) % % Inputs: % point(s) - two-column vector of curre...
cd4c630262e5ca6c08912fb98f2cd59edf3ce98930b9db3270d165397dbaa7d9
MATLAB
4,990
111
function parcel_data = moment_age_model(moment_metric, age_metric, ... input_table, uparc, total_num_parcels, valid_parcels, fdr_correction, thickness) %-------------------------------------------------------------------------- % performs parcel-wise linear models: moment_metric ~ age_metric + sex (+ thickness) % %...
49f38703df0681b94e43e10e33a038cb8fcd4813a77c937a066f24bf8280a94b
MATLAB
4,991
138
function tapas_hgf_ar1_binary_mab_plotTraj(r) % Plots the estimated or generated trajectories for the binary HGF perceptual model for multi-armed % bandit situations. % % Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_binary_plotTraj(est); % % --------------------------------------------------------...
4e0658499d6935e0b26531dc2786f4c715a3fa6dd1f5806cb09cc6eebafbab8c
MATLAB
4,991
137
function plotEigenvalueGrid_4x3(toi, eigenvalue, behavior, a, b, c, outputFolder) % One figure: 4 rows x 3 cols. % Cols = Groups [NIG, FCG, CAUG]. Rows = [E1C1; E2C1; E1C2; E2C2]. % Each axes shows mean±SEM time courses for the 3 ages (as shades of the group color). % Requires: shadedErrorBar. % ---- configurati...
eaa31e2e07e6925a7ce16d603e0e33f19bd085856c5fed00d1c29cf4d57ce226
MATLAB
4,993
154
%% [chi] = Wrapper_QSM_QSMnet(localField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData) % % Input % -------------- % localField : local field map (tissue fields), in Hz % mask : signal mask % matrixSize : size of the input image % voxelSize : spatial resolution of each dimension of the dat...
61413c14c01842bccdc6b7c1e18db7e8c799f12cecbee4e2e592195c4079b39d
MATLAB
4,996
100
function significantResults = posthoclme(data, behavior, a, g, toi) data = permute(data, [1 3 2 4]); uniqueAges = unique(behavior.Age); uniqueGroups = unique(behavior.Group); significantResults = struct(); significantResults.Age = cell(size(data, 2), size(data, 3)); significantResults.Group = cell(size(data...
08c1b07a3beb74d532ad64fba4f4a0a29209e7324eaa805b00f6d1ee1eb7855c
MATLAB
5,001
148
function physio = tapas_physio_save_batch_mat_script(fileBatchM, pathOutput, ... doRemoveEmptyDefaults, doUpdateInputFileBatchM) % Saves .m-matlabbatch-file as .mat and as spm-independent matlab-script % % physio = tapas_physio_save_batch_mat_script(fileBatchM) % % IN % fileBatchM either .m-file of batch j...
61e3df8a3def46a5332a2b4ac803a8bc19bfa428d30681fd52c8766b654be779
MATLAB
5,005
142
function tapas_hgf_binary_mab_plotTraj(r) % Plots the estimated or generated trajectories for the binary HGF perceptual model for multi-armed % bandit situations. % % Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_binary_plotTraj(est); % % ------------------------------------------------------------...
aee76f5f47afad0a3a848eca9c37b68c347998e28a09342db6e5234c8bda5df5
MATLAB
5,008
129
% EEG_MULTIEEGPLOT - Produce an EEGPLOT of a the average of an epoched dataset % (with optional pre-labelling of specific trials). % Usage: % >> eeg_multieegplot( data,trialrej, elecrej, ... % 'key1', value, 'key2', value ... ); % Inputs: % data - input data (...
c2ec15725b2d7fe4884e3765ba2860da7f8131be16c92808b2271f8747112a60
MATLAB
5,009
134
%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, append, gray, quality) % % This function converts an eps file to pdf f...
41a69d7a8f7e8423a0af14d299846f4c7978b45eb4e8f6c3ce4f41a1893f92d8
MATLAB
5,011
166
% PROMAX - perform Promax oblique rotation after orthogonal Varimax % rotation of the rows of the input data. A method for % linear decomposition by "rotating to simple structure." % Usage: % >> [R] = promax(data,ncomps); % >> [R,V] = promax(data,ncomps,maxit); % % Inputs: % ...
46e749e70152e1d843fe9ae0a996852012ddf135858641e3e341e9f78566625c
MATLAB
5,012
126
% dipfit_nonlinear() - perform nonlinear dipole fit on one of the components % to improve the initial dipole model. Only selected dipoles % will be fitted. % % Usage: % >> EEGOUT = dipfit_nonlinear( EEGIN, optarg) % % Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 % Tha...
683930356b4a941fa861c155131ef8c08cc516c5d84e6b8fc38ea42004ea15fa
MATLAB
5,012
162
function [session_cnm,merged_ROIs] = merge_cnm_rois(session_cnm,dmin,merge_thr,deconv_options) %% modified from merge_neuron_dist_corr but simplified % - find pairs of ROIs that have highly-correlated activity (corr >merge_thr), and % - are close to each other (dist<dmin) % ZZ 2022 merge_thr_abs_raw = 0.65; % for ...
13c38554f7322a0bfe29c28baf19441dfbb1413d8d05878603c40d1243f52a5c
MATLAB
5,013
94
function [M P V] = smc_oopsi(F,V,P) % this function runs the SMC-EM on a fluorescence time-series, and outputs the inferred % distributions and parameter estimates % % Inputs % F: fluorescence time series % V: structure of stuff necessary to run smc-em code % P: structure of initial parameter estimates % % Outputs % M:...
d3d1db120c85bc9723cd875250690378a2631127be03f5d53589d89ef178d8e2
MATLAB
5,015
126
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method % for neuronal ensemble detection in spiking neural networks" % https://www.biorxiv.org/content/10.1101/2020.10.12.335901v1 % Rubén Herzog October 2020 clear;clc;close all; %% Parameters for raster T = 500; %Number of frames fr = 0.15; %Fir...
14047b16b94f78170ed5d58b77ced498150d2192514505d58e65578cb8c335e1
MATLAB
5,016
103
function ProcessData_ExtendedData9(datadir, savedir, codedir) %ProcessData_ExtendedData9 - Process raw data saved under datadir such that it can be plotted by PlotExtendedData9. % INPUTS: % datadir - Local directory where 'Golden_Nature/RawData_ExtendedData9.mat' from Zenodo was saved % codedir - Local directory wh...
dc03032ad15ec309dde84269c7b79c80931af8aaa5ebbde92ea6f797136c8865
MATLAB
5,016
127
%% %%%%%%%% Perform prf analysis % NOTE: we want to use the vanilla analyzePRF, so we do this and check our version rmpath(genpath('/home/stone/kendrick/code/analyzePRF/')); which analyzePRF -all % using parpool? parpool(16); parpool(12); parpool(8); % do the FULL analysis [possibly farm out to different machines!] ...
e3971fcbbca1852ccdf8121c4e5cd9cccb3a164a083e9d4d711f6e7e78fe41d3
MATLAB
5,017
174
function Meta_Study_Table(DB,varargin) % function Meta_Study_Table(DB,['study']) % % Prints text table of all independent contrasts for export % % looks for Study or study field in DB (also takes clusters, cl) % determines length, and looks for other fields of the same length % uses specified fields in a particular ord...
19a8316657482f2f658803bddf94634e8280a95a603050fe2fc93183758e101f
MATLAB
5,018
121
function [G,Sig]=crossvalIPM(B,partition,conditionVec,X) % function [G,Sigma]=crossvalIPM(Y,partition,conditionVec,X); % Calculates the crossvalidated inner product matrix (IPM) between activation patterns % (estimated beta weights) from the first level analysis. The IPM is calculated % by using data across partition...
1d2ac05865e2a5e8987f8501d6e4f083e84acbd6abc0e3ce6155b615e7efaf95
MATLAB
5,018
135
function PlotColorMap(data,dimm,opt) %PlotColorMap - Plot a color map. % % Plot a color map (e.g. the firing field of a place cell). % % USAGE % % PlotColorMap(data,dimm,<options>) % % data data % dimm optional luminance map % <options> optional list of property-value pairs (see ...
54e717f0d7a9db39bceb63f310683427ed1cb888c3a76215e6a4206428589467
MATLAB
5,018
129
function fixationTargets = setFixationTargets(cfg) % % fixationTargets = setFixationTargets(cfg) % % Set fixation targets in a matrix of ``nbBlocks`` by ``nbEventsPerBlock`` with some rules: % % - if there are 2 targets per block we make sure that they are at least 2 events apart % - targets...
d6a1d52938174e2350703967168111d6a3eb2bbded1226ba77749ef5ed8cab6f
MATLAB
5,018
136
function ch2roi_plot_allFreq_subjMean(GRUP, groupInfo) % groups channels into defined ROIs (anatomic areas), averages & plots % FIG: % - subplots = freqBands x ROIs % - 1 subplot: time x clz % based on the following criteria: % - selected anatomical areas (groups) % - selected freq. band % - significance (di...
24b9c4cb91a05073f06718fdbad315f9ef6b47950b7c26034c8225578b591ba2
MATLAB
5,021
253
function ignore = ignorefields(purpose) % IGNOREFIELDS returns a list of fields that can be present in the cfg structure that % should be ignored at various places in the code, e.g. for provenance, history, % size-checking, etc. switch purpose case 'appendtimelock' ignore = { 'cfg' 'dimord' '...
f82230b5648e126f1dbecca6c9fb5357a8c067a2a3dac9d59fc820db2d698bce
MATLAB
5,024
177
function [err, ErrMessage] = WriteBrikHEAD (FileName, Info) % % [err, ErrMessage] = WriteBrikHEAD (FnameHEAD, Info) % %Purpose: % Create the header file for an AFNI Brik % % %Input Parameters: % FnameHEAD the name of the header file % Info, a structure detailed in function BrikInfo % %Output Parameters: % err...
f678409db459ac4b2488b6ef0bfc20c4f57269cff10d710035674cb4a26f2dff
MATLAB
5,026
122
function [plotStat, flattenedCortex] = flattenCortex () addpath ('/usr/local/netgpu/fluoMouseBrain/scripts/utils/') %imFlattenCortexLine = imreadstack('ORL_ARA_v2.3_bi_cortexFlattenLines.tif'); % generated using extractCorticalLayers.m imFlattenCortexLine = imreadstack('/home/kannanuv/workspace/code/cortexFlatten/ORL_...
fd2fcf01c3191427a78a83844a1667fe862ade90370d1813844f8242efaa9535
MATLAB
5,026
138
function foundHandles = find(obj, nameClass, varargin) % Finds all (handle) object properties whose class and property % values match given values % % foundHandles = obj.find(nameClass, 'PropertyName', % 'PropertyValue', ...) % % % IN % nameClass string with class name (default: MrCo...
44c57bd611f6082dd2a3860b7715ad1ba5f9a6483c37c64f428ff9666b56b74b
MATLAB
5,027
130
function ft_hmri(file_t1w, file_pdw, file_b0, file_b1, pathHMRI_defaults, ... pathHMRI_b1_defaults) % hMRI processing % % ft_hmri(file_t1w, file_pdw, file_b0, file_b1, pathHMRI_defaults, ... % pathHMRI_b1_defaults) % % Inputs: % file_t1w - cell array of multi-echo t1w data set. % file_pdw ...
4e186a2f5af1513efab60278c782ee19398eb7ba2d9a0c3618191487b56f3dd2
MATLAB
5,028
134
function newTarget = ReplaceWithGoodies % Function sorts through SelectedVectors to use library of top scoring % vectors to replace poorly scoring vectors instead of randomly generated % replacement vectors. global numFact run lastGoodies numDose scoreProxThresh intraVarAlgo interVarAlgo global SelectedV...
0b519893466ecd23de72ea4b9fa04272d4792c149848ffd63dfe52dbe4c3c2bf
MATLAB
5,030
136
function [adjM, adjMci] = adjM_thr_parallel(spikeTimes, method, lag_ms, tail, fs,... duration_s, rep_num) % This function generates synthetic spike times from original % events and randomizes them using circular shift. All synthetic data is % created from existing events. % % It then averages the functional connect...
cfce67259cde0dab36ca824b665320f134865cc59027290d654489f61c0adab5
MATLAB
5,031
129
function [X, A] = PCA_stochastic(A, k) % Example of stochastic gradient algorithm in Manopt on a PCA problem. % % PCA (principal component analysis) on a dataset A of size nxd consists % in solving % % minimize_X f(X) = -.5*norm(A*X, 'fro')^2 / n, % % where X is a matrix of dimension dxk with orthonormal columns....
b298b7103e31935c54696806fcff34f682f6e2a418ad0001b428bae5af54a68d
MATLAB
5,032
126
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method % for neuronal ensemble detection in spiking neural networks" % https://www.biorxiv.org/content/10.1101/2020.10.12.335901v1 % Rubén Herzog October 2020 clear;clc;close all; %% Parameters for raster N = 100; %Number of neurons fr = 0.15; %Fi...
2f90716424771c6bb919ca0006296745a923c869ca983628535826dfe386eb68
MATLAB
5,034
138
% STD_READSPECGRAM - returns the stored mean power spectrogram for an ICA component % or a data channel in a specified dataset. The spectrogram is % assumed to have been saved in a Matlab file, % "[dataset_name].datspecgram", in the same % director...
54c6be461f8780bf76c62f3902b7e84dc357319aea43ad7b9b618b3c1f9a9bca
MATLAB
5,036
120
% Analyse behvioural responses % % For all those subjects where they have been recorded, calculate responses % to the task. clear; clc; warning('off'); % % add spm to the path % initiate bidspm % Initialize report % Start a new report report = {'subject','run','trial_type','keyPress','response_type'}; reportExtr...
110ef35426bb0b02a892791445be666dec09101948b24aa1aeda18bc904a2c04
MATLAB
5,039
139
function ConnFuncHomo CUTNUMBER=100 % path = '/home/NCPL09/Desktop/MRIDATA/ReseachPlan/Autism/analysis_fun/FunImgARWCSF' % outdir = '/home/NCPL09/Desktop/MRIDATA/ReseachPlan/Autism/analysis_fun/tongji/FHC' path=uigetdir; outdir=uigetdir; sublist = dir (path) [TMSPath, fileN, extn] = fileparts(which('TMStarget.m')) ; ...
95ea998568370a11ac878fee9dd5d5cd0c91cabdf9d6986198044043bf5796de
MATLAB
5,040
135
function [delta_rats, E2_rats, ratlist_elisa] =... Estradiol_vs_DeltaInit_bystage(ratlist,... SerumTable, SerumBehData, detrend_arg) %relate change in estradiol expression to change in delta initiation times, ie "behavioral sensitivity" (pro - %di) only for sessions with blood samples %calculates mean concentra...
78f55c427f119f245469a8fbd51962b86402a41adfb342d74219f099ae03957b
MATLAB
5,041
162
%% sepia_addpath(method) % % Description: remove all SEPIA related directories from PATH and add % only the directory(ies) related to the input 'method' % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 10 April 2018 % Date modified: 24 August 2018 % Date modified: 5 June 2019 % Date modified: 9 June 20...
a2340402c9e58301571120157185d102ac666561ec43ac7b32283d95b99355d5
MATLAB
5,042
105
% STD_RENAMECLUST - Commandline function, to rename clusters using specified (mnemonic) names. % Usage: % >> [STUDY] = std_renameclust(STUDY, ALLEEG, cluster, new_name); % Inputs: % STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. % ALLEEG - global EE...
d27efbef9323d416db63a827ea37062761dbbcb42ed506170d41471c65206560
MATLAB
5,042
154
clc; clear; addpath('/cbica/home/lihon/code/Download/cifti-matlab-master'); num_r = 400; mat_dir = '/cbica/home/lihon/comp_space_recover/ABCD_comp/dl_prediction/data_cog_hcpd_cv_combined'; res_dir = ['/cbica/home/lihon/comp_space_recover/ABCD_comp/dl_prediction/pred_res_cog_abcc_bl_cv/non_dl_hcpd_res_r', num2str(nu...
df6572ca11e78dc649f10cbfb6e3c36470144634b0c1e3ad4f1910e270121ec2
MATLAB
5,042
139
function [coherence,phase,f,sc,sp] = MTCoherence(lfp1,lfp2,varargin) %MTCoherence - Compute LFP coherence by multi-taper estimation. % % The coherence is computed as the average coherogram, using the <a href="http://www.chronux.org">chronux</a> toolbox. % % USAGE % % [coherence,phase,f,sc,sp] = MTCoherence(lfp1,l...
eccecd0776a3ff62324e4ff961002c69c71d0f9453efb0c1b47030623c28b5d2
MATLAB
5,043
136
function data = DVV_dvv(x, m, Nsub, nd, Ntv) % Delay Vector Variance method for real and complex signals % % % USAGE: C = dvv (X, m, Nsub, nd, Ntv) % X original real-valued or complex time series % m delay embedding dimension % Ntv number of points on horizontal axes % Nsub number of reference DVs to co...