sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ec644b3a0df61eae8f5d41e3d49159d0f7523c375877417f008c674354954d79
MATLAB
2,376
51
%VL_NNBILIEARSAMPLER CNN spatial bilinear resampling % Y = VL_NNBILINEARSAMPLER(X,GRID) resamples image X at the spatial % locations specified by GRID using bilinear interpolation. % % X is a array of dimension H x W x C x N, where (H,W) are the % height and width of the image, C is the number of feature % c...
92acb3012259b994a8bab6cd0f4bcd2d54a26c5e10a86f3ecf70720d3d3a70e6
MATLAB
2,377
71
function [ events, infos ] = nmri_read_event_edf( edf_file, subject ) % [ events, infos ] = nmri_read_event_edf( subject ) % Reads in EDF annotations from if ~exist('subject','var') || ~isfield(subject,'hdr') || ~isfield(subject.hdr,'orig') || ~isfield(subject.hdr.orig,'annotation') error ('Subject not set or HD...
16f96f6ca89097ed4ca5ff3e876516a2dfc5ca4614bfd316e193d51270adb8d9
MATLAB
2,378
66
% coreg_nifti.m % Chris Davies-Jenkins, Johns Hopkins University 2022. % % USAGE: % [vol_mask, T1_max, voxel_ctr] = coreg_nifti(in, vol_image, maskFile) % % DESCRIPTION: % Creates a SPM volume containing a voxel mask with the same dimensions % as the SPM volume containing a structural image. The voxel mask is % crea...
7296bc30882169ff757db2fc2df416803bb81031814a0abddd4c74006b096674
MATLAB
2,378
82
function [ tickLabels ] = parse_labels( dcm, labels, idx ) % Generate labels for axis ticks. % % This is a protected method of the tapas_Huge class. It cannot be called % from outside the class. % % Author: Yu Yao (yao@biomed.ee.ethz.ch) % Copyright (C) 2020 Translational Neuromodeling Unit % Inst...
75a92069b942a1d393f13b4b0c89e6f382b5c8baee3158d71f986b3896dfe1bd
MATLAB
2,378
46
% % % step 0 : to change the dimension of the mask % % %first initiate CPP_SPM in batchSearchlight.m % % % % % suject to run in each group % % opt.subjects = {'001','002','003','004','005','006','007','008',... % % '009','010','011','014','015','016','017',... % % 'pil001','pil002','pil004','...
91d24a6f0e029fd5ef33d622e65b4236c2fc0e8af2bbb3053de42c6dd9c5127e
MATLAB
2,378
77
function plotTextLabels(coords_xy,textLabels,fontSize,categoryColumns,categoryColors,categoryLabels) % plots the set text labels in cell array 'textLabels' at the positions % 'coords_xy' in the current plot in font size 'fontSize' in black (by % default) or using category colors specified by optional further arguments...
5c7660a048dc3bbd59bbec582e2bfdf182d771e5c6dab2513828819c6468d4b0
MATLAB
2,379
60
% bids_checkfields() - Check BIDS fields % % Usage: % >> struct = bids_checkfields(struct, fielddefs, fieldname); % % Inputs: % struct - [struct] structure with defined fields % fielddefs - [fielddefs] field definition % fieldname - [string] structure name % % Outputs: % struct - checked structure % % Au...
953aea4a0b7796a8bdb6c35463813e9fc7d40959d74633a6c4b206b35d7dc850
MATLAB
2,379
94
function [fig] = tapas_sem_plot_constraints(constraints, model) %% Plot the constraints matrix % % Input % constraints -- Constraints matrix % model -- String with model (seria or prosa). % % Output % fig -- Handle of the figure created. % % aponteeduardo@gmail.com % copyri...
aeb334ae38ffa707d24a969202a0823e995a9179dc4a1bbe90d319366a3b6cbf
MATLAB
2,379
35
function preprocess_nsd_functionaltostructuralalignment(subjix) % function preprocess_nsd_functionaltostructuralalignment(subjix) % % <subjix> is 1-8 % % Use ANTS to determine an EPIaffine and then an EPIsyn % to match the EPI (mean of first 5 sessions 1.0-mm resolution) % to the T2 (1.0-mm version). We use some care...
c80f23e81d326ca2d2a9085be39a76424479c18ecd0253e18c6bd64a7f8df357
MATLAB
2,379
76
function [stats] = boxSwarmPlot(y, x, isDep, colour, noOutliers) % create boxplot with significance labels and individual data points % plotted on top (swarmchart); % INPUT % y = vector with data to plot; % x = vector with x-positions for data in y; % default settings if nargin<3 isDep = 0; end if nar...
11881413b811fee7279bccf005ea7a9f3477561fa1e492f42ad81a0ace54126b
MATLAB
2,380
67
function T = spm_type(x, arg) % Translate data type specifiers between SPM & MATLAB representations % FORMAT T = spm_type(x, arg) % x - specifier % T - type % arg - optional string argument, can be: % - 'maxval' - return maximum allowed value. % - 'minval' - return minimum allowed value. % ...
232afdb4b21c8e10fc9bc124915f00478a90b776d620239f4f2ed0f416e57e2c
MATLAB
2,380
71
function [w] = tapas_physio_conv(u, v, filter_type, padding) % Wrapper around `conv()` for convolution % Deals with the padding and time offsets % % [w] = tapas_physio_filter_cardiac(u, v, filter_type) % % IN % u Data time series [1-D] % v Convolutional filter time series [1-D] % filter_t...
84194a02c6e07088fd46a730cbfbd7161b0846af5c78e97b8f260975c33657bf
MATLAB
2,380
55
function updatedWeight = ARTwarp_Average_Weights(weight, inputLengths, inputCategories) % ARTwarp_Average_Weights warps every category's reference contour (weight) % uniformly to be the mean length of the contours in that category. % UPDATEDWEIGHT = ARTwarp_Average_Weights(WEIGHT, INPUTCONTOURS, INPUTCATEGORIES) %...
d26e8aae6f45f516027d119fbeca98441e5bfea3f812b7433d7b70ee7b5f8d50
MATLAB
2,380
106
function [posterior, summary] = tapas_sem_example_mixed_estimate(model, param) %% Example for inversion with a mixed effects model as prior. % % Input % model -- String. Either seria or prosa % param -- String. Parametric distribution. % Output % posterior -- Structure. Contains the post...
71ad0692fd44a2ebbd726b8d2338802af93c326d1ed11ebbb36f4cc3c8ee7fa2
MATLAB
2,381
79
function [stats,message] = anova1_repmeas_onMatrix(data) % % function stats = anova1_repmeas(data) % % One-factor, within-subject repeated measures ANOVA. % For designs with one within-subject factor. % % Parameters: % data dependent variable (numeric), where: % ROWS are OBSERVATIONS % ...
db60defd7986c49c8e235ea4c46ca93eb8338b0757f3b9bb361665c3727634cb
MATLAB
2,382
65
function subjList = subjList_updateAnalyzed(params) % updates subject list based on those that were analyzed (e.g. if some paradigm parts could not be run) % (c) Jiri, Jul22 if exist([params.storage.dir_results filesep params.storage.outName],'dir') ~= 7 error(['output directory for results not found, dir = ' par...
113f9f3a494a9abf5733704231955631cee7843b59ba5fa938fe68c8d50615d2
MATLAB
2,384
68
function ni_def = afni_ni_defs() persistent cached_ni_def % for efficency reasons generate the definitions only once; % upon each subsequent call the cached data is used if ~isstruct(cached_ni_def) cached_ni_def=generate_ni_def(); end ni_def=cached_ni_def; function ni_def=generate_ni_...
c18570f4607200e569c2d2220929256594d2ca1d2a61b1ad733bf9832460e983
MATLAB
2,384
73
function options=getUserOptions(newOptions,defOptions,allowed); % function Opt=getUserOptions(options,Opt); % % Deals with user-option structure. It allows the user to specify user % options as a structure, or as a set of fieldnames and values % % INPUTS % options: either a structure of user options or a cell array ...
e04e399cc05275298187abd4407be1e9276e05e18212b8370716e20f158d7c20
MATLAB
2,384
65
% CONVOLVE - convolve two matrices (normalize by the sum of convolved % elements to compensate for border effects). % % Usage: % >> r = convolve( a, b ); % % Inputs: % a - first input vector % b - second input vector % % Outputs: % r - result of the convolution % % Autho...
ef8948d22fa5c94b13be45877ec437b4cdef78655428f7e157f7efb22a6dae51
MATLAB
2,384
68
function X = thomson_problem(n, d) % Simple attempt at computing n well distributed points on a sphere in R^d. % % This is an example of how Manopt can approximate the gradient and even % the Hessian of a cost function based on finite differences, even if only % the cost function is specified without its derivatives. ...
ba99a6cb4f8755f64fda4a8c1f21c276cb5da1ff83df5d79e0eb46f15c8cb945
MATLAB
2,385
95
function fir = SavitzkyGolay(n,varargin) % Version 1.4 - 31/03/00 - rotter@biologie.uni-freiburg.de % % fir = SavitzkyGolay([nl,nr]) gives a Savitzky-Golay smoothing filter % of total width nr-nl+1. It extends -nl data points to the left and nr % data points to the right of the point of operation. Works by least % squ...
a1a948686f25c8d2b3a63e7668212ebc6f29557274e3bec4c7f1c93819c0125e
MATLAB
2,386
92
% LDA - MATLAB subroutine to perform linear discriminant analysis % by Will Dwinnell and Deniz Sevis % % Use: % W = LDA(Input,Target,Priors) % % W = discovered linear coefficients (first column is the constants) % Input = predictor data (variables in columns, observations in rows) % Target = target var...
46ec2820d4841f2a4c3706bf0e1ba91aa1960a51f95800a24653dedee40b3776
MATLAB
2,389
62
% EEG_GETICA - get ICA component activation. Recompute if necessary. % % >> mergelocs = eeg_getica(EEG, comp); % % Inputs: % EEG - EEGLAB dataset structure % comp - component index % % Output: % icaact - ICA component activity % % Author: Arnaud Delorme, 2006 % Copyright (C) Arnaud Delorme, CERCO, ...
348584f4a0d90be26477e700e51bbe9013d91b3644342db7a2af0a6cac5908c1
MATLAB
2,390
58
function G = minimize_lbfgsb_gradfun(X,varargin) % extract input arguments varargin = varargin{1}; strctX = varargin{2}; f = varargin{1}; % global variables serve as communication interface between calls global minimize_lbfgsb_iteration_number global minimize_lbfgsb_objective global minimize_lbfgsb_gradie...
b326c406c8e326e89e127e9eac40de41a36ca1de73071024211db0399a14b863
MATLAB
2,390
68
function clr_RGB = msSwitch_get_clr4aa(aa_name) % returns color for anatomic area name % (c) Jiri, Jun23 aa_found = false; % init clr_RGB = [0 1 0]; % init, green %% was aa_name from: Yeo7 networks ? % area_color_yeo7 = { ... % 'Default', [255 198 82]./255; ... % 'Dorsal Attention', [181 66 107...
f14ac27e74b570cba008fb17bbc6725a9b5966d71e7c8797aa835b9c835d21d1
MATLAB
2,391
102
function [mu, S, nu] = fitt_fast(x) % FITT(x) % % Fit a t-distribution using the ECME algorithm (Lui & Rubin, 1995) % % C Liu and D B Rubin, (1995) "ML estimation of the t distribution using EM and % its extensions, ECM and ECME", Statistica Sinica, 5, pp19-39 % http://www3.stat.sinica.edu.tw/statistica/oldpdf/A5n12.pd...
b809aebad296b504d2e6b5cc247682f7881a7cf65069d2ee57247b344a6b19fd
MATLAB
2,392
64
% lookupchantemplate - look up channel template. % % Usage: % [ found transform ] = lookupchantemplate( filename, template_struct); % % Inputs: % filename - channel location file name % template_struct - template structure as defined in dipfitdefs % % Outputs: % found - [0|1] 1 if a transformation was...
e66f34698d1628bbef7666575b839e17d49369e86e7a9816ebb7e3f941d8a367
MATLAB
2,392
66
%% This file is used to identify cell masks for compartmental area clear all close all parent_folder = 'Y:\20241208 D54D2 in b2KD and WT_APP\Analysis'; dirs = dir(parent_folder); for m = 1%:length(dirs) if dirs(m).isdir && ~strcmp(dirs(m).name, '.') && ~strcmp(dirs(m).name, '..') folder_path = fullfile(p...
fbbc813fd2a38cc9aef3ec75085de1811aef9ba014eb7f336045d68bde3a9171
MATLAB
2,392
64
function [matlabbatch, indValidContrasts] = tapas_physio_check_prepare_job_contrasts(fileSPM, ... model, SPM, indReportPhysContrasts, namesPhysContrasts) % adapts contrast generator for physiogical regressors to actual SPM-file % (directory & design matrix columns) % % % IN % fileSpm % model % SPM % indR...
0351f2cccf5ccc5480db7004d6974295ee278b9b060c053aece9039aedb3be35
MATLAB
2,393
65
function sqrtPd = getSqrtPrecon(problem, x, d, storedb, key) % Applies the square root of the Hessian preconditioner at x along d. % % function sqrtPd = getSqrtPrecon(problem, x, d) % function sqrtPd = getSqrtPrecon(problem, x, d, storedb) % function sqrtPd = getSqrtPrecon(problem, x, d, storedb, key) % % Returns as sq...
14e34281ed5445542ea3611492324732045d267e63679a729463dad33dd5f201
MATLAB
2,393
69
function [ output ] = tapas_rdcm_compute_statistics(DCM, output, options) % [ output ] = tapas_rdcm_compute_statistics(DCM, output, options) % % Computes statistics for the posterior parameter estimates % % Input: % DCM - model structure % output - model inversion results % options -...
dc03180f831f0ed02bf3d631f592980709304f42a0ccdc332f36022a38957b76
MATLAB
2,393
81
function [meg] = read_ctf_dat(filename) % READ_CTF_DAT reads MEG data from an ascii format CTF file % % meg = read_ctf_dat(filename) % % returns a structure with the following fields: % meg.data Nchans x Ntime % meg.time 1xNtime in miliseconds % meg.trigger 1xNtime with trigger values % meg....
0ca914fbdd0a9015ece1dfb6e7b05b7ea9989b5f2ae510cfce027d2c25301363
MATLAB
2,394
72
function [] = Intensity(filename,filetime,diameter,sigma_threshold) stack_info = imfinfo(filename); [~,savename,~]=fileparts(filename); mkdir(savename); image_width = stack_info(1).Width; image_height = stack_info(1).Height; image_count = length(stack_info); image_stack = zeros(image_height,image_width,image...
7a6f3442808fc34c354685a5828a7b86537e1e1c454f5cfeaa490c7c4f3df7de
MATLAB
2,394
100
function play(movie,varargin) % EXAMPLE USE WITH ARGUMENTS %[options]= play(movie) - use 1 %[options]= play(movie,movie2) - use 1 % % HELP % Simple player for movies, inspired by 'playMovie' by Biafra. % Just provide 3D matrix of the movie and terminate by pressing a character 'e' % speed up or slow down with keyboard ...
eaa14585ccba453f41c8434aa95d7a9ff1d6e97778cede5357b80aac5751c969
MATLAB
2,394
88
function [ DCM ] = tapas_ceode_synData_erp() % [ DCM ] = tapas_ceode_synData_erp() % % Sets parameters and function handles to create a synthetic DCM % structure. The resulting structure can then be used to generate % artificial data with tapas_ceode_gen_erp.m % % INPUT % % OUTPUT % DCM struct DCM st...
e9bba4416b9a9b5ea355f3b068f22a79ce0bf39abce220467102aec744ad73b7
MATLAB
2,395
63
% 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...
31a7a7ff66c39f2504531c9ec47d035208a571e08d8268e0ce111cb89b023bc7
MATLAB
2,397
74
% createQuadratureLogGaussianFiltersSpace.m function [bpP1,bpfP1,bpP2,bpfP2,xCenterPix,yCenterPix] = createQuadratureLogGaussianFiltersSpace(fovPix,fovDeg,g1_sigma,g2_sigma,xCenter,yCenter,g2_amp) if mod(fovPix,2) == 0 fovPix = fovPix + 1; end if ~exist('g2_amp','var') g2_amp = 1; end if g1_sigma > g2_sigma...
1deec9f5d9b2b3078cb57a630f2cd4e9c50b40be3d1980c79ef6e69cac8998ac
MATLAB
2,399
78
function dendplot(topology,labels,fontsize) % DENDPLOT: Plots a dendrogram given a topology matrix. % % Usage: dendplot(topology,{labels},{fontsize}) % % topology = [(n-1) x 4] matrix summarizing dendrogram topology: % col 1 = 1st OTU/cluster being grouped at current step % ...
2c0e621ff7bb2cc20c58b07ef7bd98fb3fa1b6a20a35f93d69c348888f543eba
MATLAB
2,399
83
function [sidxs,r2]=surfing_selectkfirstidxs(k,idxs,inclmsk) % selects approximately the first k non-zero unique indices % % SIDXS=SURFING_SELECTKFIRSTIDXS(K,IDXS,[ROWHINT]) % % INPUT: % K: number of indices to select % IDXS: NxP matrix with indices, corresponding to N nodes with at most P % indice...
2dcbc42e802d464fcc0c88205d8fad0482534eda7d4ab4a5f2c1fce6f7e079ab
MATLAB
2,399
87
function [chunksFirstLast,summary]=chunkFrames(chunkSize,frameFirstLast) % Prepare ranges of frames to load from a files - chunks to load without overfilling the memory. % SYNTAX % [chunksFirstLast,summary]= chunkFrames(chunkSize,frameFirstLast) % % INPUTS: % - chunkSize - an interger e.g. 500 if that's reasonable to l...
a6f6f29daf7c7cceaf11723b99520a7839be0750d31028b57f74c7871c341be5
MATLAB
2,399
89
function out = tor_conv_sphere(mask,vox_radius,mmethod,varargin) %function out = tor_conv_sphere(mask,vox_radius,mmethod,[norm factor]) % norm factor is optional. scaling factor to divide all values by % in spherical convolution. % used because the convolution does not return a max height of 1 given % one input poin...
f7296ed96c90fb100cf4a3fc17d24e0fa79a80d8c7ecede687bbdb507be35e71
MATLAB
2,399
67
function numFolds = HowManyFolds(groupLabels,numClasses) % Set the number of folds for k-fold cross validation using a heuristic % (for small datasets with fewer than 10 examples per class): % %---INPUTS: % groupLabels, labels of groups in the dataset % numClasses, the number of classes of time series % --------------...
9823ee2d19adfc3545b682ad80eee5f9f9bfc1c985f8206227b72e2520940c8d
MATLAB
2,400
74
function plotTargetClassifierTimingAll(output) % Plots distributions of crossing times for classifier projections % time runs vertically % Figure fig; hold on axis off ax = gca; % Params bxw = 0.25; alpha = 0.35; dotSize = 15; spacing = [1,1.75]; buff = 2.5; axlocs = [spacing; spacing + buff; spacing + buff*2; spacin...
d4dd813606e399f59b95d6c071047784ccad8ce82a8f2b87ee476826321b660e
MATLAB
2,400
74
%% h = sepia_handle_panel_qsm_CFS(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 handle...
033f84e69764a343a6903c3153988c09ac5a6ac3f4f856a552e6fe038f798c51
MATLAB
2,401
125
function H=demoOctave_shadedErrorBar % demo function for shadedErrorBar % % function demo_shadedErrorBar % % No input or output arguments. % % % rows=2; cols=2; clf subplot(rows,cols,1) %Plot the mean and standard deviation then overlay the raw data y=randn(30,80)*5; x=(1:size(y,2))-40; yP = sin( linspace(-2*p...
64fd707637210edf58c942c85711a60f952221c80da015e3f2466f925266e557
MATLAB
2,401
106
function [Ydev] = predict_variance(X, Model, parm) % Variance of posterior predictive distribution % [Ydev] = predict_variance(X, Model, parm) % % % % % 2009-11-5 M. Sato if ~exist('parm','var'), parm = []; end; if ~isfield(parm,'Tau') tau = 1 ; D = 1 ; else tau = parm.Tau; D = par...
8f5405a749a59039b2672068eb8d93875825ed8ab3610b4edc3734619d54667a
MATLAB
2,401
90
function [x,w] = fnnls(XtX,Xty,tol) %FNNLS Non-negative least-squares. % % Adapted from NNLS of Mathworks, Inc. % % x = fnnls(XtX,Xty) returns the vector X that solves x = pinv(XtX)*Xty % in a least squares sense, subject to x >= 0. % Differently stated it solves the problem min ||y - Xx|| if % XtX = X'*X and ...
c880a35411bb93b335ffb20daf4efff783470518d0fcb81cfeded97dfbf2a182
MATLAB
2,401
71
function mra = modwtmra_custom(wpt, wavelet_type) %(Inverse Stationary Wavelet Transform) % % Usage: % mra = modwtmra_custom(wpt, wavelet_type) % % Inputs: % wpt - (Bands x Samples x Channels) matrix % Order: [W1, ..., WJ, VJ] % wavelet_type - 'haar' % % Output: % mra - (B...
ea1c1e64a57ad5e7da2e4d9f40712850cb74e351c7645a894bdbec51e0d37c6b
MATLAB
2,401
70
function [Mout, RHSout] = combineBC2D(MeshStructure, BC, Meq, RHSeq) %COMBINEBC This function combines the boundary condition equations with the %main physical model equations, and delivers the matrix of coefficient and %RHS to be solved for the internal cells. % % SYNOPSIS: % % % PARAMETERS: % % % RETURNS: % % % EXAMP...
039d9b2f656903302f18629aec28886d5bddc07c173bdb53464a58477eedfea3
MATLAB
2,402
52
%VL_NNBILIEARSAMPLER CNN spatial bilinear resampling % Y = VL_NNBILINEARSAMPLER(X,GRID) resamples image X at the spatial % locations specified by GRID using bilinear interpolation. % % X is a array of dimension H x W x C x N, where (H,W) are the % height and width of the image, C is the number of feature % c...
0d813d9027e8a5568abce90d827213dc6df199301533c2e052e937aaca2e3680
MATLAB
2,402
64
function [wtNorm_mean, wtRaw_mean] = prev10Rews(A, ntrials, inferredMixArg) % Compute wait times conditioned on the sum over the previous (ntrials) % trials %INPUTS: % A = .mat file of individual rat behavior data % ntrials = number of trials to sum over % inferredMixArg = whether to also filter by trials infer...
eed5919918a36e84e51681790ca905312c02d70807e0848daac26b044c01b941
MATLAB
2,402
59
function c = tapas_unitsq_sgm_mu3_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the unit square sigmoid observation model for binary responses % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
e24097b80a7ba04818623d6ff3179fd0c18a2c72dcad9600857a5443f2588205
MATLAB
2,403
83
function MS = createMeshCylindrical1D(varargin) % MeshStructure = createMeshCylindrical1D(Nr, Lr) % MeshStructure = createMeshCylindrical1D(facelocationR) % builds a uniform 1D mesh (1D axial symmetry): % Nx is the number of cells in r (radial) direction % Width is the domain radius in r direction % % SYNOPSIS: % Mes...
d0396670330a7352a19c02c870e565a38d61db192ac098347eb61498dd4e383a
MATLAB
2,404
140
% What can Panel do? % % This demo just shows off what Panel can do. It is not % intended as part of the tutorial - this begins in % demopanel2. % % (a) It's easy to create a complex layout % (b) You can populate it as you would a subplot layout % (c) You can export it to a "camera-ready" image file % % Now, move on t...
7d911424bf11c51be9e8e079a46e225f2bde327ef4b5c6828bc73f5ef798e350
MATLAB
2,406
69
function [ delta, v_mi, x_mi ] = EmergenceDelta(X, V, tau, method) %% EMERGENCEDELTA Compute downward causation criterion from data % % DELTA = EMERGENCEDELTA(X, V) computes the downward causation criterion % delta for the system with micro time series X and macro time series Y. % Micro data must be of size...
808d047d44fa83b91fc5dd5c345e43a3db5e951952c51f2d2defdbe9ccfc0e9e
MATLAB
2,406
63
% EEG_EPOCH2CONTINUOUS - convert epoched dataset to continuous dataset % with data epochs separated by boundary events. % Usage: % >> EEGOUT = eeg_epoch2continuous(EEGIN); % % Inputs: % EEGIN - a loaded epoched EEG dataset structure. % % Inputs: % EEGOUT - a continuous EEG datase...
b0975ecacb424e834399694c588d9095bc57d57281e83717f1407407256fdf6f
MATLAB
2,406
62
function [norm_ratio, pdf_density, edges] = get_norm_ind_distr(sim_file, upper_lim, bin_width) % GET_NORM_IND_DISTR % Syntax: % [norm_ratio, pdf_density, edges] = get_norm_ind_distr(sim_file, upper_lim, bin_width) % Description: % Load three simulations (suffixes _1, _2, _3) and compute the ratio % (rate_1 + rate...
0f67cc5073f6b1edf44bf0ad281a2bd477ac4ebe4d14ecd3ca2e1a459829e1cb
MATLAB
2,407
64
%io_writelcmraw.m %Jamie Near, McGill University 2014. % % USAGE: % RF=io_writelcmraw(data_struct,outfile,metab); % % DESCRIPTION: % Take a simulated metabolite basis spectrum in matlab structure format, and % output it into LCModel RAW format to be used in an LCModel basis spectrum. % % INPUTS: % data_struct = si...
7f04f5ae10a9e82bea3ebb4f334149f6e4fe8ab9055ce5f9ab628c0da6cb27e5
MATLAB
2,407
60
function selectionIndexArrayCell = tapas_uniqc_convert_selection_range_to_array(selectionIndexRangeCell) % Converts selection name/range pairs to cells of single selections % % selectionIndexArrayCell = tapas_uniqc_convert_selection_range_to_array(selectionIndexRangeCell) % % IN % selectionIndexRangeCell cell(1...
e766804f0c14df060a22a2b2c7a0240abdfb737e1ef56e909d79c384a1742e19
MATLAB
2,407
101
function dat = bar_interactive_btnupfcn; % [dat] = bar_interactive_btnupfcn; % % function for loading and plotting hewma data from a voxel. must have declared globals f,f2,VOL,EXPT % see hewma_timeseries_plot, the shell function. global han % handle of gui global P % names of images global xnames % x-a...
f1ecc280c010e65ba3baac79f83f1072b26f348454bbffdf5721c46e32881c1b
MATLAB
2,407
93
function atlasName = anatomicalAreas_atlas4AA(aaName) % returns name of the atlas given an anatomical area (or n.a. if not found) % (c) Jiri, Aug22 atlasName = 'n.a.'; % init (not found) %% was aaName part of the Yeo7 atlas? AA_list = { 'Visual'; 'Somatomotor'; 'Dorsal Attention'; 'Ventral Attenti...
5a9254b8d987433cffe2151b38df6767b51da43cee1c4c24088c898b89e7d665
MATLAB
2,408
80
%% DistanceTuningCurve % Draw firing map of units %% Dataset Paths datasetBasePath = 'D:\Data\Lobster\FineDistanceDataset\'; resultBasePath = 'D:\Data\Lobster\FineDistanceResult_syncFixed_May'; filelist = dir(datasetBasePath); sessionPaths = regexp({filelist.name},'^#\S*','match'); sessionPaths = sessionPaths(~cellfu...
75a583bc18982f8ed383810131b14f8ece569dff44df6044b3d7e4a44cb879a5
MATLAB
2,409
70
function fnPhysLogArray = tapas_physio_find_matching_scanphyslog_philips(... fnImageArray, pathLogFiles) %returns file name(s) of matching SCANPHYSLOG-file for a given .nii-file %whose exported name is the original Philips name % % fnPhyslogArray = tapas_physio_find_matching_scanphyslog_philips(... % fnImag...
77abf621c3c8475e1e93da3c1e6825a2a6ce7c543584b26bd4353a7adf6ec850
MATLAB
2,409
109
function [posterior, summary] = ... tapas_sem_example_multiv_estimate(model, param) %% Example for inversion with a single prior for the whole population. % % Input % model -- String. Either seria or prosa % param -- String. Parametric distribution. % Output % posterior -- Structure...
2ace2c6bee0298891e8ae60b44acb060ba8f63dc40715afed967f1dbfc078614
MATLAB
2,412
66
% SIZE - size of memory mapped underlying array % % Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 % Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD % % This file is part of EEGLAB, see http://www.eeglab.org % for the documentation and details. % % Redistribution and use in source and binary forms, with or with...
5067bb03140a11fedec13fa920848f996001a7f8a59c4025cf368067f5811cb7
MATLAB
2,412
66
%% RVn1.csv ¿¡¼­ location »Ì¾Æ³»±â % Bridge¿¡¼­ ÃßÃâÇÑ RVn1.csv ÆÄÀÏÀ» Parsing ÇØ¼­ Location data¸¦ ÃßÃâ %% Load Data [filename, pathname] = uigetfile('.csv','À§Ä¡ÆÄÀÏ "*RVn1.csv ÆÄÀÏÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.'); fileID = fopen([pathname,filename],'r'); formatSpec = '%*s%s%f%d%*d%*d%d'; dataArray = textscan(fileID,formatSpec,...
0f6c0691401bc94fbb7d4da9ac6211905ff62a4482811d726c703907a7f08ab0
MATLAB
2,413
77
function tapas_BLT_runPrediction(params,iTrial) % tapas_BLT_runPrediction is showing the prediction screen % Show cue + prediction combo if params.cue(iTrial) == 1 Screen('DrawTexture', params.screen.window, params.text.imgcue1, [], params.screen.fit, 0); elseif params.cue(iTrial) == 2 Screen('DrawTexture', pa...
1e3199a95900c2f1eb255cb24e088312b44fcdc00176076cc0173b07a454ccd4
MATLAB
2,413
81
function equateRmsWav(subjName) % function equateRmsWav(subjName) % Not used during the experiment itself but allows to root mean square the sounds of a given % subject. if nargin < 1 subjName = input('Enter Subjects name: ', 's'); end referenceDir = fullfile(pwd, 'Static'); subject...
717161af286510ef0ca5a787d409e6f51d83858bcb6c1adbf10f7873dbe2e868
MATLAB
2,414
68
function out = DN_Cumulants(y, cumWhatMay) % DN_Cumulants Distributional moments of the input data. % % Very simple function that uses the skewness and kurtosis functions in % Matlab's Statistics Toolbox to calculate these higher order moments of input % time series, y % % ---INPUTS: % % y, the input time series % % c...
adaadcc5a982dd5109ae42002546e385c399303a0c1325942eb91a7e7a4c2f54
MATLAB
2,414
76
% Cargar Datos Chema orden_PFC=[1 3 30 5 28 7 26 2 31 6 17 4 29 9 18 8 27 11 19 10 25 13 20 12 24 15 21 14 23 16 22 22]; %Duplico el último canal para que sean 32 orden_PFC=[1 3 30 5 28 7 26 2 31 6 17 4 29 9 18 8 27 11 19 10 25 13 20 12 24 15 21 14 23 16 22]; orden_HC =[1 32 3 30 5 28 7 26 2 31 6 17 4 29 9 18...
8a50e3f77e19da87b966c38dfe665f7a7d2d60de7f8e74d2c450de3572119575
MATLAB
2,415
56
% VL_NNROIPOOL CNN region of interest pooling. % Y = VL_NNROIPOOL(X, ROIS) pools each feature channel in X in % the specified regions of interest ROIS. ROIS is a 5 x K array % containing K regions. Each region has five coordinates `[t, u0, % v0, u1, v1]` where `u0`, `v0` is the upper-left corner of a ROI, % ...
d257bc89902f9ae3163a374692148b3c5c0d0907ec2261eee990a8f0a8b06266
MATLAB
2,415
73
function propvalSplitArray = tapas_uniqc_split_propval(propvalArray, nSplits) % Splits PropertyName/Value pairs with cell/multi-element inputs into % several varargins to be used separately % % vararginSplit = tapas_uniqc_split_propval(propvalArray, nSplits) % % IN % % OUT % % EXAMPLE % tapas_uniqc_split_propval % ...
0c1365ebf5496052b98db278a992de024f65842a687b28c75ca38fcb19b1100b
MATLAB
2,416
82
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
2a199f8b7fb88354dcd1d1db626a7615e703e079823b00a23713a831555c3d79
MATLAB
2,416
78
function zone = DefineZone(s,shape,points) %DefineZone - Define a restricted zone to which analyses can be circumscribed. % % Define a restricted zone in the environment, to which analyses can subsequently be % circumscribed using <a href="matlab:help IsInZone">IsInZone</a>. Multiple zones can easily be combined (see ...
234989520d66304794eba9c464d577e647c868c9913f78c4784bbf0561cd6fea
MATLAB
2,417
69
function setFigureProperties(varargin) % SETFIGUREPROPERTIES Set consistent properties across figure elements % % Syntax: % setFigureProperties() % setFigureProperties('Name', Value, ...) % % Description: % Apply consistent formatting to all axes, labels, and text in figure. % % Inputs (Name-Value pairs): % 'Fi...
3c8f0ac33e3cb1c7a2bb3d78bb0a30ac4c4002757ddb860b8358f2e9c2909948
MATLAB
2,417
66
% op_eccKlose.m % Jamie Near, McGill University 2014. % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [out,outw]=op_eccKlose(in,inw); % % DESCRIPTION: % Perform a classic Klose eddy current correction (Klose, Magn Reson Med % 14:26-30 (1990). The complex signal vector of the water-suppressed FID is %...
9af794f02f777b85933f3695ff6993bee4c2e031e6ea09626a1a2d7653807d01
MATLAB
2,417
104
function m = sero_srr_data2fit_1d_reg_v2(S, tr, b, w, do_t1, do_v, reg_str, mode, x0, opt, wght, te) % function m = sero_srr_data2fit_1d(S, tr, b, w, do_t1, opt, x0, wght, te) if nargin < 7 || isempty(reg_str) % Define the regularization parameter reg_str=0; end if nargin < 8 || is...
f514279c512006ca4d4a24c7d8757ae2f1424b325e6a6fb299e8a6dceeb6bde8
MATLAB
2,417
87
function cmd=surfing_afni_vol2surf(volpat,specfn,varargin) % Wrapper function to run AFNI SUMA Vol2Surf % % CMD=SURFING_AFNI_VOL2SURF(VPAT,SPECFN,...) % INPUTS: % VPAT Pattern of HEAD volumefiles to project (wildcards allowed) % SPECFN SUMA spec file, or a directory with such a file. In the % la...
0a3d24b88c87e416afeb4e2295464feb5511b32d97aa891bf36fc3182f56cbcf
MATLAB
2,418
53
%function [haloInd] = haloAssign(dist, clustInd, dc, rho, isHalo) function [haloInd] = haloAssign(dist, clustInd,centInd,isHalo) % Reference paper: Herzog et al. 2020 "Scalable and accurate automated method % for neuronal ensemble detection in spiking neural networks" % https://www.biorxiv.org/content/10.1101/2020.10....
69c1a19f2537ec35f23d4040d25a32d0935467a282094ab09255603a00139c48
MATLAB
2,418
89
function [xdata,parm] = normalize_data(xdata,norm_mode,parm) % Normalize data % --- Usage % 1. Normalize data and set mean & norm to 'parm' % [xdata, parm] = normalize_data(xdata) % [xdata, parm] = normalize_data(xdata, norm_mode) % % 2. Normalize data using 'parm' % [xdata] = normalize_data(xdata, norm_m...
a138e55b46bcb6843a9b30f3bc7e085d2c9f72a0d354cf279d28d2ea2413dd0d
MATLAB
2,418
61
function ncopies = checkworkspace(obj); stack = dbstack; stack(1:2) = []; stack = rmfield(stack, 'line'); ncopies = 0; if ~isempty(stack) % empty stack means the base workspace % check if we are in a different workspace if ~isequal(stack, obj.workspace) % is the current stack a subset of the o...
f37e3a6eb1e524529e465d89d498699228d57ad5ba1dcfcbe48196218329b5dc
MATLAB
2,418
72
% UIGETFILE2 - same as uigetfile but remember folder location. % % Usage: >> uigetfile2(...) % % Inputs: Same as uigetfile % % Author: Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 % Thanks to input from Bas Kortmann % % Copyright (C) Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 ...
111dfa3293a81812e98db04c7941884b6bbd2a0e64719bce85ec5429fe038202
MATLAB
2,419
93
function [barhandle, cfg] = plotsigbar(pcorr,cfg) % plot sig bars % nt = length(pcorr); cfgfields = fieldnames(cfg); if ~ismember(cfgfields,'plotcolor') cfg.plotcolor = [0.0 0.0 0.0]; end if ~ismember(cfgfields,'linewidth') cfg.linewidth = 4; end if ~ismember(cfgfields,'pthresh') cfg.pthresh = 0.05; end i...
3924157fafa0e7b31bd5576c15f81026d2f4a4bbeaf0831830050bd7ccbd40d5
MATLAB
2,419
43
function [acceleration,instantaneous_correlation_acceleration,velocity,instantaneous_correlation_speed]=compute_velocity(instantaneous_correlation_tensor) % Computes the instantanaeous acceleration and velocity % The time unit is the sample (each point in the second dimension is a % sample) % The position (r) unit ...
07d150421b769d4ad19997f8a5214b8203059259590422f8d31fd2a99ed16f64
MATLAB
2,420
67
function [cc] = circumcenter(coil1,coil2,coil3) % CIRCUMCENTER determines the position and orientation of the circumcenter % of the three fiducial markers (MEG headposition coils). % % Input: X,y,z-coordinates of the 3 coils [3 X N],[3 X N],[3 X N] where N % is timesamples/trials. % % Output: X,y,z-coordinates of ...
3ad67f8570bc79207aee2157bc61df9480e108b971efb983de83b2b8b0c44147
MATLAB
2,420
79
function [file_info,summary]=h5addmeta(h5path,meta_structure,varargin) % % HELP % Saving metadata to the file from a structure. Creating datasets whose names correspond to the structure fieldnames. % SYNTAX %[file_info,summary]= h5addmeta() - use 1 if no arguments are allowed %[file_info,summary]= h5addmeta(h5path) - u...
025c0e880f4fde26fe03df047dab1af556d1086d063e08b5b7ddc291789b2f8d
MATLAB
2,421
38
function cifti_write_from_template(ciftitemplate, data, filename, varargin) %function cifti_write_from_template(ciftitemplate, newdata, filename, ...) % Use a template cifti struct with a dense or parcels diminfo and a new data % matrix to write a new cifti file. The file extension is used to figure ou...
369a5e0471e8eda37e3e8969f4cc80045a6d9e5773e00dd60c4f11a988a5c508
MATLAB
2,424
86
function [ output_args ] = CALCIUM_FLUORESCENCE_CONVERSION( output_directory , id , dF_F_field , dT_duration , calcium_T1_2 ) %CALCIUM_FLUORESCENCE_CONVERSION( output_directory , id , dF_F_field , dT_duration , calcium_T1_2 ) % Usage: CALCIUM_FLUORESCENCE_CONVERSION( '~/' , 'TEST_1' , dF_F , 0.5 , 1 ) if( exist( outpu...
fc729a647af1f84b866ede252f1f6a36f2bcd117e7f8dec8aefb7f0a3612f73a
MATLAB
2,424
79
function evaluate_ref_models() % Evaluate MatConvNet reference models to validate them addpath(fullfile(fileparts(mfilename('fullpath')), '..','examples', 'imagenet')) ; models = {... 'resnet-50-dag', 2015, ... 'resnet-101-dag', 2015, ... 'resnet-152-dag', 2015, ... 'matconvnet-alex', 2012, ... 'matconvnet-...
033ff7b3f1386292c6fd3b41a0d2cfd6a9c37faebdc994a97d62535c80c07062
MATLAB
2,425
66
% fit_OspreyMM.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [fitParams] = fit_Osprey(dataToFit, resBasisSet, fitOpts); % % DESCRIPTION: % This is the function describing the Osprey fitting model, which is % performed with the resampled basis set resBasisSet on the data contained % in the FID-A da...
f3d5826a33c6846641185f297bf81b92e35eebd3738b03e9d764349d25419a1e
MATLAB
2,425
64
function phiFaceAverage = harmonicMean(phi) % This function gets the value of the field variable phi defined % over the MeshStructure and calculates the harmonic average on % the cell faces, for a uniform mesh. % % SYNOPSIS: % phiFaceAverage = harmonicMean(phi) % % PARAMETERS: % % % RETURNS: % % % EXAMPLE: % % SEE AL...
c597056a554957e0d9ec394eccd79b821e71116156d2c79cd53177b5ffbbc241
MATLAB
2,426
42
function AFI_GroupAverageCorrectedMaps(AvgIndCorrMyelinFile, AvgIndCorrMyelinAsymmOutFile, IndCorrMyelinAllFile, GoodVoltagesFile, rAFIFile, AFIStatsFile, CSFStatsFile, RegressedMyelinOutFile, CovariatesOutFile) AvgICorrMyelinMap = cifti_read(AvgIndCorrMyelinFile); surfasymmnorm(AvgICorrMyelinMap, AvgIndCorrMye...
cde62eab814b8d1eff361bcb64148fd5bc99247c7430d009c158b7a6b08e1bbb
MATLAB
2,427
82
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
6eaa74c8abba5b02f85480269780c93ed2c9acb99f4a21638322107a0f5e698d
MATLAB
2,429
48
function thisAA = ch2roi_assignAA(brainAtlas_name, chAss_isargAtlas, groupInfo, list_AA) % returns thisAA (string) of assigned anatomical area (AA aka ROI) % thisAA = a row in the first column of 'list_AA' or 'n.a.' (if not assigned) % based on 'brainAtlas_name' (case insensitive!), selects the corresponding field in ...
f6b57bf98b6a27c94b53bce086c2abc65d746862322123ba1f35566ea90d560f
MATLAB
2,429
73
function gradfd = getGradientFD(problem, x, storedb, key) % Computes an approx. of the gradient w/ finite differences of the cost. % % function gradfd = getGradientFD(problem, x) % function gradfd = getGradientFD(problem, x, storedb) % function gradfd = getGradientFD(problem, x, storedb, key) % % Returns a finite diffe...
00575094a6c200b41adfd354f2493fb3debe31305787efd8929c3b1f12ad0180
MATLAB
2,431
83
%------------------------------------------------------------------------------- % mi_cont_cont: mutual information using the first method in [1] % % Syntax: mi = mi_cont_cont(x, y, k) % % Inputs: % x - input vector (length-N) % y - input vector (length-N) % k - number of nearest neighbours (default 3) % %...
0d7a00e7d9b000275d11e07e3327ff4422596d98b0e6773387c1902d11fc66a9
MATLAB
2,431
59
function [isSpmOnPath, pathSpm] = tapas_physio_check_spm(doCorrectPath) % Checks whether SPM exists in path, using also its check_installation for % correct subfolder addpath % % [isSpmOnPath, pathSpm] = tapas_physio_check_spm(); % % IN % doCorrectPath if true, erroneous subfolders from SPM will be removed % ...
8b77da0ab116b09fa8b705ce2cd9013eee488200f44a858b72c08bb2421715eb
MATLAB
2,431
78
function plotVE(output, inverty) % Plot the variance explained as violins and scatter plots % Params prox_cmap = repmat([215, 15, 175]/255, 7,1); dist_cmap = repmat([255, 160, 25]/255, 17,1); cmap = [prox_cmap; dist_cmap]; axvals = {[1,2,3], [5], [7,8,9], [12,13,14,15], [17,18,19,20], [22,23], [25,26,27], [29,30...
cc8e8a9faaf84a7c08a9b439789e33441bff9a75de9b82e665e14a9c2fd142b9
MATLAB
2,432
76
function [MRSCont] = osp_orderProcessFields(MRSCont) %% [MRSCont] = osp_orderProcessFields(MRSCont) % This function orders the processed struct fields to match the GUI order % % USAGE: % MRSCont = OspreyProcess(MRSCont); % % INPUTS: % MRSCont = Osprey MRS data container. % % OUTPUTS: % MRS...
152b4a361de91fef9f7231be70db1d1a438088ae830b01834872b0b2da108ce3
MATLAB
2,433
78
function OUT = meta_analysis_table(XYZlist,r,varargin) % OUT = meta_analysis_table(XYZlist,r,[master file name]) % takes a list of XYZ mm points, and, for each point you specify, makes a table of % other studies in the meta-analysis files that report peaks within r mm (radius) of % the point. % Looks for a file on the ...