sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d583fab29c7b5763a06ae3e577497d45628d75f99262eecac3e2388e13195e8f
MATLAB
3,270
87
function timeString = BF_TheTime(tsec,formatLong) % BF_TheTime Converts a duration (seconds) to a human-interpretable string % % e.g., converts to minutes or hours or days as appropriate) output is something % like '25.5 minutes' or '3.2 days' -- always displays to one decimal place. % % This code is useful for disp...
15ec54fdc4e96136c5e23fae11223839819f071d67f54391e45d1d90aa14e461
MATLAB
3,271
94
function TempRes3(is_cli_mode, freqCol, tempres, folder_name) % Procedure to convert frequency-time formatted .csv files to .ctrs for % categorisation by ARTwarp % % INPUTS % - is_cli_mode (1x1 boolean): boolean flag indicating whether to bypass % collecting parameters through the GUI. If is_cli_mode = false, the % pr...
c62e4bbbfda6157869f0b554aaa01b3df15277e555a490766ce8e204dccdbbf4
MATLAB
3,271
109
function FigureS11(datadir, codedir) %FigureS11 - Differential wait time dynamics based on lambda from % sub-optimal Bayes model are robust across a range of percentiles. % datadir = directory of dataset % codedir = director of code %% Set up paths s = pathsep; pathStr = [s, path, s]; onPath = contains...
eda629fb5ff16fd7e48fc780ffba2af62cd63976cee6c2a7e8b8d1814a9d8db7
MATLAB
3,271
66
%% 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 THE BETAS ACROSS THE WHOLE DATASET FOR A SINGLE ENCODING MODEL % ONLY FOR USE TO LO...
05b5e78103cbcb752d2f13d9e1336877972cbaf330ba96a85ff9e86b65f22f48
MATLAB
3,275
74
disp('See http://www.gaussianprocess.org/gpml/code/matlab/doc/ for details.') clear all, close all, write_fig = 0; N = 20; sd = 3; rand('seed',sd), randn('seed',sd) % set a seed for reproducability fprintf('a) switch between FITC/VFE/SPEP via the opt.s parameter\n') a = 0.3; b = 1.2; f = @(x) a*x + b + sin(x); ...
2c054d2127db1cba5fa9882411bca4d2b7fd4dae9facae094106d2bf0336d001
MATLAB
3,275
90
function physio = tapas_physio_job2physio(job) % Converts job from SPM batch editor to physio-structure % % physio = tapas_physio_job2physio(job) % % IN % % OUT % physio physio input structure, as use by % tapas_physio_main_create_regressors % % EXAMPLE % physio = tapas_physio_job2physio(job) % % See...
f18dc452b95f73017bdda0674cde5ddc50a576afdfb57908847c5059200e6c5a
MATLAB
3,276
79
clc clear all close all % We leverage the VGG Image Annotator to label the pupil region of 9,011 near-eye images selected uniformly across the whole image dataset. % Normally, the pupil region is regarded as an ellipse. Therefore, we label the region by adjusting the major axis, minor axis,tilt angle, and center of th...
f62aaeabc19e356e7975118b2aeaa844ce4acb4c578c9af2fcc4a7598d259b63
MATLAB
3,276
110
function [cmd,fnout]=surfing_afni_surfsmooth(surfdatapat,specfn,targetfwhm,varargin) % Wrapper function to run AFNI SUMA SurfSmooth % % CMD=SURFING_AFNI_SURFSMOOTH(SPAT,SPECFN,FWHM,...) % INPUTS: % VPAT Pattern of .niml.dset surface files to smooth (wildcards allowed) % SPECFN SUMA spec file, or a directory...
117339642da7aba6ba6a654bcf908c0f2955ad366d13b3a4f624e5517b1ec57f
MATLAB
3,277
77
function fig = plot_params_figs(Params, fit, path_Data) %plot_params_figs(Params 'struct', fit 'struct', path_Data 'string') % plot and save figures for triexp model % % Params : Parameter struct % fit : struct containing fitting results % path_Data : path to input data file switch Params.Mod...
fe51a7ebf6fdcb7ec44c23f0eb5bf1c7370cc0adede14ca58fc4bbb0b34d3014
MATLAB
3,278
94
function TempRes3(is_cli_mode, freqCol, tempres, folder_name) % Procedure to convert frequency-time formatted .csv files to .ctrs for % categorisation by ARTwarp % % INPUTS % - is_cli_mode (1x1 boolean): boolean flag indicating whether to bypass % collecting parameters through the GUI. If is_cli_mode = false, the % pr...
5bb9f39114d84f0c3679b4a1ce010a59240e0af6f20a48480aace43109c9f0fc
MATLAB
3,279
106
clc; clear; atlas = cifti_read('C:\Users\lihon\Desktop\abcd_study\atlas\Schaefer\Schaefer2018_400Parcels_17Networks_order.dlabel.nii'); atlas_parcel = atlas.cdata; atlas_label = unique(atlas_parcel(atlas_parcel>0)); num_parcel = length(atlas_label); % load regional brain development (RBD) index patterns K = 3; cen_...
c848f5b509b797245faad2ac525129301c96b1ff7e1598a5eed522af4d083d39
MATLAB
3,279
108
function [xs, x_2S] = FT_ampPhaseShuffle(x, dataInfo) % manipulate amplitudes (magnitudes) or phases of a signal at specific freq % - input: real, time-domain signal % - computes FFT (on columns of x) % - shuffles phases % - iFFT (inverse FT) % - output: modified, real, time-domain signal % (c) Jiri, Jun21 %% setting...
cd0bea47c127cbeeb7959cc892762a9fd2880099ffdfdb7b93b2a025535cd1fa
MATLAB
3,279
61
function triggers = getTriggers_fromTuning(params) % uses as triggers the binned predictor from tuning analysis % (c) Jiri, Dec12 predCh = 1; position = params.tuning.predictor.selectedChnls{predCh}; % TO DO: for multiple predictors... selCh = getDecodingChannels(params.connectionTable, params.tuning.pr...
6d56af6f932459eb31cbea32f45acb016f1b1b051ee11534925559fcf0092d97
MATLAB
3,280
73
function osp_updateSpecsOvWindow(gui) %% osp_updateSpecsOvWindow % This function updates the specs overview tab. % % % USAGE: % osp_updateSpecsOvWindow(gui); % % INPUT: % gui = gui class containing all handles and the MRSCont % % % AUTHORS: % Dr. Helge Zoellner (Johns H...
8f03d469ee963356fa01121017d2260ab78e381ed931148ce1fef3351642bf11
MATLAB
3,283
84
% Compute conductance from vectors in a 3D example % Author: Aina Frau-Pascual %% % Input image im = zeros(3,3,3); im(:,1,1) = 0.8; im(:,:,1) = 0.8; im(:,1,:) = 0.8; im(3,3,3) = 0.8; im(:,:,:,2) = 1 - im - 0.1; im(:,:,:,3) = 0.1; im(im>0.8) = 0; %% % Construct mesh structure Lx = size(im, 1); % doma...
7c3bea6d4e835cea1ee7f94894f8e88783461b0c0b0767f370cbe01662028de0
MATLAB
3,284
118
% Panel builds image files, not just on-screen figures. % % (a) Use demopanel1 to create a layout. % (b) Export the result to file. % (c) Export to different physical sizes. % (d) Export at high quality. % (e) Adjust margins. % (f) Export using smoothing. % (g) Export to EPS, rather than PNG. %% (a) % delegate dem...
2ae7e0ba6b25e5e05b8485a3d93c872f172096b6bb9e5f88ba6c84a7e8bf5ce5
MATLAB
3,285
115
function FigureS5(datadir, codedir) %FigureS5 - Dynamics of wait times and trial initiation times at % transitions from mixed to high or low blocks % datadir = directory of dataset % codedir = director of code %% Set up paths s = pathsep; pathStr = [s, path, s]; onPath = contains(pathStr,... codedir, 'Ignor...
27a3390ded2866e276c17acafe53d3c9969b92fbb01724fad203e4d31189cc48
MATLAB
3,286
88
function net = cnn_cifar_init(varargin) opts.networkType = 'simplenn' ; opts = vl_argparse(opts, varargin) ; lr = [.1 2] ; % Define network CIFAR10-quick net.layers = {} ; % Block 1 net.layers{end+1} = struct('type', 'conv', ... 'weights', {{0.01*randn(5,5,3,32, 'single'), zeros(1, 32, 'si...
9837be68fb892c80f631649ccfc387548828f9e4117939929a3561ddacae979b
MATLAB
3,286
78
function [Fval, A, f, sig ] = testSignificantFrequencies(data, lineNoise) % Computes the F-statistic for sine wave in locally-white noise (continuous data). % % Usage: % [Fval, A, f, sig ,sd] = testSignificantFrequencies(data,lineNoise) % % Parameters: % data Single channel -- required % lineNoise ...
1a1f7d09611822ea6bab333380cdd835da867ea17633f80fce7fe12ed0d2f8b6
MATLAB
3,287
108
% # (JM) MODIFIED FROM ORIGINAL FUNCTION 'shuffle' function shuffled = shuffle(x,method) %shuffle Shuffles raster data using various different methods % Shuffles spike data (0 or 1) using three differnt methods % assumes rows are individual cells and columns are time frames % % 'frames' - shuffles the frames in time,...
247b8813e7ffdfd326ebd5993ce8aea3f99a1b3ce4615dd1a93b01a04952481b
MATLAB
3,288
101
function [ output_args ] = print_progress( p , type , timer ) %PRINT_PROGRESS( p , type , timer ) Prints an progress bar in the console. % While working within the console it might be desirable to monitor the % progress of certain calculation. However, the classic waitbar( ) is % not accessible here, so that pri...
4d2ccbf242da9ce9974f1aff9458e39034e2d471ee3955b7392040f11262132b
MATLAB
3,289
96
function surf = SurfStatWriteSurf1( filename, surf, ab ); %Writes coordinates and triangles to a single .obj or FreeSurfer file. % % Usage: surf = SurfStatWriteSurf1( filename, surf [,ab] ); % % filename = .obj or FS file name. If extension=.obj, writes a .obj file % (ASCII or binary), else writes a FS ...
637a566aa8834e3446ea94bc46d756ab2be607bd241ca170de2d7d0a10f82791
MATLAB
3,289
100
function [hb,he]=barwebQH(barvalues, errors, bw_legend, width, bw_colormap, pval) % % [hb,he]=barweb(barvalues, errors, bw_colormap, bw_legend, width ) % % barweb is the m-by-n matrix of barvalues to be plotted. barweb calls the % MATLAB bar function and plots m groups of n bars using the width and % bw_colormap param...
966ff0e25501fc52906f60b0d6993a951cb3b7866bb6a2ed2381c0a372e6149c
MATLAB
3,289
111
function result = locationParser(dodraw) %% XYXY csv ÆÄÀÏÀ» Àо À§Ä¡ °ªµéÀ» »Ì¾Æ Ãâ·ÂÇÑ´Ù. % ÀÌ ÇÔ¼ö´Â Áß°£¿¡ trackingÀÌ ²÷±ä °æ¿ì¸¦ º¸°£ÇØÁÖ´Â ÇÔ¼ö recoverLocData ÇÔ¼ö¸¦ Æ÷ÇÔÇÑ´Ù. % ui¿¡ xyxy ÆÄÀÏÀ» ¼±ÅÃÇØÁÖ¸é ÀÚµ¿À¸·Î Red LED, Green LED ¿¡ ÇØ´çÇÏ´Â À§Ä¡ ÁÂÇ¥µéÀ» È®ÀÎÇϰí % trackingÀÌ ²÷±ä °÷À» ÀÚµ¿À¸·Î º¸°£...
afc8408b436e3690dfadbbddc234da3939de1626f926a3e5dc631e38a343b63d
MATLAB
3,289
91
% AVEREF - convert common-reference EEG data to average reference % Note that this old function is not being used in EEGLAB. The % function used by EEGLAB is REREF. % % Usage: % >> data = averef(data); % >> [data_out W_out S_out meandata] = averef(data,W); % % Inputs: % data - 2D data matrix...
b9cbfb093359a0cc641d68aa2f510776590dd66ca3d1584b2810146187aa5d5a
MATLAB
3,289
86
function checkretraction(M, x, v) % Check the order of agreement of a retraction with an exponential. % % function checkretraction(M) % function checkretraction(M, x) % function checkretraction(M, x, v) % % checkretraction performs a numerical test to check the order of agreement % between the retraction and the expon...
70f93ee96cef0c140224352a0093638c7b27cbeccd138e2f219e2289306cfe41
MATLAB
3,292
74
function [opOutput, opQuality, opTime] = TS_ComputeOpLoop(masterOutput,masterCalcTime,masterLabel,operationCode) % TS_ComputeOpLoop Links operations to outputs of corresponding master operations, % including the assignment of error codes. % --------------------------------------------------------------------------...
2ec5801122aaeeea6f966f0597b511ad29d6e16084145cd0fcb81f01eaa0e37f
MATLAB
3,293
84
function [rez] = Waveform_M(rez,DATA) M_clust = length(unique(rez.st(:,end))); nt0 = rez.ops.nt0; Nchan = rez.ops.Nchan; %calculate the average template of the merged clusters M_template = zeros(rez.ops.nt0,Nchan,M_clust); M_std_template = zeros(rez.ops.nt0,Nchan,M_clust); suma = zeros(nt0,Nchan,M_clust); %To calcu...
4894ef9ef2ecf966367e3dbcbf5da070c9a77f89a9f1856067e4a9892a2aea28
MATLAB
3,293
81
function output = TimeToPhase(input,phases,varargin) %TimeToPhase - Resample signal as a function of unwrapped phase. % % LFP signals and spikes are recorded as a function of computer time, but one % may instead wish to express them as a function of unwrapped LFP phase. This % is necessary e.g. to align LFPs and sp...
7fb15bc908823fee85786201796b3e254b9fb21b87df95c35dffec17b437037e
MATLAB
3,293
95
function [searchInputs] = get_searchInputs(searchMethod, y, varargin) % GET_SEARCHINPUTS validates and returns inputs required for a specific % searching algorithm. It also returns default inputs if no input are % provided. Please check help section in the searching algorithms for % required parameters in detail. % ...
32d381cd06a35456dca5546fad0ad8d5f4926c60e68505b86afd786835e3ff44
MATLAB
3,294
96
% READEETRAKLOCS - read 3-D location files saved using the EETrak % digitizing software. % Usage: % >> CHANLOCS = readeetraklocs( filename ); % % Inputs: % filename - [string] file name % % Outputs: % CHANLOCS - EEGLAB channel location data structure. % See help ...
08bdc1e1b227acd973c7c6c6b5b58d1553702b78152ecc4264407442062d6e18
MATLAB
3,295
114
function [idxs,nx,ny]=surfing_subsphere2rect(v,io,ix,iy,nx,ny,progressstep) % Projects part of a spherical surface to a rectangle % % [IDXS,NX,NY]=SURFING_SUBSPHERE2RECT(V,IO,IX,IY,NX,NY) % INPUTS: % V Px3 surface coordinates (x,y,z) for P nodes % IO,IX,IY Node indices (base 1) for origin, x and y edge...
e4771d3c15cd06afe4e83049e7683492bb648ba99d04e67f5847a2e5d1b1a4dd
MATLAB
3,297
112
function fear_deltaTrigSpk_new(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) load([basicMetaData.Basename '.okunit.spikes.mat']) load([basicMetaData.B...
0db9b07922dd3016e1b355339fc0b1193093960e5b23e20ebc6a65dc7f0cd743
MATLAB
3,298
106
function fear_hfoTrigIcaReac(basename,varargin) % basename='~/data/Fear/triple/achel180320/achel180320'; % 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.tWindow=2...
3cd6cfb2cbfe1509040972383377e145633f999afce77e7c38e6be65601da8b2
MATLAB
3,298
98
function s = print(obj, pfx, verbose) % Prints all non-empty values of a object along with their property names % % Y = MrCopyData() % s = Y.print(pfx, verbose) % % % This is a method of class MrCopyData. % % IN % verbose {true} or false; if false, only the string is created, but % no output to the comm...
5a86b7c6b37ace10085818aebe7e5cf22fe5878cdc5ec2d99998335bf17b8836
MATLAB
3,299
113
function [f_arr, D_arr, Dx_arr, s0_arr, fitted_dwi_arr, RSS, rms_val, chi, AIC, BIC, R_sq] = IVIM_standard_bcin(dwi_arr,bval_arr,sigmadwi,LB0,UB0,x0in,parallelFlag,previewMode,previewAxes) if size(bval_arr,2) < size(bval_arr,1) bval_arr = bval_arr'; end numVoxels = size(dwi_arr,2); numBvals = length(bv...
f9a77c8646ed82f3f6bb09fb7b91b05b97f940aaab5673ec15f84df78686669b
MATLAB
3,299
84
function haveNewerRelease = tapas_check_for_new_release(verbose) %% Check if a new release is available. % % Input % verbose -- Show information on command prompt: % 0 no information % 1 only if there is a new release...
11f791c4f4458daa7a5b57c9e4a66b552ce18eeca5eec7245577762810bcc6f0
MATLAB
3,301
85
function [rez]=merging_T(rez,Threshold,k) %Variable initialization SF = rez.ops.fs; %sampling frequency to convert from sampling rate to second Nclusters = length(unique(rez.st(:,end))); %Number of initial clusters from kilosort NG_clus = Nclusters; %Number of clusters ...
89c72fd688e0670514e88cb1ec320f1268348d0c144ce3c854701fa7ea90c77c
MATLAB
3,301
99
function roi_extract() % Create spherical ROIs and extract mean No > Yes contrast values. %% USER SETTINGS spmDir = 'C:\path\to\spm'; firstLevelRoot = 'D:\path\to\firstlevel_decision_all_subjects'; includedSubjectsFile = 'D:\path\to\included_subjects.txt'; outputDir = 'D:\path\to\roi_output'; contrastName = 'Decision_...
8ef9da1fdf768f3918f8c54a819e05eaac5de50549863c7215568349fb46537c
MATLAB
3,302
78
function sample_runscript_matlab(doParallelize,saveIncrement,fileName) % SAMPLE_RUNSCRIPT_MATLAB Template function for looping over a hctsa analysis when % using local Matlab files (initializing with TS_init). % %---INPUTS: % doParallelize, (binary) whether to parallelize computations over av...
a569e776a2b5e1d90221ffc7e75b8526d32399d273e746838d706e69d857cd14
MATLAB
3,302
106
% op_getSNR.m % Jamie Near, McGill University 2014. % % USAGE: % [SNR]=op_get_Multispectra_SNR(in,NAAppmmin,NAAppmmax,noiseppmmin,noiseppmmax); % % DESCRIPTION: % Find the SNR of the NAA peak in a spectrum. % % INPUTS: % in = input data in matlab structure format % % OUTPUTS: % SNR = Estimated SN...
c963c8b204fee99ca40668a4651e90e0beab44ec4e986b9bb184e8cf93ff3f42
MATLAB
3,302
121
function plot_fig6h(datadir) % Plot average cross-validated classification accuracy of a logistic % regression decoder. N = 18 sessions from 8 rats. % % INPUTS % datadir: file path of data downloaded from Zenodo. Link to download can % be found in README. fpath = fullfile(datadir, 'data-published/NpxData/npx_DMS.mat')...
f06242e1805b815729fbda6b73da499c670ddaede7544c7ceee14cb588fa5718
MATLAB
3,302
95
function arg = ptparsevarargin(varargin) %PTPARSEVARARGIN Parse input arguments of PERMUTOOLS functions. % [PARAM1,PARAM2,...] = PTPARSEVARARGIN('PARAM1',VAL1,'PARAM2',VAL2,...) % parses the input arguments of the main PERMUTOOLS functions. % % See also PTVALIDATEPARAMIN. % % PERMUTOOLS https://github.com/mick...
24c94b42f177cafd3a70cf1a6db00ee5e89863d6334c1713de515dea99108e7e
MATLAB
3,303
80
function [R, scale]=ARFIT_arqr(v, p, mcor) %ARQR QR factorization for least squares estimation of AR model. % % [R, SCALE]=ARQR(v,p,mcor) computes the QR factorization needed in % the least squares estimation of parameters of an AR(p) model. If % the input flag mcor equals one, a vector of intercept terms is % bein...
2ebe9f886153b348754c5513e7af0936743ff59935efb3406490ffd70faaca85
MATLAB
3,303
91
function out = CO_trev(y, tau) % CO_trev Normalized nonlinear autocorrelation, trev function of a time series % % Calculates the trev function, a normalized nonlinear autocorrelation, % mentioned in the documentation of the TSTOOL nonlinear time-series analysis % package (available here: http://www.physik3.gwdg.de/ts...
30aecd087897d75d1a6e94f8285480e0421f92515438ece4d33c1689d4d22208
MATLAB
3,305
77
function model_object = polynomial_step_model(data_obj, opt_kwargs) %% this script is a based on a ChatGPT translation of Ryan Greenhalgh's pyforce's equivalent polynomial_step_model within models.py %POLYNOMIAL_STEP_MODEL Fit polynomial_step_function to data in data_obj. % feed this function with data that already o...
1e41d21f1e2ee3053d374f2a1fc2ba7004c881428df1118483584049d5eb2286
MATLAB
3,306
127
function [movie_dtr]=detrending(h5Path,varargin) % [movie_dtr]=detrending(h5Path,varargin) % h5Path can also be a local workspace variable. % Variable input arguments: % options.spatialChunk=false; % options.methods='lowpass'; % options.samplingRate=[]; % options.lpCutOff=0.5; % options.binning=[]; % options.frameRange...
6798e66a6645de1e295651346dbd2463dde48ab1ef4250696f98f80d2c768a32
MATLAB
3,309
77
function [surfacevert,dist] = nearestVertex(coord,vertices,varargin) if nargin > 3, plotit = 1;,else plotit = 0;,end % cut down number of vertices by getting into the right quadrant. if coord(1) >= 0, v2 = vertices(vertices(:,1)>=0,:);,else v2 = vertices(vertices(:,1)<0,:);,end if coord(2) >= 0, v3 = v2(v2(:,2)>=0,:)...
14da9d218f1e36738487b2e05fd8d3b535b8e05e426b6e56f72a93214c30a28d
MATLAB
3,310
88
% SHORTREAD - Read matrix from short file. % % Usage: % >> A = shortread(filename,size,'format',offset) % % Inputs: % filename - Read matrix a from specified file while assuming four byte % short integers. % size - The vector SIZE determine the number of short elements to be % read a...
659f73cf0c2b7e3a4a6c1f3f5352f40816aeb0c494cc851ebbe613b88ec590d4
MATLAB
3,311
79
%% [chi] = Wrapper_QSM_STISuiteiLSQRv3(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 o...
825154ec95e3ed8a8224281ff92164a6f4d89c84dd360c15e011ae6b6410e1c1
MATLAB
3,311
102
function preprocess_nsd_epigradunwarp(datadir) % must be run on stone only! %%%%%%%%%% SETUP % internal constants gradfile = '7tps'; % calc ppdir = regexprep(datadir,'rawdata','ppdata'); %%%%%%%%%% MAKE A NIFTI FROM FIRST VOLUME % find first EPI volume epidirs = matchfiles([datadir '/dicom/*bold*']); epifiles = m...
a559a41a181255add6c409027e7ce751aa35770424e42f36bd31d924dca96783
MATLAB
3,313
101
function [out,switchOrder] = osp_onOffClassifyMEGA(in, target,Order) %% [outA,switchOrder] = osp_onOffClassifyMEGA(in,target) % This function decides which of the two provided MEGA sub-spectra in the % are the edit-ON or the edit-OFF. % % To this end, the difference spectrum is analyzed. For GABA-edited data, % ...
ad4846d3c3f9811b65653087f0695c6e8f3fba325f3f3228aca12f540d5e868b
MATLAB
3,313
102
function map = vega20(N) % Colormap from MatPlotLib 2.0. For attractive plots using the ColorOrder. % %%% Syntax: % map = vega20 % map = vega20(N) % % For MatPlotLib 2.0 improved colormaps were created for plot lines of % categorical data. The new colormaps are introduced here: % <http://matplotlib.org/2.0.0rc2/users...
e01e06892f4af4bd89f1cdebabba715516d45a68de4dfd6c1e4c52eb0709dfa2
MATLAB
3,313
104
function ft_regress_physio(input, regressor, TR, cutoff_highpass, ... path_output, cleanup) % Regress physio % % ft_regress_physio(input, regressor, TR, cutoff_highpass, ... % path_output, cleanup) % % Inputs: % input - input time series % regressors - multiple regressors as separate columns i...
00bd23e0cc4fe38fa5dd39c23df651b3735a268fef593bb115b9f3228c959196
MATLAB
3,314
73
function [rawdata, headerinfo] = readoldforcecurve (filename) %% OPEN THE FILE forcefile=fopen(filename); %% THE FOLLOWING READS THE HEADERINFOS xposition = textscan (forcefile,'# xPosition: %f',1); yposition = textscan (forcefile,'# yPosition: %f',1); index = textscan (forcefile,'# index: %d',1); approachI...
0d046c7443e38318010ef730105c2c076848231dc6738d39ccf978c1624aee5d
MATLAB
3,314
77
function output = projectClassifier(output, data, method) % Project new data into fit SVM dimensions, replicating cross validation % structure from the fitting process for m = 1:length(output) % Get trials to project trialsTest = output(m).trialsTest'; % Allocate projections = struct(); for tr...
8aad72ddf8522bc344af546c34a44b75cf5d9415cdf312c81b0485742f2e0c7e
MATLAB
3,314
108
function [Burst] = Burst_80_160rev(SpikeTS, Window) % EdgesISI = linspace(0,1,1001).'; % EdgesISI = EdgesISI(2:end); % BurstISIHist = zeros(1000,1); timeIntervalToTriggerBurst = 0.08*10000; % in ms timeIntervalToMarkEndOfBurst = 0.16*10000; % in ms ISIarray = diff(SpikeTS); for i = 1:length(ISIarray) ...
c50c104fe55121234943c70b9ae4d9b50e32e3b77159c96efa862caa7af71678
MATLAB
3,314
88
% Find the furthest points of the diffusion cloud from the souce function [Xmaxd,Ymaxd,Area_perm,Area,maxD]=findextremes(AUX,S0,i) Ys=S0(1,1); Xs=S0(1,2); [r,c]=find(AUX); if range(r)==0 && range(c)==0 k=0 Xmaxd=S0(1,2); Ymaxd=S0(1,1); Area_perm=0; ...
664c051ba114bdcc006d03bd67303fa577a95737d806dfc4212c4329b94ddf3c
MATLAB
3,315
97
% -*- mode: matlab; -*- % Neurophysiology Analysis Toolkit http://sourceforge.net/projects/nphys/ % Authors : Chris Higginson (original author) and Josh Tasman % Copyright (C) 2002-2005 by the authors and the Mizumori Lab % (at the University of Washington, Seattle) % % This program is free software; you ca...
0a4512df0f78e8c70062d1bf7dc8dd1bb59b19267d5f2181b8546e0ded21ac81
MATLAB
3,316
96
function [results] = preSelectEnvs(saveFigures) % Loads results from preliminary evolutions of 10 Sprott environments % (formally analysis02C), to check which environments are possible to % predict given the capacity of our comparatively small reservoirs (N=100). % Returns: % -------- % results (table) with columns: % ...
7edd4a128d7272e68be8c3ebc359d9558a3a43d11fd327dd97478b3fdd3f49d7
MATLAB
3,316
92
function out = EN_ApEn(y, mnom, rth) % EN_ApEn Approximate Entropy of a time series % % ApEn(m,r). % % cf. S. M. Pincus, "Approximate entropy as a measure of system complexity", % P. Natl. Acad. Sci. USA, 88(6) 2297 (1991) % % For more information, cf. http://physionet.org/physiotools/ApEn/ % % ---INPUTS: % y, the in...
4c3c23252b3f0381528765d5bf280bbe1a50fe44b8861ffa0a8c762a97061eae
MATLAB
3,318
89
% In this script, we'll fetch the pupil radius and position, and plot it % along with a calcium trace, all on the behavior clock. The relative times % of the eye,treadmill, and trace are precise, but the clock itself starts % at some arbitrary offset. % Frame times from preprocess.Sync on the visual stimulus clock can...
79d26e1545a4344d989e426bffb8e73d4548ba3152fb75f9b705ccce70107876
MATLAB
3,318
74
function [DataMatrix] = add_noise_IVIM_T2_phantom(NoisePars,dataDir,dataFile, DataMatrix, saveOutput,PhantomPars) % This function adds rician noise to a 2D IVIM phantom created using the % generate_IVIM_T2_phantom function % % USAGE: % [DataMatrix] = add_noise_IVIM_T2_phantom(NoisePars,dataDir,dataFile, Da...
475a5312626ded01fe4ec4625f6b326cfb8fd0124625feba7d405457e121e864
MATLAB
3,321
75
function [ERSP_corr, GPM_corr, ERSP_psc1, PSC, V] = specPCAdenoising(ERSP, varargin) % spectral PCA denoising. PCA of gait ERSP and removal of first first principal % component as describend in: % Seeber M, Scherer R, Wagner J, Solis-Escalante T, Müller-Putz GR. % High and low gamma EEG oscillations in central se...
731d5c2b27fd546612caed417a58077b3acfb428f8326fc46ed2ed675f7e91a2
MATLAB
3,321
102
function map = vega20c(N) % Colormap from MatPlotLib 2.0. For attractive plots using the ColorOrder. % %%% Syntax: % map = vega20c % map = vega20c(N) % % For MatPlotLib 2.0 improved colormaps were created for plot lines of % categorical data. The new colormaps are introduced here: % <http://matplotlib.org/2.0.0rc2/us...
e094b92296d254d5cf924f20af2814199f70e8d3f5aa31fba39d61d7b5f229f2
MATLAB
3,321
102
function map = vega20b(N) % Colormap from MatPlotLib 2.0. For attractive plots using the ColorOrder. % %%% Syntax: % map = vega20b % map = vega20b(N) % % For MatPlotLib 2.0 improved colormaps were created for plot lines of % categorical data. The new colormaps are introduced here: % <http://matplotlib.org/2.0.0rc2/us...
42a303f84ec367738e9c87f5bd0c9bc9edca7048eb43caf356968510241e7113
MATLAB
3,322
130
function [efs,F,cdfs,p]=repanova2D(d,D,fn,gg,alpha,print_output) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [efs,F,cdfs,p,eps,dfs,b,y2,sig]=repanova(d,D,fn,gg,alpha) % % General N-way (OxPxQxR...) repeated measures ANOVAs (no nonrepeated factors) % % Input: % % d = data A matrix with rows = replications ...
45acbd7ec49ec6d2213f412dfe7e0205c97a1eae8fcff3e71c8a1ce7e2e927a5
MATLAB
3,322
88
function fear_icaTripleStrWake_optShfit(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; param.templateSes=2; param.threshold=125; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) %% param=parseParamete...
e7deaf3af837921d1421d073ce0877e2d7b14e2a4454594ea424af83f33dab28
MATLAB
3,323
71
function verbose = tapas_physio_splash(verbose) %Print splash information % % output = tapas_physio_splash(input) % % IN % % OUT % % EXAMPLE % tapas_physio_splash % % See also % Author: Lars Kasper % Created: 2022-02-17 % Copyright (C) 2022 TNU, Institute for Biomedical Engineering, % Univ...
062f9dc91e4a82476c7e929c976157d3f0dedf1a92579d68bea5c94086635a48
MATLAB
3,324
124
function [WTOpt, WTMdl, BlkInf, Belief, Prior, Kappa] =... GenerateSynthData_Bayes_SS(params, ratTrial,... noise_arg, gen_arg, noise_params, rewType) %GenerateSynthData_Bayes - generates synthetic wait times %for optimal Bayes model. AVM, adapted by SSS % Inputs: % params - Parameter vector. [kappa_mi, kappa_...
d442563478da7806b888162c607e0c0b605f40244753ead40c8270de2df8d5a9
MATLAB
3,324
104
function [edgeMat, nodes, edgeIdx] = load_corrMatFiles(corrMatDir, verbose) % LOAD_CORRMATFILES Loads correlation matrices and extracts edge features. % % Loads all connectivity matrices from a directory into a single edge % matrix of size (subjects x features), where features are upper-triangle % edge values. % % Argu...
bfaf23b11436dc0cddd4713bd3791184877a8fbddf243676b05d82fa3f89d7c4
MATLAB
3,325
90
% POP_SAVEH - save the EEGLAB session command history stored in ALLCOM % or in the 'history' field of the current dataset % % Usage: % >> pop_saveh( ALLCOM, filename, filepath); % >> pop_saveh( EEG.history, filename, filepath); % % Inputs: % ALLCOM - cell array of strings containing the EEGLAB ...
cb488d78dfcf51cecc74ca864415725d567217429a3e5c519bd3227afb9a3c60
MATLAB
3,325
133
function [gabor, gabor90, scweights] = make3dgabor_frames(xytsize, params) %function [gabor, gabor90] = make3dgabor(xytsize, params) % % returns a gabor functions of size X-by-Y-by-T, specified by a vector PARAMS. % % INPUT: % [xytsize] = vector of x, y, and t size, i.e. [64 64 5] % [params(1:2)] = center_x, ce...
0ec07cff2e930b2ff246fc1371ec429bb0332acb2c1e255068499949d0b8c93e
MATLAB
3,326
91
%% h = sepia_handle_panel_swismwi_SMWI(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 other h...
3742fd0e0ad5449a6133de622773f579162cbbe23985d1ad207e7a816f53f286
MATLAB
3,326
132
function [h,p] = ConcentrationTest(angles,group,alpha,nRandomizations) %ConcentrationTest - Test homogeneity of concentration parameters. % % Test whether the concentration parameters for N groups of circular data are equal. % The data are assumed to have Von Mises distributions. If the median concentration % is infer...
3f0e5d156aecbdc08775160aee2e32753dc1fc94c45d7b310274a73e257a6d4c
MATLAB
3,327
81
% Please cite this paper if you use any component of this software: % D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017. % Re...
47f7a33451b5d763a43ce29b744d43204964b92ef08f1e3723734a644024e965
MATLAB
3,327
119
function [onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots, iEvent) % % Wrapper function that present the dot stimulation (static or motion) per event. % % USAGE:: % % [onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots, iEvent) % % :param cfg: PTB/m...
4b5db2e09db9a03880e2fe86e23e14d58f1c757db587a288476178cdaba7bcea
MATLAB
3,327
81
function mk_edgescsv_from_mat() % MK_EDGESCSV_FROM_MAT % Converts NxN connectivity matrices into required .csv file by FC modality % % addpath(genpath('matlab')) % mk_edgescsv_from_mat() % Setup ROOTDIR = fileparts(fileparts(mfilename('fullpath'))); DATADIR = [ROOTDIR '/data']; ...
5eea675755e516dc0bccb401257630be9a4dd4886680e42a80282b8591c978ad
MATLAB
3,329
89
function p = expandReplaceWithGoodies(attemptcount,newThresh) global numFact numDose global SelectedVectors TopVectors GoodiesPool TabuList Xselect GoodiesUsedRWG TopVectors = [TopVectors SelectedVectors]; % ReplaceWithGoodies 16 GoodiesUsedRWG = 0; % Sort TopVectors -- mean score of vectors in row numFact...
8118d3ce3f17155545112f15a377f3e5a19eca6284428e704b5a39218bcddbdd
MATLAB
3,329
145
%% % Other sandbox - making eigs for each of the networks. load UseToComputeDegPerNet.mat % Get rid of what we don't need clear ContACount ContACxd ContBCount ContBCxd ContCCount ContCCxd DMNACount DMNACxd DMNBCxd DMNBCount DMNCCount DMNCCxd LimACxd LimACount LimBCxd LimBCount SalVentAttnBCxd SalVentAttnBCount S...
8ae270019d7e29b354561ab36e362a8937b43a9e390cc44c017e20ba30b5ebee
MATLAB
3,329
102
% READ_RDF - read RDF-formatted EEG files. % % Usage: % >> [eeg,ev,header] = read_rdf(filename); % % Inputs: % filename - EEG data file in RDF format % % Outputs: % eeg - eeg data (array in size of [chan_no timepoint]; % ev - event structure % ev.sample_offset[] - event offsets in samples % ...
ac7accb57e47ba0e39b02c64a3997993775cbc2308fbb8c47331d0285f94e152
MATLAB
3,331
78
%{ pre.NMFSettings (lookup) # Settings for the NMF algorithm ->pre.SegmentMethod setting_idx : tinyint # unique index for the configuration ----- name : char(20) # descriptive name of the settings p=2 : int # initial order of autoregressive system (p = 0...
565bf6f5e8c15e4a7742f4583d443b6d5b1c87da686c66921b3718625cec9ef8
MATLAB
3,332
112
function [ testResult ] = tapas_ceode_testScript_erp() % [ testResult ] = tapas_ceode_testScript_erp() % % THIS IS A SCRIPT SOLELY FOR TESTING THE SPM/TAPAS SETUP. DO NOT CHANGE! % % Takes a synthetic dataset (3 population ERP model), and computes the % predicted response for different integrators and levels of delays...
59238459d6e792c25d4f0659c698f84b044941659157aeef209fb588b73f606e
MATLAB
3,333
70
%% create MS individual ROI = overlap Roi % save the individual clusters of hMT and MTt % overlap of individual hMT and MTt and then make their ROI mask clear all % sub-pil001 and sub-pil002 have no localizer %'sub-011' have no hMT;'sub-013' no (rhMT rMTt),'sub-014' no MTt %'sub-008' have only right mst - !! do manua...
2c5b86ce8ad1c5ca10a9c4d34415cd84fa8cd66684650b1c798b2e6ead37e6a9
MATLAB
3,334
77
%LC2014. %Deteccion de estados usando conceptos de algebra lineal %La matriz formada por la multiplicacion de los eigenvalues*eigenvectors %indica el conjunto de vectores linealmente independientes que describen el %comportamiento de la red. %Una limitacion es que los patrones deben aparecer varias veces %para ser c...
804b459bf2a5b5792a63ca5b6f848efcf27ba34afcdab79b101497acedf12290
MATLAB
3,336
110
% fit_createMetabList.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % metabList = fit_createMetabList; % % DESCRIPTION: % Creates a list of metabolite basis functions that are to be included in % a fit. % % OUTPUTS: % metabList = structure including flags (1 = included, 0 = excluded) for % ...
92dad0e4f662b5d9cf4bfe0d67991babb266e81c636c8cb6e5681ad68d86a29e
MATLAB
3,336
79
function ProcessData_Figure1(datadir, savedir, codedir) %ProcessData_Figure1 - Process raw data saved under datadir such that it can be plotted by PlotFigure1. % INPUTS: % datadir - Local directory where 'Golden_Nature/RawData_Figure1.mat' from Zenodo was saved % codedir - Local directory where code (e.g., publishe...
e3051ddd28b77d3ef1d10062890869ee739c19fbcd776db4e84cd6232effcb3a
MATLAB
3,337
86
function task_gaitERSP_clean(sii, PATH, cfg, fieldName) % Calculate gait ERSPs of processed data stored at PATH.fieldName % with artifact attenuated single subject EEG datasets stored as file_in at PATHIN % % INPUT % - sii: vector of subject IDs to be processed % - PATH: structure with all paths leading to dif...
8cb25f464be2d816c4454a6bbdacc78ce46bf471d5f79b51a8729add85aee66f
MATLAB
3,338
106
% estimatePSFT % Estimates pSFT parameters from voxel time series via fmincon % % Inputs: % I - input time series [time x 1] % measured_BOLD - voxel time series [time x voxels] % HRF - hemodynamic response function [time x voxels] % p - structure of parameters (see example_pipeline.m) % ...
d3bdd8ea50026df3169bcb73d004209c32d5a44f2e272fa677e30926b25a9773
MATLAB
3,338
112
function Test_trace_ratio() % % Maximize trace(X'*A*X)/trace(X'*B*X) with B being symmetric and positive % semidefinite and A is only symmetric. % % This file is part of Manopt and is copyrighted. See the license file. % % Main author: Bamdev Mishra % Contributors: % % Chang...
faeae617729f55630ae19bda1e1917b369008e68a0dfe27b16b3bef7d54ed189
MATLAB
3,338
83
% Script unit_test_debug % Examples how to perform individual unit tests for debugging. Tags or the % unit test name can be used. Note that changes in the class definitions % requires a clear classes to take effect. % % unit_test_debug % % % See also MrUnitTest % Author: Saskia Bollmann & Lars Kasper % Created: ...
6122af6ab19332b5ff1e4c1d3848229210361fcdb0e9ed10bc9ba7cc4c8e088d
MATLAB
3,340
84
function [varargout] = likErf(hyp, y, mu, s2, inf, i) % likErf Error function or cumulative Gaussian likelihood function for binary % classification or probit regression % % Report number of hyperparameters % s = likErf () % s = likErf (link) % % Prediction mode % lp = likErf (hyp, y, mu) % [lp, ymu, y...
98697ca6a1ce71e5c51dbfb37b8500ea782bc5a83d23ac88a45eca0d3463ab82
MATLAB
3,340
89
function [u_norm, coeffs, u] = smallestinconvexhull(M, x, U, tol) % Computes a minimal norm convex combination of given tangent vectors in Manopt. % % function [u_norm, coeffs, u] = smallestinconvexhull(M, x, U) % function [u_norm, coeffs, u] = smallestinconvexhull(M, x, U, tol) % % M is a manifold as returned by a Man...
43f9ce9d7f9350b455cfbdc68236149d889342293a1c9b601669eee7f9ef759d
MATLAB
3,342
87
function [rez]=merging_S(rez,Threshold) %Variable initialization SF = rez.ops.fs; %sampling frequency to convert from sampling rate to second Nclusters = length(unique(rez.st(:,end))); %Number of initial clusters from kilosort NG_clus = Nclusters; %Number of clusters nt...
a265bf30debc717e2178067d7d6b9233200ee82082bbc9565c8fffd8e4a45f29
MATLAB
3,342
149
function [l, sh] = TellAfni_Commands (f, fpart ) % % [l, sh] = TellAfni_Commands (f, field) % %Purpose: % Extract, all the commands from README.driver % No guarantee that you'll get all the commands extracted, % Use this as a guide but read the entire README.driver for the full picture % %Input Parameters: % ...
b331470b8676c9012ee1720114be27d5472c1947e514f74edc13b26bd8443746
MATLAB
3,342
90
function prepareICAs(dtseriesName,ICAs,wbcommand,ICAdtseries,NoiseICAs,Noise,Signal,ComponentList,hp,TR) % Convert input paramter strings to numerics as necessary and show input parameters func_name='prepareICAs'; fprintf('%s - start\n', func_name); fprintf('%s - dtseriesName: %s\n', func_name, dtseriesName); fprintf(...
9ff6eb82d612f73943479bc98738e08fe73be20e967236b2b9774a619fcf1b89
MATLAB
3,343
92
% Data from Kreher et al., 2008, Table S1A dffJC = ... [-6 -43 -9 -3 -4 -7 2 -19 37 32 8 2 -19 3 -4 1 0 5 11 -6 -4 2 6 -7 -6 1 -3 0 -1 15 -8 26 3 -4 6 0 4 -1 88 0 3 3 6 177 78 -4 -7 3 -7 147 184 10 91 16 10 21 11 131 98 7 98 8 16 2 -4 -6 -17 -16 -2 -2 115 53 32 46 16 -4 6 20 79 62 -10 5 -1 8 7 20 -2 -8 7 3 -5 -3 215 14...
c5f734a3eddc96cfc913922ae8413a3f8b3ca491d8e2f3606a307a02ba2295ff
MATLAB
3,343
101
function peak_loc = get_peakloc(data,win_width,sample,meanfreq,no_osc) % Extracting data driven windows from recurrence plots % % Tewarie et al., 2019 Tracking dynamic brain networks using high temporal % resolution MEG measures of functional connectivity % % % Output: - peak_loc refer to...
4410987ccade002cb32cc91a835792f2b9dea4848c8a626a392bb33512138d04
MATLAB
3,344
151
function [cid, alpha, mu] = circ_clust(alpha, numclust, disp) % % [cid, alpha, mu] = circClust(alpha, numclust, disp) % Performs a simple agglomerative clustering of angular data. % % Input: % alpha sample of angles % numclust number of clusters desired, default: 2 % disp show plot at each ste...
ee2cb30bcdd7c4e9597543675e93e11dc44841d474acfb30630ef95447eb3a1f
MATLAB
3,344
81
% RSPDFSOLV - sub-function used by RSFIT to searc for optimal % parameter for Ramberg-Schmeiser distribution % % Usage: res = rspdfsolv(l, l3, l4) % % Input: % l - [lambda3 lamda4] parameters to optimize % skew - expected skewness % kurt - expected kurtosis % % Output: % res - residual % % Aut...