sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
60a05803c1173e6d9d9be0c1c16af5cd4b7877136083cdee1a66c0bedcfeeaf3
MATLAB
5,326
149
%% Basic Image Visualization %% % Using Basic Plot Methods (plot, orthviews, and montage) to Examine a Dataset % % Objects can have methods with intuitive names, some of which overlap % with names of functions in Matlab or other toolboxes. fmri_data.plot() % is one of these. When you call plot() and pass in an fmri_da...
0bc57e208589e8f409ced3db456bbe3330ce37625aff922ffb9a7058538de8df
MATLAB
5,327
162
% pop_comments() - edit comments % % Usage: % >> newcomments = pop_comments( oldcomments); % >> newcomments = pop_comments( oldcomments, title, newcomments, concat); % % Inputs: % oldcomments - old comments (string or cell array of strings) % title - optional window title (string) % newcomments - new co...
5570d39995eb2ec3993da786e8116e1cf0991efdca308e40bcce9f2ca3103329
MATLAB
5,327
126
function mismatched_parcels = CBIG_hMRF_find_parcels_mismatched_topology_indirect_nbors(lh_full_label,... rh_full_label, threshold, expansion_steps, mesh_type) % mismatched_parcels = CBIG_hMRF_find_parcels_mismatched_topology_indirect_nbors(lh_full_label,... % rh_full_label, threshold, expansion_steps, mesh_type) ...
acc739d8a75d6758cd28ad9c49fb4657e19965da0d54e2f830d8c25f9403b950
MATLAB
5,336
103
function [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpt(data,win,params,segave,fscorr) % Multi-taper segmented spectrum for a univariate binned point process % % Usage: % % [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpt(data,win,params,segave,fscorr) % Input: % Note units have to be consistent. See chronux.m for more i...
d02397a1295e065169478eec42e956175fc4a630ffac894419d85678d5b5a15d
MATLAB
5,336
204
function [kcMax,A0,d0,d] = getDcorr1D(sig,r,Ng,figID) if nargin < 4; figID = 0; end if ischar(figID) figID = 0; fastMode = 1; else fastMode = 0; end if nargin < 3; Ng = 10; end if nargin < 2; r = linspace(0,1,50); end % input check if length(r) < 30 r = linspace(min(r),max(r),min(30,(numel(sig)+1)/2)...
f2f22f14538b44f2cc725227d5d3b5d5357f8e412210a91dc8917bcdf9def030
MATLAB
5,336
118
ccc; RAWDATAPATHs = dir("..\MAT Data\raw\**\7-10Freq Passive\**\*.mat"); % Date filter DATESTRs = {'cc20220520', 'cc20220801', 'cc20221014', 'cc20221015', ... 'xx20220711', 'xx20220820', 'xx20220822', 'xx20220913'}; RAWDATAPATHs = RAWDATAPATHs(contains({RAWDATAPATHs.name}, DATESTRs)); MATNAMEs = {RAWDATA...
c03fe1b4883a340356aee68da9f32c91832529a5c0642530607a09549abe6596
MATLAB
5,337
207
% Load NIFTI header extension after its header is loaded using load_nii_hdr. % % Usage: ext = load_nii_ext(filename) % % filename - NIFTI file name. % % Returned values: % % ext - Structure of NIFTI header extension, which includes num_ext, % and all the extended header sections in the header extension. % ...
dcd273675a30534ca16bbe9a0f375e104b7514315cf299428e340541e77c7bb8
MATLAB
5,339
142
function ea_run(cmd, options) % This function is the main execution function of Lead-DBS. It is % distributed within Lead-DBS toolbox (www.lead-dbs.org) % __________________________________________________________________________________ % Copyright (C) 2016 Charite University Medicine Berlin, Movement Disorders Unit %...
3078ef236a1932acd6602646b668c3ef1016ffd4f0d679b279fc4ec7f7b161e9
MATLAB
5,344
156
function hFig = plot_brain_mesh_regions(p, e, brain_nodes_idx, roi_maps, roi_centers_mm, roi_names, varargin) %FNIRSPOWER.MEASPRED.PLOT_BRAIN_MESH_REGIONS % Plot brain mesh (iso2mesh) and optionally overlay ROI maps + ROI centers. % % Required % p : nNodes x 3 node coordinates % e : ...
6027c4b62bd1548fbdcf1b72f63541113522c0a6593a9acceaa08814c898c21c
MATLAB
5,345
182
function varargout=subsref(obj,subs) % SUBSREF Subscripted reference % An overloaded function... %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: subsref.m 6804 2016-06-08 16:58:48Z john $ if isempty(subs), return; end s...
e0af7cf6e2aed2dc2ea99e3df8c7c1f9b1d76243ffcb92697727f89ac692699a
MATLAB
5,345
99
function [Fval,A,f,sig,sd] = ftestc(data,params,p,plt) % computes the F-statistic for sine wave in locally-white noise (continuous data). % % [Fval,A,f,sig,sd] = ftestc(data,params,p,plt) % % Inputs: % data (data in [N,C] i.e. time x channels/trials or a single % vector) - required. % ...
07854f2b4ab98dbe4d71db0ae4d0623e77f8eef9cb419fd18fd73cd45c4b6ca3
MATLAB
5,346
121
% % animals = {'3xTg136' 'WT162' 'WT78-0' '3xTg75-1' 'WT77-0' '3xTg79-0' 'WT89-0' 'WT98-0' '3xTg77-1' 'WT158' 'WT153' 'WT157' '3xTg125' 'WT126' 'WT45-1' 'WT45-2' 'WT47-0' '3xTg48-0' '3xTg49-2' '3xTg49-1' 'AD-WT-1-0' '3xTg1-1' 'WT159' 'WT105-0' 'WT69-1' 'WT173' '3xTg165' '3xTg177' '3xTg148-1' 'AD-WT-44-1' '3xTg132' 'W...
1a0b92f5e3e5f1fcb53c82ac8810d76e7c5892054416a58be29b0c1a0ba65b75
MATLAB
5,346
168
% icaproj() - project ICA component activations through the % associated weight matrices to reconstitute the % observed data using only the selected ICA components. % Usage: % >> [icaprojdata] = icaproj(data,weights,compindex,[datameans],chansout); % % Inputs: % data - data matrix (ch...
890aed453332391ecdaee2259dc5ecfe41fcd6f8ccfb7b83db4380d160c8a98c
MATLAB
5,346
126
function out = impexp_run_ftrstruct_Curves2dx(job,cmd) % Query an ftr_struct and extract some fiber sets in a format suitable for % import by fancy_render. % Structure of job: % job.ftr.ftrname{1} - file name % or .ftrstruct - ftr struct % job.fibers.all - all fibers % or .index - vector of fiber indi...
a9a8a83b8544fcdfb2a7cddcdfb1490c25962ce4962f68c69ccf2797477e2abc
MATLAB
5,346
167
function T_S_C_p = CBIG_blAge_edu_amyloid_apoe_disDura_onsetAge(subInfoFile, GMICVFile, K, Q, dx) % T_S_C_p = CBIG_blAge_edu_amyloid_apoe_disDura_onsetAge(subInfoFile, GMICVFile, K, Q, dx) % Which quantity? Q % 1 for baseline age, 2 for edu, 3 for amyloid, 4 for APOE-2, 5 for APOE-4, % 6 for disease duration, 7 for on...
e19694900610b9a3fa7e3f06ce4873a3cb29b5aa8472b4b459f78f28c33330a8
MATLAB
5,346
89
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegcpt(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra computed by segmenting % two univariate time series into chunks - continuous and point process stored as times % % Usage: % [C,phi,S12,S1,S2,f,zero...
e4d0cc611d2d516a94366edaf6730f314b8a3eaea39ceb64c830e898982d6b15
MATLAB
5,346
173
function h = qqPlot(varargin) %QQPLOT Quantile-quantile plot with patch option % % IOSR.STATISTICS.QQPLOT(Y) displays a quantile-quantile plot of the % sample quantiles of Y versus theoretical quantiles from a normal % distribution. If the distribution of Y is normal, the plot will be % close to linear. % % ...
4f89575402ff221a6b6233bb3e20cc11993dbdda33595c85ea9f69f45640c042
MATLAB
5,348
152
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
65e96eb086260ef598a6f86f9e6e1623c0f8c4e73f447429faef3fd40f0f0ba6
MATLAB
5,351
103
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencypb(data1,data2,params,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra - binned point process % % Usage: % % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencypb(data1,data2,params,fscorr) % Input: % data1 (in form sam...
f3f4d211991395460867d9a06f397053835399fe395cc27e22cff05fb48434a5
MATLAB
5,351
205
function [fft_data,varargout] = TDTfft(data, channel, varargin) %TDTFFT performs a frequency analysis of the data stream % [fft_data, fft_freq] = TDTfft(DATA, CHANNEL), where DATA is a stream % from the output of TDT2mat and CHANNEL is an integer. % % fft_data contains power spectrum array % fft_freq...
e9f1cdcddbc9a9c27f6ae475910fc028ef118372a7a23c6c5527ee6942a7c4ee
MATLAB
5,354
145
% 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...
fe8c4b78bb30972baa554a260d93160962c88aee0abcdfe8d9126fbd776f53b7
MATLAB
5,358
196
% Iterations over different thresholds, kappa_p and NB initial perimeters. % Plotting success and max E-level heatmaps shown in Figure S4 % To speed up comment line 79 in % SOP_multicell_LI_adapted_weighted_with_trigger_PerimSave.mat before % running this script to avoid saving simulations movies for each % iteratio...
3dda71f2c93e637175cccb24b3b26e6e54780ac1cacc7d9240feb8416bb5f459
MATLAB
5,362
119
%% Temporal changes of correlations load y2_tw; % Load time window information for i_block = 1:2 % 1: movie, 2: shuffled movie if i_block == 1 load('x2_corr_movie.mat'); else load('x2_corr_shuffle.mat'); end [n_ses, temp] = size(x2_corr_CA1); n_tr = (temp - 1) / 2; % ...
b53428af6bfb0a323ce80a4d39b1ac7b9f96eedc87a49d62069e43324334c0e4
MATLAB
5,364
103
function [heights, widths, peak_locs, mask] = thresholded_peaks(spikes) % THRESHOLDED_PEAKS Finds height/width of threshold crossing peaks. % [HEIGHTS, WIDTHS] = THRESHOLDED_PEAKS(SPIKES) takes a spike-sorting % SS object SPIKES with M spikes and returns two (M x 1) vectors % HEIGHTS and WIDTHS, containin...
c1a573c25dd1e5b33e89141d32e9675fb08104cba7e2996877e4caaa8bfee752
MATLAB
5,366
152
%% Atlas 2012 behavioral data plot % This example shows how to plot line plots for multiple conditions with % error bars and calculate and plot violin plots for contrasts, with % missing data. %% General instructions % % Before you start, the CANlab_Core_Tools must be added to your path with % subfolders. Otherwise, y...
37b8861e8e84468aeeb941655852818d87f739c47b11150ceef68096743acee7
MATLAB
5,372
152
% snapread() - Read data in Snap-Master Standard Binary Data File Format % Reads Snap-Master header and data matrix (nchans,nframes). % Ref: Users Guide, Snap-Master for Windows (1997) p. 4-19 % Usage: % >> data = snapread(filename); % read .SMA file data % >> [data,params...
a49cfef3e5114b0638bd050e74c7717b276cb4f551593c7a8a29b7376a8e8db6
MATLAB
5,372
145
% pop_chansel() - pop up a graphic interface to select channels % % Usage: % >> [chanlist] = pop_chansel(chanstruct); % a window pops up % >> [chanlist strchannames cellchannames] = ... % pop_chansel(chanstruct, 'key', 'val', ...); % % Inputs: % chanstruct - channel structure. See readl...
feaacde819e7c581d78a82896d0ea052c825dc9f6ad7c5233bed46cf1211a96f
MATLAB
5,373
142
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Generate Whole-Brain and Thresholded GMV Weight Maps for CCA Modes % Author: Yuan Zhang % Date: 2025-07-25 % % Description: % This script generates NIfTI brain maps and thresholded maps % for both math- and reading-related modes, across both C...
84f247e1678b5ec8f462c004f42d9ef6692636e4949449dbffc42b5ab7d14168
MATLAB
5,375
138
function [res,pars]=inf_perform_regularized_crossvalidation(k,irep,mesh,ID,X,F_prime,L,o_keep_all_trajectory... ,o_force_constraint,constraint_algorithm,o_use_initial_guess,nCores) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers dynamical systems models...
716bf4894de2916be80d532badb62393df610464365fa37c35ea5e68cb4a04a9
MATLAB
5,376
114
% std_readcustom() - Read custom data structure for file save on disk. % % Usage: % >> data = std_readcustom(STUDY, ALLEEG, fileext, 'key', 'val', ...); % % Required inputs: % STUDY - an EEGLAB STUDY set of loaded EEG structures % ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures ...
048d1ab7bf5641d76ecd5644acc0426b04f826c750f957dab7f8bf42040e37be
MATLAB
5,378
90
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegcpb(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra with segmenting % computed by segmenting two univariate time series into chunks - continuous and binned point process % % Usage: % [C,phi,S12,S1,S2,...
1483b130da2574e33622d71cd40dc5a8e173b1f8a41dcc39c41db3a87660936d
MATLAB
5,378
137
function saveNEVSpikes(spikeStruct, newFileName) % saveNEVSpikes % % Allows the user to save a modified version of the spike waveforms into a % NEV file. This can be very useful for those who want to save MATLAB % sorted or rethresholded NEV data back into the NEV file. It also re-saves % the other data in the origi...
d79be20f161629e832a3972fc29e7cecbd2b5f5d2662f52fd8f684b166645c5e
MATLAB
5,378
138
function mmse = CBIG_get_mmse(rid_of_interest, predementedOnly) % mmse = CBIG_get_mmse(rid_of_interest, predementedOnly) % Fetch MMSE scores from .csv files % % Input: % - rid: the RID's of subjects of interest % % Output: % - mmse: 1st col is RID, 2nd is VISCODE, 3rd is EXAMDATE, 4th is score % % Written by CB...
4c66cc6a57d84ddfb7a4fb47e6ab3c153995da2a884103c8916c4ac8c9bab08f
MATLAB
5,384
153
function [cell_metrics] = bz_CellMetricsSimple(spikes,sr) % [cell_metrics] = bz_CellMetricsSimple(spikes,sr) % Calculate waveform and ACG metrics to use for unit classification % % USAGE % % [cell_metrics] = bz_CellMetricsSimple(spikes) % % INPUTS % % spikes = buzcode spikes structure (i.e. from bz_LoadPhy) % ...
bfcad12563429d3a601e723c204b529ed9613495191d1970eed650f4cb3d5536
MATLAB
5,384
251
% Return orientation of the current image: % orient is orientation 1x3 matrix, in that: % Three elements represent: [x y z] % Element value: 1 - Left to Right; 2 - Posterior to Anterior; % 3 - Inferior to Superior; 4 - Right to Left; % 5 - Anterior to Posterior; 6 - Superior to Inferior; % e.g.: % Standard RAS Or...
b7cfd336497a681857a58635872c130fb3aab8ca21c32a4db3137fa89d296fa8
MATLAB
5,385
145
function savexml(filename, varargin) %SAVEXML Save workspace variables to disk in XML. % SAVEXML FILENAME saves all workspace variables to the XML-file % named FILENAME.xml. The data may be retrieved with LOADXML. if % FILENAME has no extension, .xml is assumed. % % SAVE, by itself, creates the XML-file nam...
311d68b2d5b27b956283b03832365f832e9e4a6923b0884022c0ab2428978586
MATLAB
5,388
163
function [dv, regcorr, regdata] = phase_reg(data, refImg, ops) % modified by Yiyi Yu if nargin==3 subpixel = ops.SubPixel ; usFac = ops.registrationUpsample; useGPU = ops.useGPU; % if you can use a GPU in matlab this accelerate registration approx 3 times phaseCorrelation = ops.PhaseCorrelation; % set t...
621107efc71ea9e759176faca02bb32f88f72ea45f53a7bc5b85e49e8cdb0237
MATLAB
5,388
142
function CBIG_MMLDA_zscore_hist_wrapper(out_dir) % CBIG_MMLDA_zscore_hist_wrapper(out_dir) % % Wrapper function to plot the histogram of zscores. % % Input: % - out_dir : output directory % % Example: % CBIG_MMLDA_zscore_hist_wrapper('~/example') % % Written by Nanbo Sun and CBIG under MIT license: https://github...
db072419de425e69ccae5b8dc2412bc79925c0aa8396c0f8f270eb2a448ee617
MATLAB
5,391
103
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencycpb(data1,data2,params,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra - continuous and binned point process data % % Usage: % % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencycpb(data1,data2,params,fscorr) % Inputs: % da...
0e6685bb2e22b2a1ccac828e51eaec0542b767df9268c145798827ba41d05f6a
MATLAB
5,394
247
function trainmodel %% %scheme = evalin('base','scheme'); % d1 = 0.5+(0:0.05:1)*2.5; % d2 = 0+(0:0.05:1)*3; % d3 = 0.15+(0:0.05:1)*2.5; % v = 0:0.05:1; % [D1 D2 D3 V] = ndgrid(d1,d2,d3,v); nt = 2*10^4; D1 = 0.5+rand(nt,1)*2; D2 = 0.5+rand(nt,1)*2; D3 = 0.2+sqrt(rand(nt,1))*2; D1 = D2+D3; V = rand(nt,1)*1; Vw = (1-V).*r...
a7639cd2ca07fc6046ba8c66218ded8d9f49e7118dc4d78d6fd724ad71044156
MATLAB
5,398
150
function oimg = loadtiff_old(path, sFrame, num2read) % Copyright (c) 2012, YoonOh Tak % All rights reserved. % Modified by Eftychios Pnevmatikakis, 01/2017. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are % met...
51dc6f25fa056466026b3c1a1d3df762380eabc096a69fb69ba48aaf26a7c24f
MATLAB
5,399
157
function [bn,burstiness,mburstf,mibsn,mbl,mibfr,mibif,burstf,ibsn,burstlen,ibfr,ibif,bp,normbnbdiff,burst,burstspikes,nonburstspikes] = burst_cls_kmeans(segspikes,sro) % K-means clustering of ISIs tivs = cell(1,size(segspikes,2)); ivnum = zeros(1,size(segspikes,2)); segfirstiv = zeros(1,size(segspikes,2)); seglastiv =...
f457e33ce69bd08b5d5dff01359b99ccd43ff8da93e0ca36304c1d212edb3820
MATLAB
5,400
172
function bestModel = CBIG_visualizeFactors(initFolders, GMMask, outDir) % bestModel = CBIG_visualizeFactors(initFolders, GMMask, outDir) % % This function selects the best random initilization (that gives the % highest likelihood) and visualizes the estimated factors as probabilistic % atrophy maps. % % Input: % -...
1608f946b7fc495c8ddce334e7596b8b2d3727dc0810d507e85c7ce8799c2ce6
MATLAB
5,401
151
function [dz,vdz,Adz]=two_group_test_spectrum(J1,J2,p,plt,f) % function [dz,vdz,Adz]=two_group_test_spectrum(J1,J2,p,plt,f) % Test the null hypothesis (H0) that data sets J1, J2 in % two conditions c1,c2 have equal population spectrum % % Usage: % [dz,vdz,Adz]=two_sample_test_spectrum(J1,J2,p) % % Inputs: % J...
5cfe2264b02f1761b2e5431a5bf8ac129f64e8a045d42640c68841c18172ba7c
MATLAB
5,403
127
function [maps,data,stats] = bz_RippleStats(filtered,timestamps,ripples,varargin) %RippleStats - Compute descriptive stats for ripples (100~200Hz oscillations). % % USAGE % % [maps,data,stats] = bz_RippleStats(filtered,timestamps,ripples,<options>) % % filtered ripple-band filtered samples (one channel) %...
29bf9bc913ec1246fd5e0adb680a9e658397c3ab256ac8caae0b24fcb8dd6e3e
MATLAB
5,404
174
function [ccg,t] = CCG(times,groups,varargin) % %CCG - Compute multiple cross- and auto-correlograms % % USAGE % % [ccg,t] = CCG(times,groups,<options>) % % [times] [times of all events % NOTE: spiketimes in SECONDS] % [groups] [group IDs for each event in time list (should be %...
46d85d693377623057dd9e18d63d6bbf33efd47d77d09bffc45a3f5eb1d00101
MATLAB
5,404
136
clc clear % Load intensity data from Excel files into the raster cell array raster{1,1} = xlsread('intensity-14_a_1.xlsx'); raster{1,2} = xlsread('intensity-14_a_2.xlsx'); raster{1,3} = xlsread('intensity-14_a_3.xlsx'); save original_data %% ExpT = length(raster); % Number of experiments/time points [~, CellNum] = si...
4bff1ee7c7a97c6f4ff68a128d5734593a5c9e76760b5151b415c454f30b1e5b
MATLAB
5,405
160
function disp( prob, prefix ) if nargin < 2, prefix = ''; end global cvx___ p = cvx___.problems( prob.index_ ); if isempty( p.variables ), nvars = 0; else nvars = length( fieldnames( p.variables ) ); end if isempty( p.duals ), nduls = 0; else nduls = length( fieldnames( p.duals ) ); end neqns = ( len...
90f1f8be030a8a9bc9666a42d224df78ce3032e0fc4cf803b8b3b5f408f7a75d
MATLAB
5,405
135
% demo for SingleRoomDRIR: save DRIR data from Uni Oldenburg (Office II) as % SOFA file and plot the speaker and listener positions. % It uses conventions SingleRoomDRIR and RoomType 'shoebox', defined by % RoomCornerA and RoomCornerB. % SOFA API - demo script % Copyright (C) 2012-2013 Acoustics Research Instit...
b30c71a64c7bf83b2dcce68cd63d398b5cfb02a0face7ebd0fbb988efaa98758
MATLAB
5,405
154
% Maximize stopband attenuation of a bandpass IIR filter % "Linear Programming Design of IIR Digital Filters with Arbitrary % Magnitude Functions" by L.R. Rabiner, N.Y. Graham, and H.D. Helms % (figures are generated) % % Designs a bandpass IIR filter using spectral factorization method where we: % - minimize maximum ...
17abb7496498d29c2b176de8a0478ccaf72785bd7714e6d0dce3f25e1152b37d
MATLAB
5,406
110
function [hdr] = read_nifti2_hdr(filename) % READ_NIFTI2_HDR % % Use as % [hdr] = read_nifti2_hdr(filename) % where % filename = string % % This implements the format as described at % http://www.nitrc.org/forum/forum.php?thread_id=2148&forum_id=1941 % % Please note that it is different from the suggested f...
219b5aeb3910f9bac99ede05f8f3342e7a06227cfabed1d1dc4996502397bbd4
MATLAB
5,406
198
function decline = CBIG_hypoTest_3t_withinFactorAcrossStages(stats) % decline = CBIG_hypoTest_3t_withinFactorAcrossStages(stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md beta = stats.Bhat; betaCov = stats.CovBhat; decline = zeros(9, 3); fprintf('\n\n****...
9d0644aab88632d785a2dca7a06e016ddce04502114aae846457d7ea00e1de3e
MATLAB
5,406
119
%% Description % This script does further preprocessing after trial % exclusion, trial classification, and ICA. % Four steps are included in this procedure: % 1. Common average referencing (CAR) % CAR re-references data by subtracting the common % average of trial data from channels of the same % a...
eb0e0d80efc7804e8d11acd913265182b548dbcaf40a16804129666898b51838
MATLAB
5,407
182
function [xymax,smax,xymin,smin] = extrema2(xy,varargin) %EXTREMA2 Gets the extrema points from a surface. % [XMAX,IMAX,XMIN,IMIN] = EXTREMA2(X) returns the maxima and minima % elements of the matriz X ignoring NaN's, where % XMAX - maxima points in descending order (the bigger first and so on) % IMAX - li...
5a70cd04b3bd629be025a9a1b769233a749a9e5ec81b32ccf23ab4bbdb2ee9f9
MATLAB
5,412
126
%% Load data for Fig 2a load data_fig2a.mat %% Anosmic % Calculate spectrogram on odor vs. air trials - anosmic ts = data_fig2a.lfp_anosmic; sniffonset_conds = { data_fig2a.sniffonsets_odor_anosmic, data_fig2a.sniffonsets_air_anosmic }; para = []; para.freq = logspace( log10( 1), log10( 200), 100); % center frequenci...
651639ee2e44adf954f19e1452c7d5541de5bb44de6a0bde8eff79ce70476573
MATLAB
5,414
160
%% to make {pfntype}_img&beh_250909-19_FlightDuringStim.mat bank = []; for a = 1:length(allflies) if mean(allflies(a).flightstates_corr(9000:20000))>7.9 bank = [bank,allflies(a)]; end end %% to make {pfntype}_img&beh_{dates:yymmdd-dd}_NoFlightDuringStim.mat hanging = []; for a = 1:length(allf...
5985944b2db3f46e8c589a2f4de0cac098c98c40311902e9d10768fdd449d3b8
MATLAB
5,417
118
function [outlierLabelVect] = labelOutliersFrMat(dataMat, neighborNum, k, exclCol) %LABELOUTLIERSFRMAT reads n-rows of observations with m-cols of propertiese and label which observation (row) is an outlier % %SYNOPSIS: [outlierLabelVect] = labelOutliersFrMat(dataMat, neighborNum) % %INPUT: dataMat: (matrix) data...
6e26cf30ac22b942b2aadf9b8181c3b913e360ffb31696930511e853727d85b4
MATLAB
5,420
139
function plotBiphasicLines(TRI, motionType, propVect, threshTab, cellNo, figStr, scalingFactor) %PLOTBIPHASICLINES: plot the fit lines for an individual cell from threshold and scatter data % %SYNOPSIS: plotBiphasicLines(TRI, motionType, propVect, threshTab, cellNo, figStr, scalingFactor) % %EXAMPLE: plotBiphasicLines(...
52c96fc3e18ffdee97536d3c8451cfbcab70a8ec5a98c417e1edfd48f4d9436d
MATLAB
5,422
135
%%******************************************************************** %% infeaspt: generate an initial point for sdp.m %% %% [X0,y0,Z0] = infeaspt(blk,At,C,b,options,scalefac); %% %% options = 1 if want X0,Z0 to be scaled identity matrices %% = 2 if want X0,Z0 to be scalefac*(identity matrices). %% %% SDP...
18883ccd21cec8f4fe6b0696c2e883dd701287b3546633dd41c3283bf66f56dd
MATLAB
5,423
168
% eeg_store() - store specified EEG dataset(s) in the ALLEG variable % containing all current datasets, after first checking % dataset consistency using eeg_checkset(). % % Usage: >> [ALLEEG EEG index] = eeg_store(ALLEEG, EEG); % >> [ALLEEG EEG index] = eeg_store(ALLEEG, EEG, index)...
5f8722e810a7181be5bbb6e8d428dbfff05d92dd2f49cdcefe8a60bb0f8648fb
MATLAB
5,423
177
function varargout = getDatAndVideoSessionInfo(fb,forceRegenerate) % TSPS = dir('*tsp'); metas = dir('*.meta'); if ~exist('forceRegenerate','var') forceRegenerate = 0; end if length(metas) > 1 if forceRegenerate if FileExists([fb, '-metaInfo.mat']) movefile([fb, '-metaInfo.mat']...
7cd55635ad4af912a26ac9a146697a95350045b271576a4196574c28396065b9
MATLAB
5,423
115
plugin_find_master_script_directory; %% SUMMARY % Load and print summary of study from study_info.json and contrast info % ------------------------------------------------------------------------- scriptname = which(fullfile(masterscriptdir, 'core_scripts_to_run_without_modifying', 'b_reload_saved_matfiles')); run(sc...
01d783e36d919821fb2ce3f65f39ca4196c8ae2004393a73f46363fb7213432e
MATLAB
5,427
147
function [trackType,asymParam] = getTrackType(tracks,probDim) %GETTRACKTYPE checks whether tracks are directed or Brownian % %SYNOPSIS [trackType,asymParam] = getTrackType(tracks,probDim) % %INPUT tracks : -- EITHER -- % Output of trackWithGapClosing: % Matri...
40932d76b4bb2cd13219f187b8854f028bc12288e5651b0b3731aa15fd01f2b5
MATLAB
5,429
130
function [Sc,Cmat,Ctot,Cvec,Cent,f]=CrossSpecMatpt(data,win,T,params) % % % Multi-taper cross-spectral matrix - another routine, this one allows for multiple trials and channels % but does not do confidence intervals. Also this routine always averages % over trials - point process as times % % Usage: % % [Sc,Cmat,Ctot...
58b6b8d8bb48cb7e9279189303d098494c56875c0799c2eb06ca7fdb8c6d3492
MATLAB
5,430
118
function CBIG_MMLDA_factor_distribution_wrapper(out_dir) % CBIG_MMLDA_factor_distribution_wrapper(out_dir) % % Wrapper function to plot factor distribution of ADNIGO/2 AD and A+MCI subjects. % % Input: % - out_dir : output directory % % Example: % CBIG_MMLDA_factor_distribution_wrapper('~/example') % % Written by...
f6f45e3295bc08cce6f19cca8c1029cec6ca33bc1958fa156d436e965bb080b4
MATLAB
5,432
114
function [fluordataperiod]=fluormean(fluordata,framerate,full,integrate)%this would be better if I took the mean of each trial and then averaged that and put the error on it right? I guess I have the std from before that I could just slap on %NO LONGER TAKES IN THE AVERAGE VECTOR, TAKES IN THE FULL %change mean to inte...
3007c60995b9b3e9624beaaaba32b925e42006164a120ddcaad73468d419f01e
MATLAB
5,434
140
function newdata=velo2ft(filename,condition) % this function imports the velocity data from the directory % and extracts the right condition % defines the sampling rate of the data % and the channels % define body parts data_template.label{1, 1} = 'PM1'; data_template.label{2, 1} = 'PM2'; data_template.label{...
32350dca7b715a02831eba134280c91d7b416659d0d005b6a00be464874a4fad
MATLAB
5,434
165
function list = find(varargin) % XMLTREE/FIND Find elements in a tree with specified characteristics % FORMAT list = find(varargin) % % tree - XMLTree object % xpath - string path with specific grammar (XPath) % uid - lists of root uid's % parameter/value - pair of pattern % list - list of uid's of matched elements...
761647d46a11399f44991003dce1ab9829c01b7481e4769c6571cac2070fe785
MATLAB
5,435
89
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegcpt(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra computed by segmenting % two univariate time series into chunks - continuous and point process stored as times % % Usage: % [C,phi,S12,S1,S2,f...
48608223a4e3409bd3ffab5d8e58e1d221312d9eafce07ed5dbf42617c6d5c79
MATLAB
5,442
136
function plotfluordirections_picker(avgfluor,redtemps,ROIs,Xpix,Ypix,framerate,k) %plot the data averaged for each ROI %show the ROI? %give this version the k to plot from the getgo - just assign it instead of %looping - then can fn=fieldnames(avgfluor); [numROIs,triallength]=size(avgfluor.(fn{1})); fig=figure('Positi...
870c4a5ece2bb91f31673fdd78cf68411331a92733133d1816d1b224e02b3b93
MATLAB
5,443
140
function [behavior] = getSessionLinearize(varargin) % Compute behavior linearization over all session subfolders % % USAGE % % [behavior] = getSessionLinearize(varargin) % % INPUTS % basePath (default: pwd) basePath for the recording file, % in buzcode format:...
232cfc1a0f93c7bcf08a8935f96632cde35b4612f80a6fa59843364413983d4b
MATLAB
5,445
196
function preProcessND2(inputFile, outputFolder, options) % PREPROCESSND2 Load .nd2 microscope images, apply binning, % Gaussian background subtraction, and save as BigTIFF. % % This function reads a specified series and channel from an ND2 file, % performs optional spatial binning, subtracts a smoothed background, % an...
a2b1749255232baf80da3c036ee50357b8ef3563f90c835f5682998bba681c7c
MATLAB
5,446
137
function [in1,in2,out1,out2,eid1,eid2] = DBMatchValues(eid1,eid2,rexp) %DBMatchValues - Match values for two different sets of variables. % % It is often necessary to match (associate) variables that were computed % independently, e.g. the phase precession slope and field size of hippocampal % place cells. Typicall...
a2ce24671fa3377b7a02580fcc2780a9ad31efb15ca4d79cdc4d57737c2920b9
MATLAB
5,449
149
function [] = ea_runwarpdrive(options) % % Get all subjects and only run warpdrive in the last one % global WARPDRIVE_SUBS; if isempty(WARPDRIVE_SUBS) WARPDRIVE_SUBS = options.subj; else WARPDRIVE_SUBS(end+1) = options.subj; end if options.subjInd < length(options.uipatdirs) return end warpdrive_subs = WA...
2b786c9993b419dccb73b33c6bfe0a9583a6603d3985c458af94d7b60c0bf273
MATLAB
5,455
210
% Make ANALYZE 7.5 data structure specified by a 3D or 4D matrix. % Optional parameters can also be included, such as: voxel_size, % origin, datatype, and description. % % Once the ANALYZE structure is made, it can be saved into ANALYZE 7.5 % format data file using "save_untouch_nii" command (for more detail,...
6c7d91de854075ef1082319e787f90ea9046e961aaee3d76c6ab9096cea2b184
MATLAB
5,458
123
% std_rejectoutliers() - Commandline function, to reject outlier component(s) from clusters. % Reassign the outlier component(s) to an outlier cluster specific to each cluster. % Usage: % >> [STUDY] = std_rejectoutliers(STUDY, ALLEEG, clusters, th); % Inputs: % S...
b085345b5600a2be89826ee75dd7ac88754d683f02491e631df69d3c32fc8fd4
MATLAB
5,460
178
function [fig, varargout] = draw_surface_parcellated_data_dull(surface_to_plot, data_to_plot, parc, hemisphere, medial_wall, with_medial, cmap) % draw_surface_parcellated_data_dull.m % % Draw parcellated data on surface using a defined colormap with dull plot lighting % % Inputs: surface_to_plot : surface structure wit...
b51fbddfc9fd4a75a51e5dba6c87f8f51200e2ad838f323775e37d2a9d850406
MATLAB
5,460
142
function [] = v2structDemo1() % V2STRUCTDEMO1 is a demo function showing some examples for using the function V2STRUCT % %% Last update: % 30.06.2011, Adi N. %% fprintf(['\nRunning demo function with examples for using the function vs2truct:\n',... 'Press any key between breaks.\n']); pause() fp...
41b48932661af5437cb9b3a0f1ca1bc3836434f2a53338be3074e73cbfe08592
MATLAB
5,462
171
function [handles, hObject] = dan_cmd_import(handles, hObject, varargin) % If data_viewer was called from MATLAB, populate the psg structure with % inputted data %% % Authors: Dan Denis % Date: 2021-07-14 %% varargin = varargin{1}; if find(strcmpi(varargin, 'psg')) psg = varargin{find(strcmpi(varargin, 'psg...
27b9d3c3bd564e955cb8c581a7ed5a6df6b0abe28034c12e3391f53a071b4206
MATLAB
5,463
128
% ccc; clear; clc; SINGLEPATHs = dir("..\MAT Data\granger result minus base\PE\**\average\**\*.mat"); SINGLEPATHs = unique({SINGLEPATHs.folder})'; % SINGLEPATHs = SINGLEPATHs(contains(SINGLEPATHs, 'Active')); % SINGLEPATHs = SINGLEPATHs(contains(SINGLEPATHs, 'Passive')); %% Params nperm = 1e3; alphaVal = 0.05; windo...
d39757f0e76eb8953e7080250b78d56e111d13adf5caaa75a733248f0e652dbf
MATLAB
5,467
189
function baseline = CBIG_hypoTest_3t_withinFactorAcrossStages(betas, stats) % baseline = CBIG_hypoTest_3t_withinFactorAcrossStages(betas, stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md fprintf('\n\n****************** Within Factor, Across Stages *************...
3a693a4c6ca9f92c7c9ca4028a2d3f53666300d99ef04a52754419bc71c1468b
MATLAB
5,468
90
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegcpb(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra with segmenting % computed by segmenting two univariate time series into chunks - continuous and binned point process % % Usage: % [C,phi,S12,S...
d12d60f903bdd746b5fa498eebef4e744687a2046a003fbd9f131ae14d960d89
MATLAB
5,470
148
function this = gifti(varargin) % GIfTI Geometry file format class % Geometry format under the Neuroimaging Informatics Technology Initiative % (NIfTI): % http://www.nitrc.org/projects/gifti/ % http://nifti.nimh.nih.gov/ %_____________________________________________________________...
ff1857577c16c71c09d704d19e7f64ac226d78a0114494b068ab4f918f267c45
MATLAB
5,475
147
function [traj,traj_high,traj_low,percentSucceed] = ... numIntTrajectoriesFromSamples(T, perturbations, experimentBlocks, ... intervene_matrix_filtered_merge, Y0, med_biomass, med_counts, ... Theta_samples, startTime, endTime, timeInc, thinRate, assumeStiff) % This file is a part of the MDSINE program. ...
afe5e0d46a9de7283c146829ef21af213656fcac45161c9a8c5160a6a78a4e6a
MATLAB
5,477
137
function [cT, cNull, cCritical,estimatorM, estimatorC] = colocalMeasurePt2Pt(detectionRef,detectionObs, threshold, maskingFile,alphaValue) %COLOCALMEASUREPT2PT measures the colocalization between two punctate channels % % Synopsis: [cT, cNull, cCritical,estimatorM, estimatorC] = colocalMeasurePt2Pt(detectionRef,d...
cd5923ce22ebb0a750217758bce36adedf4ca81abf99b1e95413d1088adcc0a9
MATLAB
5,477
163
function [R, t, iter_err, reg_pointqueary] = ... ICP_point_regRenhance(reg_points, reg_pointqueary, ops) % This is an implementation of the Iterative Closest Point (ICP) algorithm. % Arguments: pointcloud - 3 x n matrix of the x, y and z coordinates of data set 1 % pointqueary - 3 x m matrix of the x, y ...
0be556b65578d9c7bcc98355aea1cde751f3e7ce48b611d70c2f8317d84143c6
MATLAB
5,479
141
%% Basic simulation parameters n_ne = 100; % Number of neurons c_L_path = 1000; % Track length (mm, 1000 mm = 1 m) c_dL_dir = 0.1; % Directed motion step size (mm per ms) c_fr0 = 1; % Baseline (spontaneous) firing rate (Hz) n_step = 2 * c_L_path / c_dL_dir; ...
0b3dc9c7ddebfcfa9ea358a038d7c0b6146968dad5424e4baa7da8d994cb70e7
MATLAB
5,480
174
function [peak_lags, peak_corr, zero_lag_corr, lag_proj_unweighted, lag_proj_weighted] = calc_lag_projection(data, TR, lag_lim, max_TR_shift, is_data_normalized) % data = [T x V x num_subjects] % Adopted from: if nargin<5 is_data_normalized = 0; end num_timepoints = size(data, 1); num_points = size(data, 2); num...
d9bf86197e49bdb9f1b53e8a40e951af6959b836e4072639435944ba1cc4c63a
MATLAB
5,481
209
% Section 7.5.2: Experiment design % Boyd & Vandenberghe, "Convex Optimization" % Original version by Lieven Vandenberghe % Updated for CVX by Almir Mutapcic - Jan 2006 % (a figure is generated) % % This is an example of D-optimal, A-optimal, and E-optimal % experiment designs. % problem data m = 10; angles1 = linspac...
fcf6cc2b9e40944e24585d963d987981210b7df6fdfef7baf8cc73b00a71f0e2
MATLAB
5,482
143
function handles = dan_select_data(handles, subsetOpts) % Function to remove segments of data e.g. only look at clean N2 epochs % %% % Authors: Dan Denis % Date: 2021-07-14 %% chansToRemove = strsplit(subsetOpts{3}, ' '); if isempty(subsetOpts{2}) subsetOpts{2} = 'no'; end if isempty(subsetOpts{4}) subs...
712be1f61575df80d87ce69e442f179742fa1b09272944d9dde7624655a2ced5
MATLAB
5,483
154
function tuned = TuneArtefactTimes(x,times,varargin) %TuneArtefactTimes - Fine-tune artefact (e.g. stimulation) times. % % Fine tuning can be done using either the LFP (faster), or the wideband % data (slower but more accurate). The latter is especially useful in cases % where the artefacts are no longer visible in...
d87b154ffc900973de60f616f125adc0c7df217e98f49ed6c3bbceadb5bf4fb4
MATLAB
5,483
151
function [consolidated,target] = ConsolidateIntervals(intervals,varargin) %ConsolidateIntervals - Consolidate intervals. % % Consolidate overlapping intervals, e.g. replace [10,20] [15,25] with [10,25]. % % USAGE % % [consolidated,target] = ConsolidateIntervals(intervals,<options>) % % intervals list of in...
b07729fd19fec9092afc92c65ed8519752117ef3556a54c29e50bf92ac4325ca
MATLAB
5,488
96
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegpt(data1,data2,win,params,segave,fscorr) % Multi-taper coherency computed by segmenting two univariate point processes into chunks % % Usage: % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegpt(data1,data2,win,params,segave,fscorr) % Input: % ...
16393b156e7343f66573815b15f69a856922f7524ff39caf46b852e10ed39a4c
MATLAB
5,492
170
function CBIG_compare_progression(subInfoFile, GMICVFile, windowSize, k) % CBIG_compare_progression(subInfoFile, GMICVFile, windowSize, k) % What is the subtype order? % Offset by 1, the RID column % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md TEM_COL = 1+2; SUB_CO...
8fb851cc5860fe1f76829a0038b3654adebe920240ed8d6122c322611763c150
MATLAB
5,494
103
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencycpb(data1,data2,params,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra - continuous and binned point process data % % Usage: % % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencycpb(data1,data2,params,fscorr) % Inputs: % ...
08b81c3b261bb4dbf2bac3598538d202f62444ffc0d0b1d6669003dcefcaa78f
MATLAB
5,495
155
%% HOW_DO_I_VISUALIZE_DATA % The help file shows you how to display neuroimaging data for publication % by marianne reddan, 2016 %% General instructions % ----------------------------------------------------------------------- % % Before you start, the CANlab_Core_Tools must be added to your path with % subfolders. Ot...
465aeb91eddcc4dfb7de43679d797f3361b5ce6bbdb2f3b2bc0840d3c7974d36
MATLAB
5,497
189
function baseline = CBIG_hypoTest_3t_withinFactorAcrossStages(betas, stats) % baseline = CBIG_hypoTest_3t_withinFactorAcrossStages(betas, stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md fprintf('\n\n****************** Within Factor, Across Stages *************...
6f6e174b971c115eebd16f8d973226947c79dac73bbf7a27c6dd7d67b686299b
MATLAB
5,498
145
function [Results, Counts] = statTests(dStack, condFlag, timeFlags, varargin) %STATTESTS counts the spikes in the given time flags and compares them %within and against other conditions indicated in condFlag. % [Results, Counts] = statTests(dStack, condFlag, timeFlags, statTest) % INPUTS % - dStack -...
bb8acb0d9c0dceb6f5d7b907b612e8adcec98f983ee420c50c7d120f4549ed9b
MATLAB
5,498
159
function [V, C, topo] = T1_edgeswap_LE(V, C, topo, T1_edge_ID, strain) % T1_EDGESWAP_LE Perform a T1 (neighbor-exchange) topological transition % on a single edge, under Lees-Edwards (sheared) periodic boundary % conditions. % % [V, C, topo] = T1_EDGESWAP_LE(V, C, topo, T1_edge_ID, strain) % collapses the edge T1_...
fe326b441e3a771b3fc41a5e4f87304e80b81c630dc87ee61662f6804e6fca0c
MATLAB
5,500
131
% This makes some nice prepared versions of the data: % ~/ext/figurefiles/nsd/datab3nativesurface_subj[01-08].mat % ~/ext/figurefiles/nsd/datab3nativesurface_subj[01-08]_[lh,rh,subcortex,func1pt8mm,cerebellum]_betas.hdf5 % % In the .mat file, we have: % <ord> is 1 x NTRIALS with 10k indices % <ordU> is 1 x NIMAGE...