sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
da061e5755fb4519d0bd4d96b5c85fb3201d7249de66fd25ca43961b24812af7
MATLAB
15,020
308
classdef NiftiFilepath properties (Access = public) patientId = []; modality = []; referenceSystem = []; warningAttribute = []; dataRootFolder = []; end properties (Access = protected) directFilepath = []; openDialogIfNotExists = []; ...
5204c355c5e544967683b77a19af1e1959c8477e639e3d9d98d5d1be2a0702f0
MATLAB
15,025
301
classdef libsvm_CL % libsvm_CL is a Support Vector Machine (SVM) classifier object (CL) % that uses the LIBSVM package (i.e., this function is Neural Decoding Toolbox % wrapper for the LIBSVM package). A support vector machine is a classifier % that learns a function f that minimize the hinge loss between the...
0516a7cd72cb1cd11e3df1870c34c55f2b2ec063a662334df003ff8898eec07e
MATLAB
15,076
427
function [trackIndx,errFlag] = chooseTracks(trackedFeatureInfo,criteria,probDim) %CHOOSETRACKS outputs the indices of tracks that satisfy the input criteria % %SYNOPSIS [trackIndx,errFlag] = chooseTracks(trackedFeatureInfo,criteria); % %INPUT trackedFeatureInfo: -- EITHER -- % Output of trac...
37e04ba2b983521e2780b4263ebc4e7f6df56e8b0e2474e7fd720320e7aee562
MATLAB
15,078
344
function [NEV] = F_openNEX(fileName) % NEV = readNexFile(fileName) -- read .nex file and return file data in NEV File structure % Sorted with Plexon Offline Sorter first !!!!!!!! % V2.3 % %%%%%%%%%%%%%%%%%%%%%%%%%%% % INPUT: % fileName - if empty string, will use File Open dialog % % OUTPUT: % NEV - a s...
1a15b38d2a7c6c5515ac56938d073259d00b1544fa42847b61ccd413d75f7cc7
MATLAB
15,101
452
function [success, commands] = ea_checkinstall(cmd,checkonly,robot,prefs) success=1; if ~exist('checkonly','var') checkonly=0; end if ~exist('robot','var') robot=0; end if ~exist('prefs','var') prefs = []; end python_envs = ea_regexpdir(fullfile(ea_getearoot, 'classes', 'conda_utils', 'environments'), '.*\...
12aa70fff151f06d7996bb0c473e0c49e0702f279f90e7621ee795e0813bd93b
MATLAB
15,140
414
% [ wave, f, t, coh, phases, raw, coi, scale, period, scalef ] = getWavelet( x, Fs, fMin, fMax, nbins, graphics ) % % x: % vector - wavelet analysis is applied % multi-column matrix - wavelet analysis is applied to each column % separately % % two-column matrix - treated as two time series and the csd, coherenc...
06e7f676b969d07e60de14cb8d1198b5b35db77b99ab1e2475d89428cf0396a9
MATLAB
15,171
435
function [Elements,varargout] = ea_plyread(Path,Str) %PLYREAD Read a PLY 3D data file. % [DATA,COMMENTS] = PLYREAD(FILENAME) reads a version 1.0 PLY file % FILENAME and returns a structure DATA. The fields in this structure % are defined by the PLY header; each element type is a field and each % element prop...
3f75461f0f12d13a58d8e4b48509abd39838fb71ab81809098b30c1f0eb52ea8
MATLAB
15,192
410
function CBIG_ArealMSHBM_cMSHBM_estimate_group_priors_child(s, mesh, tmp_dir) % CBIG_ArealMSHBM_cMSHBM_estimate_group_priors_child(s, mesh, tmp_dir) % % This is the child script to estimate group priors for the strictly contiguous individual % areal-level parcellation generation. To speed things up, we parallize the s...
7ca404a452e93f6e0e1df40b5dc36819722df2a04b2a7e1b075ea44573e7044d
MATLAB
15,216
442
function [ar, dataOUT] = fun_detect_artifacts(dataIN, sleepstages, varargin) % Automated artifact rejection of sleep EEG data based on Hjorth % parameters. This function is an attempt of a MATLAB implementation of the % artifact rejection functions in the Luna toolbox. Artifact rejection % works in two steps, first on ...
680466acaef978dc6ffd626e5e4e07f045b3bdafca90c33e5741bc17796573d1
MATLAB
15,218
280
% crossfreq() - compute cross-frequency coherences. Power of first input % correlation with phase of second. % % Usage: % >> crossfreq(x,y,srate); % >> [coh,timesout,freqsout1,freqsout2,cohboot] ... % = crossfreq(x,y,srate,'key1', 'val1', 'key2', val2' ...); % Inputs: % x ...
432a3dd7cead3280ef451548d6dc10c1d9098e6d8395c02719c218488d1739c3
MATLAB
15,257
470
function [gmtc,interpol_tc,voxelmask]=ea_extract_timecourses(options) % Extract timecourses based on template %% prepare voxelmask: directory=[options.root,options.patientname,filesep]; % BIDS FIX: Add prefix to filename only rest_r = ea_prependFilename(options.prefs.rest, 'r'); ea_warp_parcellation(rest_r, options);...
608a2943cecb94f84d03ca55ea6891fcc2acce87cf9d8dec7484cfb582f5bdf0
MATLAB
15,258
479
function cls = ea_spm_preproc_write8(res,tc,bf,df,mrf,resolution) % Write out VBM preprocessed data % FORMAT cls = spm_preproc_write8(res,tc,bf,df,mrf) %____________________________________________________________________________ % Copyright (C) 2008 Wellcome Department of Imaging Neuroscience % John Ashburner % $Id: ...
296aaa0855092f3f5422f0367616b7d97ccd3bbf91c43f48bedd5b48b3a7715e
MATLAB
15,270
347
% std_checkset() - check STUDY set consistency % % Usage: >> [STUDY, ALLEEG] = std_checkset(STUDY, ALLEEG); % % Input: % STUDY - EEGLAB STUDY set % ALLEEG - vector of EEG datasets included in the STUDY structure % % Output: % STUDY - a new STUDY set containing some or all of the datasets in ALLEEG, ...
e0f3378f40ed4edf51a34a9ea12a4fe44b43273fe2092858917b91233a61e209
MATLAB
15,320
388
function [dist_from_hyperplane, Y, svm_dist_pos_neg, svm_dist_pos_neg_matrix] = plugin_svm_contrasts_get_results_per_subject(DAT, svm_stats_results, DATA_OBJ) % [dist_from_hyperplane, Y, svm_dist_pos_neg, svm_dist_pos_neg_matrix] = plugin_svm_contrasts_get_results_per_subject(DAT, svm_stats_results, DATA_OBJ) % % The p...
5f94facafbd5e9268938f9d28771c78580f986af04c743889991854883a5664d
MATLAB
15,355
389
% pop_topoplot() - Plot scalp map(s) in a figure window. If number of input % arguments is less than 3, pop up an interactive query window. % Makes (possibly repeated) calls to topoplot(). % Usage: % >> pop_topoplot( EEG); % pops up a parameter query window % >> pop_topoplot( EEG, ...
12c38cbbb0aa4e8c50fc8168a3a80c266c0894cf9e3a058d4ddf731c00de73b5
MATLAB
15,358
417
function CBIG_ArealMSHBM_gMSHBM_estimate_group_priors_child(s, mesh, tmp_dir) % CBIG_ArealMSHBM_gMSHBM_estimate_group_priors_child(s, mesh, tmp_dir) % % This is the child script to estimate group priors for gradient-based individual % areal-level parcellation generation. To speed things up, we parallize the script % a...
9f512fe4d9a443900a760fafef7fcf214f9d1203f571322934ab1b3921727668
MATLAB
15,392
488
function SANDIinput = investigate_exchange_effectes_NEXI_SANDI_RicianNoise(SANDIinput) %% Investigate the effect of exchange. Create sythetic signal using a modified NEXI model, made of NEXI + spherical compartment % Read the input delta = SANDIinput.delta ; smalldel = SANDIinput.smalldel ; sigma_SHresiduals = SANDIi...
990bf3f736692c3889f8d2a0836491854b1e6a48ac3f35ab7b66be8c0acac4a6
MATLAB
15,404
397
%% figure2 % -------------------------------------------------------------------------- % This script generates simulated data and calculates Transfer Entropy (TE) % to the scenarios presented in Figure 2 of the paper. % % Two scenarios are simulated: % 1. 'Connected' condition: Signal Y is generated direct...
2927f241d631200855b07b2f06f4662e7fe1041109b1cc056fd51661393c8878
MATLAB
15,459
493
% timtopo() - plot all channels of a data epoch on the same axis % and map its scalp map(s) at selected latencies. % Usage: % >> timtopo(data, chan_locs); % >> timtopo(data, chan_locs, 'key', 'val', ...); % Inputs: % data = (channels,frames) single-epoch data matrix % chan_locs = channel loc...
c4dc21bae9f6f559dba3bf221e3b86aa4331ff32faf8ba92225f5d5c4ae31178
MATLAB
15,466
509
% Using 2D or 3D affine matrix to rotate, translate, scale, reflect and % shear a 2D image or 3D volume. 2D image is represented by a 2D matrix, % 3D volume is represented by a 3D matrix, and data type can be real % integer or floating-point. % % You may notice that MATLAB has a function called 'imtransform.m' for...
b7c7ff82b66e15ed0702d907adff605a3db4b98c7d99921b0063d6aa57663ced
MATLAB
15,485
411
function tree = xml_parser(xmlstr) % XML (eXtensible Markup Language) Processor % FORMAT tree = xml_parser(xmlstr) % % xmlstr - XML string to parse % tree - tree structure corresponding to the XML file %__________________________________________________________________________ % % xm...
8345c95f5e56031df9d06c5dbbb896ebbbe8db0ec9c2614e21f719042275f66d
MATLAB
15,508
321
classdef biChordChart < handle % Copyright (c) 2022-2023, Zhaoxu Liu / slandarer % ========================================================================= % @author : slandarer % 公众号 : slandarer随笔 % 知乎 : slandarer % ------------------------------------------------------------------------- % Zhaoxu Liu / slandare...
ce4474953564b42bbc209691d2c9d42a02014d0affaff3e05c6cf5ac4861e982
MATLAB
15,527
256
function cm_data=TealRd(m) cm = [6.30247194465418e+01 1.27292705808247e+02 1.47022775963106e+02 6.4390417891429e+01 1.28215535380952e+02 1.47809646181672e+02 6.57561163363162e+01 1.29138364953658e+02 1.48596516400239e+02 6.71218147812034e+01 1.30061194526363e+02 1.49383386618805e+02 6.84875132260906e+01 1.3098402409906...
2b87eb711d06f6ee5da89a5447e4d8ca8a074340dcf382a853c703b8aecf2be9
MATLAB
15,535
485
function varargout=LeG_msgbox(varargin) %MSGBOX Message box. % msgbox(Message) creates a message box that automatically wraps % Message to fit an appropriately sized Figure. Message is a string % vector, string matrix or cell array. % % msgbox(Message,Title) specifies the title of the message box. % % msgbox...
14a96c43f1f2f6b8bf564fd082ac09df4cc06cca61ad5e9a01d3d4c0a86fefa3
MATLAB
15,538
412
%% LaBGAScore_decoding_template_xclass_acc.m % % % *USAGE* % % This script uses functions of the % <https://sites.google.com/site/tdtdecodingtoolbox/ Decoding Toolbox % (TDT)> to % % % # run first-level (i.e. within-subject) (cross-)classification accuracy % between conditions of your choice in a mask of your choice,...
0a3f269a7a1e49d2baa73ef84598c20e0e59577d51899d5b8de297ef28e46c44
MATLAB
15,544
413
function [vals,fibcell,usedidx] = ea_unified_discfibers_calcstats(obj,patsel,Iperm) % NB: for PCA, we are going to reassign I later in the function if ~exist('Iperm','var') I=obj.responsevar; else % used in permutation based statistics - in this case the real improvement can be substituted with permuted variables....
083a6cc1ce59459d9cfb7887d8091fc2185ee2d26d4bd5ad0eabc1264128d7ae
MATLAB
15,573
423
function obj = subsasgn(obj,subs,varargin) % Subscript assignment % See subsref for meaning of fields. % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: subsasgn.m 5985 2014-05-14 18:32:51Z john $ switch subs(1).type, case {...
5149d8e0ef99bcf9eff1efcb0e958aeb8b90f633b67dace9ef22814b8fa8bb6b
MATLAB
15,609
333
% std_readfile() - Read data file containing STUDY measures. % % Usage: % >> [data param range1 range2] = std_readfile(filename, 'key', val); % % Inputs: % filename - [string] read specific file, for instance 's1.daterp' % containing ERP data for dataset "s1.set". It is also % ...
7ac8bb8d18b2fc4f2fc49ed0758278096174509bb1b1dfc11d6fa2921645f8c5
MATLAB
15,609
504
function [GammaFit] = bz_FitISISharedGammaModes(logISIhist,logtimebins,varargin) %UNTITLED Summary of this function goes here % Detailed explanation goes here % % INPUTS % logbins [numtimebins x 1] (or ISIs) % logISIhist [numtimebins x numcells] probability density (N/(sum*dbin)) % % Opt...
c340d206c73f04f9a06bf48b07df10ef0d952015e5d5e4f918c524b368c2170d
MATLAB
15,615
434
%% LaBGAScore_atlas_rois_from_atlas.m % % % *USAGE* % % This script creates rois by combining regions from one or more atlases, % and automatically saves the rois as atlas objects and optionallly as .nii files % in maskdir of secondlevel model % % There is an option to save a single file including all flat rois % (i.e....
9e68dcb3ad365dff553a5107481effa8608f5cbf1c7922d7abe29c68ba599449
MATLAB
15,624
422
function fit = fit_meta_d_mcmc_group(nR_S1, nR_S2, mcmc_params, fncdf, fninv, name) % fit = fit_meta_d_mcmc_group(nR_S1, nR_S2, mcmc_params, fncdf, fninv) % % Given data from an experiment where observers discriminate between two % stimulus alternatives on every trial and provides confidence ratings, % fits equal-varia...
06c1dd88e574175a780f9eb278959dfcc2a16913621086315e7006e84b956553
MATLAB
15,633
510
% Name: Robert Kim % Date: 03-29-2023 % Email: robert.f.kim@gmail.com % fnc_generate_trials.m % Description: Generate one trial (input matrix u + label struct lab) for % one of the supported tasks: % 'fg' : 2-channel figure-ground (signed-product target) % 'instr' : 1-modality instruction-DMS (3 ch...
7fed1af66d15e973cda9a5bc695015d62ed9349b5b54077ea85f6ab6d5ff73ae
MATLAB
15,644
398
function jdata=jdataencode(data, varargin) % % jdata=jdataencode(data) % or % jdata=jdataencode(data, options) % jdata=jdataencode(data, 'Param1',value1, 'Param2',value2,...) % % Annotate a MATLAB struct or cell array into a JData-compliant data % structure as defined in the JData spec: http://github.com/fangq/jdata...
d2727fdeadf178dc63bbb3420a71922ddf4b77284e03a144443865baeed5bb1e
MATLAB
15,645
283
classdef time_interval_object < handle % A helper object that creates time intervals based on bin widths, sampling intervals, etc.. These time intervals % (vectors of times) can be used to plot decoding accuracies against or to get the latency when decoding results are above chance. % The constructor of...
cf5973b742e57b356bd8f2606516591b2bea040c88e2766526042a8270a2aa93
MATLAB
15,665
498
function [Power, NPower] = PowerByChannel(animal, state, filtertype, probetype) if strcmp(probetype,'ECHIP512')==1 load('F:\Ephys Analysis\VLSE neuro 4-4 - HPC2\probe_data\ECHIP512.mat') numshanks=8; numchans=512; elseif strcmp(probetype,'ECHIP512_3xTg1-2')==1 numshanks=8; numchans=512; ...
ccd1c95a3efe3421be6b29537e1417adaca5b4bd8d775538ab58d8bb9a56ab26
MATLAB
15,676
420
function [trajectory,trajvector]=ea_reconstruct_trajectory(priortrajectory,tra_nii,side,refine,options) % __________________________________________________________________________________ % Copyright (C) 2014 Charite University Medicine Berlin, Movement Disorders Unit % Andreas Horn if strcmp(options.subj.postopModal...
0f0fc3f811c5d72758f73edbd800447b1b697b2356156bf8743d8b32981d342c
MATLAB
15,682
383
function [vals,fibcell,usedidx] = ea_unifiedmapping_calcstats(obj,patsel,Iperm) %No fibcell and usedidx for sweetspotmapping or networkmapping switch obj.drawTool case {'sweetspotmapping','networkmapping'} fibcell = {}; usedidx = {}; end % NB: for PCA, we are going to reassign I later in the functi...
d67dad10b3dca1cfe52bc05240c68811dcad9fa6d720d121a06f83af0b445a02
MATLAB
15,715
468
function fit = glmnet(x, y, family, options) %-------------------------------------------------------------------------- % glmnet.m: fit an GLM with lasso or elasticnet regularization %-------------------------------------------------------------------------- % % DESCRIPTION: % Fit a generalized linear model via pe...
38ce99a3ad4781a05acd313df651658c8328ad154987ac899a6672f2ded978f9
MATLAB
15,724
484
function prepareFigure(fh,type) % Special appdata settings: % LegendLocation: see location values of legend % PostProcessing: off, Psychometric Function, PsychometricData, % FontTemplate %% Settings type = lower(type); AX_FN = 'Helvetica'; LB_FN = 'Helvetica'; AX_FA = 'Normal'; LB_FA = 'Normal'; if strc...
ecabf085668ba5ac8b3ae6384a1a3a331d65666c6e9056f72bfce49f0953c02a
MATLAB
15,781
389
% statcondfiledtrip() - same as statcond except that it uses the fieldtrip % statistical functions. This is useful to perform % a wider variety of corrections for multiple % comparisons for instance. % Usage: % >> [stats, df, pvals, surrog]...
9812b89c34f8ef0dc41d11742e1a5ec0f5ab2db1f6e3e9c6f3895289561d7cbe
MATLAB
15,825
391
function [colocalMeasure, numOfObjects] = condColocPt2Pt2Pt(refCoords,tarCoords, condCoords,... mask,distThreshToColocWithCond, colocDistThresh, numRandomizations,alpha) %CONDCOLOCPT2PT2PT runs conditional colocalization for 3 channel images with 3 punctate objects % %SYNOPSIS [colocalM...
d693e82fc84224a88b85da1438c5e808ed961b5949fe6b5b8109c1efcbc0d499
MATLAB
15,844
387
classdef (Abstract, CaseInsensitiveProperties = true) functionalPlot < ... iosr.statistics.statsPlot %FUNCTIONALPLOT Abstract superclass for functional plots % % As an abstract class, this class cannot be instantiated. It provides no % public methods. The class is a super class for: % - iosr.statisti...
44f6354727e24bef7167a04c86657ac04004e5fddb74e435c809be4894e8ec0a
MATLAB
15,939
468
function results = PLSDA_paired_neuroimaging_pipeline(X, Y, subjectID, opts) % PLSDA_paired_neuroimaging_pipeline Within-subject PLS-DA for paired designs. % % results = PLSDA_paired_neuroimaging_pipeline(X, Y, subjectID, opts) % % Discriminates two conditions measured in the same subjects (pre/post, on/off) % f...
a77d72485b09a5d488caf7ee2c83456ac4e51af980dd54388e50f51fc3e1e0ce
MATLAB
15,939
271
function [cm_data]=magma(m) cm = [[ 1.46159096e-03, 4.66127766e-04, 1.38655200e-02], [ 2.25764007e-03, 1.29495431e-03, 1.83311461e-02], [ 3.27943222e-03, 2.30452991e-03, 2.37083291e-02], [ 4.51230222e-03, 3.49037666e-03, 2.99647059e-02], [ 5.94976987e-03, 4.84285000e-03, ...
e6e5e81affea7e8c5425e5617a4bff8c74919a5a3ca8f2671d74beed2975bf0b
MATLAB
15,941
427
function varargout = spindle_visualiser(varargin) % SPINDLE_VISUALISER MATLAB code for spindle_visualiser.fig % SPINDLE_VISUALISER, by itself, creates a new SPINDLE_VISUALISER or raises the existing % singleton*. % % H = SPINDLE_VISUALISER returns the handle to a new SPINDLE_VISUALISER or the handle to %...
18ef654deb73240873230e64ca0e0c0c0a5e562b56e8e6c31370fc56621b174e
MATLAB
15,949
362
%% v2struct % v2struct Pack/Unpack Variables to/from a scalar structure. function varargout = v2struct(varargin) %% Description % v2struct has dual functionality in packing & unpacking variables into structures and % vice versa, according to the syntax and inputs. % % Function features: % * Pack variable...
f6f4ac34215364cbb750bd45e1dd343c8cb8726442f385522c319c52580730d9
MATLAB
15,974
419
%% Modeling Drawer % Read outputs from hBayesDM ".mat" % only for prl_rp function currently % subjID, trial, choice, outcome % choice: (1=Left, 2=Right) % outcome: (1=Reward, -1=No Reward) % Liang-Yin Lu clear all; close all; %% Read Model data and reform data structure datapath = fullfile(pwd,'Example_f...
e1f6dc417f8c96e0f8c0162f7d66b314b52c1d7346f79036d2fb831031ffe2ff
MATLAB
15,994
392
%% modeltype4 - 4 neuron logic gate-like Izhikevich neuron system % Generates data for a small Izhikevich neuron network designed to % reproduce basic logic gate-like operations. A pulse stimulis is applied % to two neurons. Those neurons send connections to a third and fourth % neuron. The third neuron also sends a ...
6022002e6b6f1b27f7eb174e51eab08914251b16d7a45357df0d26cc5274499d
MATLAB
15,996
393
function ps2pdf(varargin) %PS2PDF Function to convert a PostScript file to PDF using Ghostscript % % Converts a postscript file into PDF. The resulting PDF file will contain % one page for each page defined in the postscript files, so a multi-page % postscript file, like those generated by using the '-append' option...
6d07e646176df4befb95c170efa22d5766d3fae900e5b88458652dfe38527115
MATLAB
16,000
474
function [mri] = ft_read_mri(filename, varargin) % FT_READ_MRI reads anatomical and functional MRI data from different % file formats. The output data is structured in such a way that it is % comparable to a FieldTrip source reconstruction. % % Use as % [mri] = ft_read_mri(filename) % % Additional options should be ...
389bd7798e74a1db5d286b206e795c42a450fbb3a3c975d847b5414c6be1d28b
MATLAB
16,043
394
function DOMnode = xml_write(filename, tree, RootName, Pref) %XML_WRITE Writes Matlab data structures to XML file % % DESCRIPTION % xml_write( filename, tree) Converts Matlab data structure 'tree' containing % cells, structs, numbers and strings to Document Object Model (DOM) node % tree, then saves it to XML fi...
81b07b847d855925c4d42444b7a2ee3e1c529d9ade7d39f0c32debac26736ac0
MATLAB
16,054
379
function ea_importfs(varargin) % This function imports freesurfer cortical reconstruction files into % patient directory, and converts .pial files to cortex.mat % % External Dependencies: % mri_convert (FreeSurfer) % % Function: % 1) Locate freesurfer directory % 2) Save cortex.mat to patientdirectory % _________...
debe13e2bc5b9ce4c7e49cad5354faa89663fecb478773853d4d520b14a85cd3
MATLAB
16,092
358
function [UDStates] = detectUD(varargin) % Detect up and down states from LFP. % % USAGE % % [spikes] = bz_loadPhy(varargin) % % INPUTS % (OPTIONAL) % basePath -(default: pwd) basePath for the recording file, in buzcode format: % whateverPath/baseName/ % folder mus...
2d6704a5fe5261e16bfdb7fe8301fa93e13f5c7fb293d303e9c572be55528ede
MATLAB
16,100
357
function CBIG_MMLDA_brain_behavior_to_doc_wrapper(subinfo_dir, out_dir) % This wrapper converts brain nifti files and behavior to documents used for MMLDA estimation. % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md if nargin < 1 || isempty(subinfo_dir) ...
13b13dff13d34de45f651918b040b5acca4350ca4beef2e6684a38e83cb1a963
MATLAB
16,110
554
% Using 2D or 3D affine matrix to rotate, translate, scale, reflect and % shear a 2D image or 3D volume. 2D image is represented by a 2D matrix, % 3D volume is represented by a 3D matrix, and data type can be real % integer or floating-point. % % You may notice that MATLAB has a function called 'imtransform.m' fo...
cb129c3c6342380f98b59dac6f5d918c3c71b8af070f73b41cfc858b3fcbdce7
MATLAB
16,117
446
function CBIG_Yeo2011_GrowBoundaries(num_network, outdir, save_int_file) % CBIG_Yeo2011_GrowBoundaries(num_network, outdir, save_int_file) % % This function takes the Yeo2011 Split Components and grow the boundaries. % The Yeo2011 Split Components Label has its boundaries being eroded. This % code aims to reverse the...
e05fe4887b4e1020efc969853e3ebffd02bb4e6f3541b237e42752a71e4de351
MATLAB
16,124
457
function [label, center, bCon, sumD, D] = litekmeans(X, k, varargin) %LITEKMEANS K-means clustering, accelerated by matlab matrix operations. % % label = LITEKMEANS(X, K) partitions the points in the N-by-P data matrix % X into K clusters. This partition minimizes the sum, over all % clusters, of the within-clus...
3bf31fab59e2d4123ff38e93f121a905653fcd5d2f9ecc27f688fa2be5336ee4
MATLAB
16,134
302
function [smPropPerTimeBoxed, smTrackletIdPerBox] = gridSmPerTimeInt(smPropPerTimeInt, varargin) %GRIDSMPROPPERTIMEINT: split movie frame into non-overlapping boxes and get SM information within each box % %SYNOPSIS: [smPropPerTimeBoxed, smTrackletIdPerBox] = gridSmPerTimeInt(smPropPerTimeInt, imageSize, varargin) % %E...
4c617f785cb9d71f71a87f25d093ee879d50fb9d2307c8f77341a04ca2e657e9
MATLAB
16,149
403
% pop_prop() - plot the properties of a channel or of an independent % component. % Usage: % >> pop_prop( EEG); % pops up a query window % >> pop_prop( EEG, typecomp); % pops up a query window % >> pop_prop( EEG, typecomp, chanorcomp, winhandle,spectopo_options); % % Inputs: % EEG ...
6fdb0ab74b8f99427832e9d0ea69542577801d75562a82c1184ae5b22517e457
MATLAB
16,163
422
function [vals,fibcell,usedidx] = ea_discfibers_calcstats(obj,patsel,Iperm) % NB: for PCA, we are going to reassign I later in the function if ~exist('Iperm','var') I=obj.responsevar; else % used in permutation based statistics - in this case the real improvement can be substituted with permuted variables. I=I...
44e31eb17c4337d3edf89bd0ffcdb6a7f5cbb0d8170a6a5a57086a2291a4f1ea
MATLAB
16,166
371
%% Correlating decoding accuracy with number of input units % Script that runs multiple decoding analyses with increasing number of % units. By bootstrapping each step, one can define the average decoding % accuracy of each step. close all; clearvars; clc % Choose sessions to plot scriptFullPath = matlab.desktop.edito...
60724d9684721d2348c3d9414527816706d8ee2f4469da2800166f9a43861434
MATLAB
16,190
484
function [ pupildilation ] = GetPupilDilation(basePath) %This is a detector for extracting pupil diameter from an IR video of the %eye. % %FILE REQUIREMENTS % This detector assumes the presence of a few files: % basePath/baseName.avi pupil video % basePath/analogin.dat analog signal of frame pulses fr...
05c4a01d3225f06266fd1b24ac6e11cba2abba57aa459ef774eecad9b4c6e948
MATLAB
16,191
504
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')); end %% ======================= compare...
558561dc5733a7dd1821fc76f9e1f959e80f41bfe7ffe0829495d3818f40d6eb
MATLAB
16,192
484
function [Y,W] = ndnanfilter(X,HWIN,F,DIM,WINOPT,PADOPT,WNAN) % NDNANFILTER N-dimensional zero-phase digital filter, ignoring NaNs. % % Syntax: % Y = ndnanfilter(X,HWIN,F); % Y = ndnanfilter(X,HWIN,F,DIM); % Y = ndnanfilter(X,HWIN,F,DIM,WINOPT); % Y = ndnanfilter(X,HWIN,F,DIM,WINOPT,...
6764850a75f5265cea4ab25fbc1ec705a93c666f928ccbf96960081aed92b77c
MATLAB
16,192
421
function tree = xml_parser(xmlstr) % XML (eXtensible Markup Language) Processor % FORMAT tree = xml_parser(xmlstr) % % xmlstr - XML string to parse % tree - tree structure corresponding to the XML file %__________________________________________________________________________ % % xml_parser.m is an XML 1.0 (http:/...
e4ec9a62428f0cd0e67c38223e3102700f777041fb3cd3efc7eed3c22bc5ab81
MATLAB
16,193
375
% importevent() - Import experimental events from data file or Matlab % array into a structure. % % Usage: >> eventstruct = importevent( event, oldevent, srate); % >> eventstruct = importevent( event, oldevent, srate, 'key1', 'value1', ...); % % Input: % event - [ 'filename'|array ] Filenam...
86cdeea8102c98f443da57790ff3544618894a9b0244151106bd1d730fa4ccab
MATLAB
16,208
467
function [x y pos trials map mapping] = getBehavEvents(pos,bins) % this function takes unlabeled position tracking data (LED or Optitrack) and, % through a semi-automated process, scores individual trials where an animal % traverses through the environment. Specifically, this code works well with the % 2AFC T-maze, l...
3e42d6ebacc665967dfecc1624d608c8413cc642b9e933c2720bbacce544c91f
MATLAB
16,210
304
% 设置基本目录 baseDir = 'E:\DAIRUI\REHO_study\fc_matrix\Data_450ROI_Music\'; groupDir = 'E:\DAIRUI\REHO_study\fc_matrix\Data_450ROI_Music\APFC_valueZero'; subjID = {'P01'; 'P02'; 'P03'; 'P05'; 'P06R'; 'P07'; 'P08'; 'P11'; 'P12'; 'P13'; 'P14'; 'P15'; 'P16'; 'P17'; 'P18'; 'P19'; 'P20'; 'P21'; 'P22'; 'P23'; 'P24'; 'P25'; 'P...
761935782093771077ccb68e1f8db6a0bb7edad29bd6a0d2ac02b50c3851f8ee
MATLAB
16,230
394
function varargout = ea_vatsettings_horn(varargin) % EA_VATSETTINGS_HORN MATLAB code for ea_vatsettings_horn.fig % EA_VATSETTINGS_HORN, by itself, creates a new EA_VATSETTINGS_HORN or raises the existing % singleton*. % % H = EA_VATSETTINGS_HORN returns the handle to a new EA_VATSETTINGS_HORN or the hand...
fe82a86021f605aedb557f04d6a221ed941005ca3b27d2bea628e9ff1ad0b29f
MATLAB
16,232
357
function plotGlobalQualityMetric(varargin) % Modified function that supports multiple input options % ------ % Inputs % ------ % % Option 1: plotGlobalQualityMetric(ephys_path, save_path) % ephys_path: Path to the ephys data directory containing Kilosort outputs % save_path: Path where to save the output plot figur...
b8011eabf381c50aeec4a9aa436267efbcc1f515f25b2567d46af1376f790f74
MATLAB
16,284
434
function obj=stat_summary(obj,varargin) % stat_summary Display summarized data for each value of X % % Example syntax (default arguments): gramm_object.stat_summary('type','ci','geom','lines','setylim',false) % For each unique value of x, this can display various estimates of % the location and variability of the corre...
0f6fabcc0b3edcd70814c92d8a2557f07530dab746f7928719d25087ef23fba8
MATLAB
16,290
393
% std_editset() - modify a STUDY set structure. % % Usage: % >> [STUDY, ALLEEG] = std_editset(STUDY, ALLEEG, key1, val1, ...); % Inputs: % STUDY - EEGLAB STUDY set % ALLEEG - vector of the EEG datasets included in the STUDY structure % % Optional inputs: % 'commands' - {cell_array} change...
4c73eb3544c643446e8bd5c5ce3ac904562aa3ccc23394f173ed909ec0d04833
MATLAB
16,294
576
function [infoPackets, version] = openCCF(filename) % openCCF % % This script reads a .ccf file and outputs it in a structure. % % filename: Name of the file to be opened. If the fname is omitted % the user will be prompted to select a file. % DEFAULT: Will open Open File UI. % % Channe...
9e38deaec4ce1e2e31c1cea7ea7c6960ac3e09ad92357c24766e56b3f76ba9d4
MATLAB
16,311
362
%% v2struct % v2struct Pack/Unpack Variables to/from a scalar structure. function varargout = v2struct(varargin) %% Description % v2struct has dual functionality in packing & unpacking variables into structures and % vice versa, according to the syntax and inputs. % % Function features: % * Pack...
ffa3f67727da7467a7b5c5405bba781df0ed8c9856043b80d58a4f9fffebd4c9
MATLAB
16,313
509
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')); end %% ======================= compare...
c60c3c9d37983317edc76aea406cdf0e24073fa8af240cc512d77b198f5b0592
MATLAB
16,358
478
function [dim, dE] = fnn(data,tau,MaxDim,Rtol,Atol,speed) % [FN,dim] = fnn(data,tau,MaxDim,Rtol,Atol) % data - column oriented time series % tau - time delay % MaxDim - maximum embedding dimension % Rtol - threshold for the first criterion % Atol - threshold for teh second criterion % speed - a 0 for the co...
34d67e5efbdec14ebd668c9d0f14b7265a2ea76c7942c402b0312cd78e071d65
MATLAB
16,394
531
%% LaBGAScore_pet_run_plot_PLS_ENet_pipeline.m % % % *USAGE* % % This script serves as a simple wrapper to run the PLS-DA and Elastic Net % neuroimaging pipeline functions and their plotting functions on parcel-wise % (whole-brain or ROI) PET data. % % The script takes excel outputs from the LaBGAScore_pet_model_TSPO_D...
18da8a4d2073ffdedbc6395bde76ce3c1778a92c4d9467f903943fd0c12636b9
MATLAB
16,398
437
function [Theta_select_probs,Theta_select,Theta_samples_select,Theta_bayes_factors] = MDSINESelectMCMC(X,F_hat_prime,growth_mean_p,growth_std_p,self_reg_mean_p,interact_std_p,perturb_std_p,numPerturb,nodeNum,Theta_init,Theta_indicator_init,params) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dyna...
66c212bf85a3fd762b2c70b398123b92780fb2a68a4f3a14f9904a3cc7888d57
MATLAB
16,411
413
%% LaBGAScore_secondlevel_roi_run_plot_PLS_ENet_pipeline.m % % % *USAGE* % % This script serves as a simple wrapper to run the PLS-DA and Elastic Net % neuroimaging pipeline functions and their plotting functions on fMRI ROI % data saved by the prep_3a_run_second_level_regression_and_save script. % % To control for cov...
412bdd9a83cafdba9ae20c1fd49b9bbfafa487f6451c79bbce10bbe284de15ff
MATLAB
16,444
365
classdef updater < handle % Web-based software updater class with download and installation capabilities. % Copyright (C) 2012 by Nima Bigdely-Shamlo, Swartz Center for Computational Neuroscience, INC, % UCSD. % Usage is only allowed under the same (non-commercial) license as Measure Projection toolbox....
0fa509fa994d29101d3add023902d7e37958420692f11868d63034e2857fd154
MATLAB
16,464
544
%% neurDemo1 % % neuroDemo1 reproduces the single neuron stimulation encoding figure. % Note, the scratch directory in the simulations folder will be used to % save data. These simulations will take up about 2 minutes to run and it % will require about 2 GB of space. % % Other m-files required: modeltype1, in...
9e4567af8a929f57945722f7fe81ee4603193c36350fc6631dec9ebde1157e59
MATLAB
16,486
429
function tree = xml_parser(xmlstr) % XML (eXtensible Markup Language) Processor % FORMAT tree = xml_parser(xmlstr) % % xmlstr - XML string to parse % tree - tree structure corresponding to the XML file %__________________________________________________________________________ % % xml_parser.m is an XML 1.0 (http:/...
b5cada0c499c9afc25eacf29d0f2d33bc63eba58cbd094c33a14c7a4b22f882c
MATLAB
16,486
472
function result = glmnetPredict(object, newx, s, type, exact, offset) %-------------------------------------------------------------------------- % glmnetPredict.m: make predictions from a "glmnet" object. %-------------------------------------------------------------------------- % % DESCRIPTION: % Similar to othe...
b14aecb914beb3df4132bd39ef6946d4e9d96e7449423f88f7b971076d6e29a8
MATLAB
16,511
368
function [colocMeasure, numOfObjects] = simulatePt2Pt2BlobCondColoc(numRefDetect,... numTarDetect,segmentation,cellMask,refColocWithCondFrac,tarColocWithCondFrac,... tarColocWithRefAtCondFrac,tarColocWithRefNotAtCondFrac,varargin) %SIMULATEPT2PT2BLOBCONDCOLOC simulate object positions t...
e5c491177475673cc9ebbfe2c788bda9054e888f1c29b84c3903309c3e587ccc
MATLAB
16,514
485
function ea_svd_segmentation(images, anchorImage, segmenter, segmaskPath, alg4PVS,alg4WMH,alg4Lacunes,sub_ID,only_segmask,alg4MB) % Add enlarged perivascular spaces, WMH and lacunes to segmask % By Butenko, konstantinmgtu@gmail.com arguments images % struct of paths to images anchorImag...
dfca67bb2411fd743729a19cf41f8b4d14f45a9ca30f7721fa060f7f6203bd42
MATLAB
16,536
204
% EEGLAB menus: % File % Import data % Using EEGLAB functions and plugins % From ASCII/float file or Matlab array - <a href="matlab:helpwin pop_importdata">pop_importdata</a> % From Netstation binary simple file - <a href="matlab:helpwin pop_readegi">pop_readegi</a>...
d2130e93d9602ca17f8cf9e4cd2deb8d54267baab8767fd30efb1e7e5cb28aef
MATLAB
16,539
1
function B=inpaint_nans(A,method) % INPAINT_NANS: in-paints over nans in an array % usage: B=INPAINT_NANS(A) % default method % usage: B=INPAINT_NANS(A,method) % specify method used % % Solves approximation to one of several pdes to % interpolate and extrapolate holes in an array % % arguments (input): % A...
6739954a011b1f8ada07a341b43d92ce4b6eedae129bdddd4b44195c063352c1
MATLAB
16,547
294
function AnimalMetadata = bz_AnimalMetadataTextTemplate(basepath) % This .m file is a generic template and will be copied to animal % folders/session folders and will be called basename_AnimalMetadataText.m. % It is represents code that will be used to % create a basename.AnimalMetadata.mat file. Edits here will be re...
8e061a11f92a8629c99f64300c254c16f629067ca050d74371946dbabeecc3fd
MATLAB
16,549
385
function [spine_evolve, num_turnover, Dendrite_CrossSess,... filelist, targetdata, TranM, handles]... = spineEvolveAna(handles) % funcsel = prepCrossSessReg(handles); % rb1 = 'Register to the last dataset'; % rb2 = 'Register to dataset 1'; % rb3 = 'Use existing transform matrix'; spine_evolve...
9bccec39f86811dd9a298ba6570a017b009bceea8502a00f48aa12f13c6d783c
MATLAB
16,570
439
function htmlfile = LaBGAScore_prov_publish(scriptname, htmlsavedir, varargin) % % % *USAGE* % % Drop-in replacement for the publish() call documented in the header of % every LaBGAS second-level script. Where you would type % % publish('cfs_secondlevel_m14_s7_c2a_second_level_regression', ... % 'outputDir'...
33be04a8314ded4a6d508fce70bd415157b25abfffded0e99cd52ae96813c9c7
MATLAB
16,579
443
function seed_tc=cs_fmri_conseed_nifti(restfile,seedfile,options) directory=[fileparts(restfile),filesep]; options=ea_getptopts(directory,options); options=ea_assignpretra(options); [~,restfname]=fileparts(restfile); [~,anatfname]=fileparts(options.prefs.prenii_unnormalized); options.prefs.rest=[restfname,'.nii']; ...
c8bd318314ac34e828480f127ddeea07d1bcc0d2abac54bbdfaece47ee96545e
MATLAB
16,598
348
function tests = testLyE %TESTLYE Contract and known-answer tests for LyE_R and LyE_W. % % BENCHMARK DESIGN. Lyapunov estimators are tested here in three layers, % weakest evidence last, because no single reference is sufficient. % % Layer 1 -- INVARIANCES. Properties that hold for every series with no % refere...
d85cb443b6070ca0763fab38d744b939f44031cdb41e2273837d92e622305d38
MATLAB
16,599
636
function [selected_file, selected_path] = rri_select_file(varargin) % % USAGE: [selected_file, selected_path] = ... % rri_select_file(dir_name, fig_title) % % Allow user to select a file from a list of Matlab competible % file format % % Example: % % [selected_file, selected_path] = ... % rri_select_...
bff1123815a79e822bebcfeb2b4786f6ef5e7648eaf861c8baf560c8b245ed1f
MATLAB
16,613
421
function tree = xml_parser(xmlstr) % XML (eXtensible Markup Language) Processor % FORMAT tree = xml_parser(xmlstr) % % xmlstr - XML string to parse % tree - tree structure corresponding to the XML file %__________________________________________________________________________ % % xml_parser.m is an XML 1.0...
9cfac462cb20f3a246eb2e4921a7d642105450fcfc55af6632292e07bbc6f7cc
MATLAB
16,616
446
% help2html() - Convert a Matlab m-file help-message header into an .html help file % % Usage: % >> linktext = help2html( filein, fileout, 'key1', val1, 'key2', val2 ...); % % Inputs: % filein - input filename (with .m extension) % fileout - output filename (if empty, generated automatically) % % Opti...
623103fecf598b00f422822c4638385bc43cecb435fc4e9841713ea7aa584ec1
MATLAB
16,632
438
function [coef,alphas,offset] = fracridge(X,fracs,y,tol,mode,standardizemode) % function [coef,alphas,offset] = fracridge(X,fracs,y,tol,mode,standardizemode) % % <X> is the design matrix (d x p) with different data points % in the rows and different regressors in the columns. % <fracs> is a vector (1 x f) of one or ...
b03a9351b4edcc4800e54224e16753176ed27b90738a7fc23703a142340e4294
MATLAB
16,689
345
%% ============================================================ % Threshold sensitivity analysis for PrL calcium-network pipeline % % Based on: % - solve_calcium_PrL_Apr1_2026.m % - calcium_data_PrL_SB_struct_clean.m % % What this script does % 1) Runs the same PrL WT + Shank3 structured pipeline % 2) Sweeps co...
1ea4893641848cb20226fafa0a8301374cfb40e95dcdb61c859ccfc40f23ea07
MATLAB
16,692
310
function [channel] = channelselection(channel, datachannel) % CHANNELSELECTION for EEG and MEG labels % % This function translates the user-specified list of channels into channel % labels as they occur in the data. This channel selection procedure can % be used throughout fieldtrip. % % You can specify a mixture of r...
db93f244afa1839124608a4555d0ee21e79c0e775a0668cafca7922d3f85e449
MATLAB
16,698
331
function [propPerSmPerCellOutput, propStatsPerCellOutput, trackClassSizePerCellOutput, inputParam] = ... collectSmPropByTracklets(combnPropPerTimeInt, prop2extract, indicesOfInt, figFlag) %COLLECTSMPROPBYTRACKLETS: collect specified single-molecule property from combinePropPerTimeInt % %SYNOPSIS: [propPerSmPerCell...
473bf44f1c16aa89cd0ed58e8e269bc9e3865ed9ba8d17dbcc2d6bc39baf255d
MATLAB
16,700
269
function [cm_data]=inferno(m) cm = [[ 1.46159096e-03, 4.66127766e-04, 1.38655200e-02], [ 2.26726368e-03, 1.26992553e-03, 1.85703520e-02], [ 3.29899092e-03, 2.24934863e-03, 2.42390508e-02], [ 4.54690615e-03, 3.39180156e-03, 3.09092475e-02], [ 6.00552565e-03, 4.69...