sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
02762789b685c9245c0a4a9a6a50d25a156cdf1b616394393fcfb0ef17386846
MATLAB
3,202
115
function ea_fsl_apply_normalization(varargin) % Wrapper for FSL applywarp used for reapplying normalization (non-linear % registration) options = varargin{1}; useinverse = 0; if nargin > 1 % manual application input = varargin{2}; output = varargin{3}; useinverse = varargin{4}; end if nargin >= 5 re...
8f3cf6c4b1683f0c5fd784bda4684c4b1d98103651b7f24083c1916d454ee786
MATLAB
3,202
74
%% % get max of flight intensity values for each mic in each experiment for each fly % normalize flight intensity values to the range % calculate changes in flight intensity % threshold changes in flight intensity to grab 'accel' and 'decel' timestamps % grab 6 seconds of neural activity data around accel/decel po...
760d237c3ecba7a1659bd1f3837a3893df3f9dee227309008e525acdc2897346
MATLAB
3,203
79
%% PaCER/EXAMPLE_1_2.m - Example file for using PaCER - Precise and Convenient Electrode Reconstruction % to reconstruct precise curved electrode trajectories % and contact locations from post operative CT imaging % of DBS electrodes % % Andreas Husch % ...
c692a987a21b33aed855b327428571c2092803212e58184ec033908ebe56ec68
MATLAB
3,203
79
%% oor - optimal opliptimal oblique sampling along a given polynonimal % % Returns: improvedSkeleton - skeleton gained along the polynomial by % resampling and intensity weithed centroid calculation % medIntensity - median intensity profile along the polynoial % % Andreas Husch ...
7917c66a63ccde9e95b05d6aba20c35d8a6986318ec8753068c3aabec92d862c
MATLAB
3,204
94
function table = palm_strcsvread(varargin) % Read a CSV file containing non-numeric fields (strings) and % return a cell array. Numbers are converted to double and, if contiguous, % can be easily converted to arrays with cell2mat. The remaining % are left as strings. % % Usage: % table = palm_strcsvread(filename,delimi...
9127c7d8b4348951d4c07c3ea4753d068a9631d38feb2dee82b19b46b76ecd05
MATLAB
3,205
102
%%******************************************************************* %% schurmat_qblk: compute schur matrix corresponding to SOCP blocks. %% %% HKM direction: output = schur + Ax*Ae' + Ae*Ax' - Ad*Ad' %% NT direction: output = schur + Ae*Ae' - Ad*Ad' %% %% where schur = A*D*A', and Ad is the modification to ADA' %% s...
2933f89dc913332ada04134fe0679924f79b539a7ec19f817d872cece10959b8
MATLAB
3,208
104
function x = eyeK(K) % eyeK Identity w.r.t. symmetric cone. % % x = eyeK(K) produces the identity solution w.r.t. the symmetric cone, % that is described by the structure K. This is the vector for which % eigK(x) is the all-1 vector. % % See also eigK. % Complete rewrite for SeDuMi 1.3 by Michael C. Grant...
2a0cead925c2e19234d136158d44769864fff2609a1fd399e6c19c1833dd8148
MATLAB
3,208
77
function []=v2structDemo2() % V2STRUCTDEMO2 is a usage example demo function for the function V2STRUCT. This demo % shows a suggestion for how to use v2struct in managing input to other functions with % improved usability. % %% Last update: % 30.06.2011, Adi N. fprintf(['Running usage demo function for v...
59212443ccf4f18c5ffc99631ab62be21dcec973c39c4678ed1621d905a4275d
MATLAB
3,208
92
signatures_to_plot = {'NPS' 'NPSpos' 'NPSneg'}; % NPS, VPS, SIIPS, etc., etc. myscaling = 'raw'; % 'raw' or 'scaled' mymetric = 'dotproduct'; % 'dotproduct' or 'cosine_sim' % Controlling for group admin order covariate (mean-centered by default) group = []; if isfield(DAT, 'BETWEENPERSON') && isfiel...
aae123442e8e3f788b001053f3986c96a83f2c4e89168c8db85d3ffb221d4b01
MATLAB
3,216
63
% this script takes anatomical files specified in DAT structure and warps % them to MNI space (using IXI template from CAT toolbox and SPM's % segmentation routine). This script assumes functional and anatomical data % are coregistered. anat_path=fullfile(datadir, DAT.structural_folder, DAT.structural_wildcard); ana...
3d15d1a6e02a6571768d4102ffc44da7ab5a5faa5de7107b450cfe58901ba43d
MATLAB
3,218
104
function out=validate_aes(aes) %Generate useable aes structures: empty fields are replaced with arrays of %ones of the correct size. The size of the other fields are checked for %consistency. Handle special case of size parameter that can be set by the %user %Old matlab test for iscategorical absent from pre 2013b per...
b9f09a35d2cd33585badc92ecad3010e0741022d9eed094764c9ecd1e5ff572b
MATLAB
3,218
72
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
d11ad94a95b6aa4fa125d0673f29f7ffcc7364cff65d2a33ee629e553fb39e53
MATLAB
3,218
97
clc clear % ------------------------------------------------------------------------- % Script description: % This script compares neural activity values at different time point % combinations against a baseline time point, and calculates the number of % neurons whose activity exceeds baseline for each combination. ...
2c6444fd8144fe3990c6c45f97529f0ebb3c0e3b3a6bd18d2c36a7ba41dca910
MATLAB
3,219
106
%firws() - Designs windowed sinc type I linear phase FIR filter % % Usage: % >> b = firws(m, f); % >> b = firws(m, f, w); % >> b = firws(m, f, t); % >> b = firws(m, f, t, w); % % Inputs: % m - filter order (mandatory even) % f - vector or scalar of cutoff frequency/ies (-6 dB; % pi rad / sample) % % O...
8abbe028f762c00b3a6367e0f44731f7ee1c7195404ecd8393c92f29599c18eb
MATLAB
3,219
97
function P = chi2Tests(X, method) % Chi-square tests of homogeneity and independence % Computes the P-value for IxJ-table row/col independence. % Program by Steinar Thorvaldsen, steinar.thorvaldsen@uit.no, Dec. 2004. % Ref.: DeltaProt toolbox at http://services.cbu.uib.no/software/deltaprot/ % Last change...
7ce233cad42bdb8216de2435c4d488ad932e9e3cbdd446953a0f3be6be686910
MATLAB
3,220
68
% Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md % convert vbm and behavior to doc CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); proj_dir = [CBIG_CODE_DIR '/stable_projects/disorder_subtypes/Sun2019_ADJointFactors']; addpath([proj_dir '/step2_MMLDA']) addpath(...
82c871be1774a055812166541eea3d81f1fa73bf51ea8b632393a27631c29e77
MATLAB
3,222
92
function ea_cvshowvatfmri(resultfig,pX,directory,filesare,handles,pV,selectedparc,mod,options) %mV=pV; % duplicate labeling handle %mX=pX; % duplicate labeling data stims=get(handles.vatseed,'String'); stim=stims{get(handles.vatseed,'Value')}; % check out which vats to use [usevat,dimensionality,currentseed,sides]=ea_...
b18f8c8b285cbbca04f05a8b3c7c95edea2fa19c30727e7a258ef92b612f677b
MATLAB
3,222
102
function run_pRF_V7(SubID) % pRF analysis script using SPM12 and SamSrf V7.13 % Adjusted for Ubuntu server setup (15/06/2025) % Created : "2015-03-16 14:42:38 TDekker" test = false; if test disp('Just a test, no calculations done...'); return; end %% Set defaults nRuns = '3'; WhichFolder = 'retinotopy'; Sc...
c0a870ae5a21b23729e4c672523f82c260f5b63d7f7ac24fd6c5efdcfd58b933
MATLAB
3,222
88
% correctfit() - correct fit using observed p-values. Use this function % if for some reason, the distribution of p values is % not uniform between 0 and 1 % % Usage: % >> [p phat pci zerofreq] = correctfit(pval, 'key', 'val'); % % Inputs: % pval - input p value % % Optional inputs...
bcf4b9a901df6e4421aee4bdcc764b985245f3694dda02536255a7792d974036
MATLAB
3,225
102
function [res, typeNameStr, errStr]= dtdstruct_istype(dtdStruct) %function [res, typeNameStr, errStr]dtdstruct_istype(arg) % % function determines if arg is a valid dtdStruct. If this is the case, % also the type name is returned as the second return value. % % arg: arbitary data .. may be a dtdStruct ...
eafb6ee3286389068161314131ca2aa0a98fe499d5916ad627e74f0f09bca571
MATLAB
3,229
97
function varargout = mat2xml(matfile, xmlfile) %MAT2XML Convert a MAT-file into an XML file % MAT2XML(MATFILE, XMLFILE) loads MAT-file MATFILE and converts it % into an XML file saved in XMLFILE. % T = MAT2XML(MATFILE) also converts the MAT-file MATFILE to XML % but returns it instead as an XMLTree object T. ...
2c5662d72a126549e46b58eb29efa5209e5ef74e4b28ef5784bedd8638c0edab
MATLAB
3,230
85
function ClusNum = VLSM_clusterPermutation(voxdir) A = load([voxdir,filesep,'ForPerm.mat']); permnum = 1000; Dind = full(A.Dind); GROUP1 = A.GROUP1; GROUP2 = A.GROUP2; COVterm = A.COVterm; VALt = A.VALt; indexs = A.indexs; V = A.V; tic for iperm = 1:permnum ord = round(rand(1,size(Dind,2))*size(Dind,2)); or...
94a795cab2c959fe4511f80e20753d22787a2435fce467cad02e7af7a31b754c
MATLAB
3,231
74
function correctManifestFile(manifest_file, attributes_file) % Some manifest files, created by syntalos (especially the ones that were % created between 2021-05-18 and 2021-06-15), have false timestamp indices (data_aux.parts). % This function serves as to correct these errors. manifest_struct = read(manifest_file); ...
5027bb52857f2fa1e8b084d417b7b6a5897887b11b430b02d837d018f2db8602
MATLAB
3,234
74
function [redo, options]=ea_prepare_dti(options) % general DTI preprocessing goes here redo = 0; % Initialize return value directory=[options.root,options.patientname,filesep]; % BIDS: If DWI files don't exist, copy from rawdata with BIDS-compliant names if ~exist([directory, options.prefs.dti], 'file') options ...
dd4ead13afbdc3f3d1502c31e4ed0d17be15197f2591bee4ec90225c877b05ad
MATLAB
3,237
69
function spindleSummary = spindlesum(spindles, srate, samples) % Summarize sleep spindle features. Calculates spindle density % (spindles/min) and gets average value of spindle features on each channel % % Required inputs: % % spindles: A structure containing spindle data (output of % fun_sleep_spindles) % % srate: The...
57ff8b9650ad4e9c6e62014da981f09ad551937bc7cb0a6230ec479d158e76e2
MATLAB
3,238
155
% Example 6.4: Regressor selection problem % Section 6.3.1, Figure 6.7 % Original by Lieven Vandenberghe % Adapted for CVX Argyris Zymnis - 10/2005 % % Solves % minimize ||A*x-b||_2 % subject to card(x) <= k % % where card(x) denotes the number of nonzero elements in x, % by first solving (for some valu...
cbe9e6fe9bdddf034a19a5963ce5cf65941e3bba01d308f1fb67204869e54184
MATLAB
3,239
59
function ea_dispbn(varargin) vnum=['v',ea_getvsn('local')]; if nargin>0 if strcmp(varargin{1},'ee') for space=1:100 spstr=repmat(' ',1,space); % display banner.. disp(' Welcome to '); disp(' ...
3b1f6ebfca2c8434d2e5e05de853038f00ba2c67636516db0fec3ca7ea0d785f
MATLAB
3,242
111
% corrcoef_cell() - compute pairwise correlations using arrays and % cell array inputs. % % Usage: % >> c = corrcoef_cell( data ); % >> c = corrcoef_cell( data ); % % Inputs: % data - [cell array] data consisting of PAIRED arrays to be compared. % The last dimension of e...
3c9d7e4905081c0f96477eec96187eafbb8c92311f4809dbd27065e8863566f5
MATLAB
3,244
59
fprintf(1,'Executing %s at %s:\n',mfilename(),datestr(now)); ver, try, if isempty(which('spm')), throw(MException('SPMCheck:NotFound', 'SPM not in matlab path')); end [name, version] = spm('ver'); fprintf('SPM version: %s Release: %s\n',name, version); fprintf('SPM p...
6680accb7758c23b90933782f2c689bdc4c2edc33aede4c9226cb6b061fab1bd
MATLAB
3,246
149
function [baseline, decline] = CBIG_hypoTest_2t(stats) % [baseline, decline] = CBIG_hypoTest_2t(stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md beta = stats.Bhat; betaCov = stats.CovBhat; baseline = zeros(3, 3); decline = zeros(3, 3); %% --------------...
748b3bd67317717661eb3ee72216f9ad0c4b3d835ce2725929760457b3103c3d
MATLAB
3,251
108
% plotchans3d() - Plots the 3-D configuration from a Polhemus ELP % file. The axes of the Cartesian coordinate system are % plotted. The nose is plotted as a bold red segment. % Usage: % >> plotchans3d( elpfile, zs); % >> plotchans3d( [X,Y,Z], elecnames, zs); % % Inputs:...
10ea266ea955851eeadc626087a2ebcb86c319c7eab3edf644fff0943bef5e9c
MATLAB
3,252
97
function[S,tau,tc] = staogram(data_spk,data_lfp,smp,plt,Tc,Tinc,Tw,w,D) % % staogram : calculates a moving window spike triggered ave % % Usage:[S,tau,tc] = staogram(data_spk,data_lfp,smp,plt,Tc,Tinc,Tw,w,D) % % ******** INPUT ********* % Note that all times have to be consistent....
4bf6d12127fe826baba87b6148dfea65259fefd1e13f2318f98cd6c8c6db59fd
MATLAB
3,252
95
function [cn rt] = core_numbers(A,varargin) % CORE_NUMBERS Compute the core numbers of the vertices in the graph. % % [cn rt] = core_numbers(A) returns the core number (cn) of each vertex. % The core number is the largest integer c such % that vertex v exists in a graph where all vertices have degree >= c. % The vecto...
eb5cd718ecc5aa3fce5ae78d4e8ac5497a303668b5e6f3eab5ae5cf1d8c2b720
MATLAB
3,254
96
function data = AFOFdata_struct7(inputdata, filenames) % USE THIS FOR EXP7 (CEM) % how it works: % fly = AFOFdata_struct7(data,filenames) where data and filenames are % inputdata and filenames from AF_OF_importer() for e = 1:length(inputdata) for t = 1:size(inputdata{e}{1},1) trial.filename = filen...
eb3f602f11525fdf0bfda58185abf7141f519c57c8116fbef5e49e8e51dc39e3
MATLAB
3,256
80
function ClincFreq_CalWeiCent(outdirCent,OutWeiCentdir,SetUpPara,Para,AtlasTempU,dbmask) % [V0,D0,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); % D0(isnan(D0)) = 0; % D0(isinf(D0)) = 0; % D0 = D0>0; % % Dvol = sum(D0)'; % Dvole = sum(D0,2); % IgV = Para.IgP; % indexs = find(Dvole>=(size(D0,2)*IgV/100)); ...
0c0a52d62aa92d976a4b4dac96e09528f3f7371dca6e1d011bd9d2234ecacc1d
MATLAB
3,257
49
%% Get peaks respectivly center points at threshold below the peaks from 1D % intensity profile. Expected peakWaveCenter number == 4 for now (needs update to support electrodes with more ring contacts)! % % Andreas Husch % Centre Hospitalier de Luxembourg, Dep. of Neurosurgery / % University of Luxembourg - Luxembourg ...
87a1ab865125c38f5415ceb45cb08c7b5b996d51fc72264c1526469499d21eba
MATLAB
3,258
149
function [baseline, decline] = CBIG_hypoTest_2t(stats) % [baseline, decline] = CBIG_hypoTest_2t(stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md beta = stats.Bhat; betaCov = stats.CovBhat; baseline = zeros(3, 3); decline = zeros(3, 3); %% --------------...
fbb8ecb89f77282fd6437e34e5e781d9fff3db68e2b516f1a5bccd983a977b46
MATLAB
3,258
102
%% figure S7 % TE tuning selectivity is independent of signal power and SNR. % (A) TE magnitude violin plot: awake vs anesthesia % (B) LMM bar chart: power-controlled SI difference from M5 % (C) LMM bar chart: SNR-controlled SI difference from M5 load('figureS7_data') addpath('functions'); set(0, 'DefaultAxesFontNa...
4e2bcb7018d4c25339fad7298c145747d667fe5f04d09abece0d5b2989a5c88b
MATLAB
3,261
90
% readbdf() - Loads selected Records of an EDF or BDF File (European Data Format % for Biosignals) into MATLAB. This function is outdate % Use the functions sopen() and sread() instead % % This program is deprecated (obsolete). Use the sopen() and sread() % function instead % Version 2.11 %...
f6b82f236faf15074bb207f94c4c77694f0dac97ee5978266607509828194ea0
MATLAB
3,262
95
% Figure 8.15: Linear placement problem % Section 8.7.3, Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 10/24/05 % (a figure is generated) % % Placement problem with 6 free points, 8 fixed points and 27 links. % The coordinates of the free points minimize ...
e83494656942538296abdb375286fb81f5a1f79b5f063de39862ceddcb614c13
MATLAB
3,263
86
function [coords_mm,trajectory,markers] = ea_runtraccore(options) if isfile(options.subj.recon.recon) options.native = 0; % Load MNI reco [coords_mm,trajectory,markers] = ea_load_reconstruction(options); end if isempty(options.sides) return end % build lfile fis={[ea_space,'bb.nii']}; switch options.subj...
314bc40cc43dff511f2f625be88050deb0ffeabd12373ec3e2ea0e009fe9bc49
MATLAB
3,264
80
function p_all = CBIG_MMLDA_association_atrophy_behavior_wrapper(out_dir) % CBIG_MMLDA_association_atrophy_behavior_wrapper(out_dir) % % Wrapper function to use GLM to investigate association between atrophy and behavior % % Input: % - out_dir : output directory % % Output: % - p_all : all pairwise p values %...
92cdcdc27cdf9d5e346262da44e9948227611aa4fb53d249cff4151b88c61d0d
MATLAB
3,265
104
function pairs = MatchPairs(list1,list2,varargin) %MatchPairs - Pair nearest values in two lists. % % USAGE % % pairs = MatchPairs(list1,list2,<options>) % % list1 first list % list2 second list % <options> optional list of property-value pairs (see table below) % % =============...
c2cda154146ca3b65d3b16051a26f7da8119fd00f53b362eb4d4e93e93309096
MATLAB
3,265
98
classdef GeneralWaveform < handle %GENERALWAVEFORM implements a class for the any type of signals. This %class should convert to the discrete or continuous waveform the input %signals. % Detailed explanation goes here properties (SetAccess = 'protected') SamplingFreq (1,1) double = 2e...
0a5aaef05d7a033d58b447e8f43982ef86d6c1ca47e0416a3a7aaddf92900a14
MATLAB
3,266
98
function [z, r, tp] = fsLR2roizmat(gL, gR, roiL, roiR) % DESCRIPTION: % Extract ROI time series from 32k by 32k fsLR and save as correlation % matrix (r), fisher-z-transfromed correlation matrix (z), or % roi-by-timepoint matrix (tp). % ROI needs to formatted where each column represents a separate ROI, % w...
b2d743c2e750ddf42d594d0e07253d997d029ff25230e33cd7335e9ef813fd47
MATLAB
3,267
96
function calllochist(Dendrite_CrossSess, spine_evolve, handles) binvalue = handles.thresh*2; dendID = table2array(Dendrite_CrossSess(:,1)); dendID(dendID==0) = []; dendID(isnan(dendID)) = []; targetID = dendID(1); DendLoc = table2array(Dendrite_CrossSess); SpineLoc = table2array(spi...
f1228c92db64e5a524ec996ce3dd6ceec54828bbcbf7c2363f7be2f3472fd0d7
MATLAB
3,270
94
function [T F]=DelaunayInside3D(V,F,Options) % % [T Fr]=DelaunayInside3D(V,F,Options) % % inputs, % V : Vertex List N x 3, with x,y,z positions % F : Face List M x 3, with vertex indices % options : Struct with options % options.verbose : if true, show information % % outputs, % T : Tetrahed...
3b256d19e210d91c88ebd8563fe54b19338c1cd3f8e3dda914bfdc764b828a0b
MATLAB
3,274
79
function [dx,dy,dz,dy0, err] = sddir(L,Lden,Lsd,pv,... d,v,vfrm,At,DAt,dense, R,K,y,y0,b, pars,pMode) %#ok % [dx,dy,dz,dy0, err] = sddir(L,Lden,Lsd,p,d,v,vfrm,At,DAt,dense, R,K,y,y0,b, pars) % % SDDIR Direction decomposition for Ye-Todd-Mizuno self-dual embedding. % Here, p is the direction p = dx+dz. If p=[], t...
2f8a6e3d1689ad685b3105d03f23d3f2b28ff7356359e196c5604c1b96b1c474
MATLAB
3,275
93
ccc; %% dataP1 = load("..\MAT Data\figure data\Prediction CC.mat"); dataP2 = load("..\MAT Data\figure data\Prediction XX.mat"); dataPE1 = load("..\MAT Data\figure data\PE CC.mat"); dataPE2 = load("..\MAT Data\figure data\PE XX.mat"); %% run("private\plotConfig.m"); colors = {'#84348C', '#4FB352'}; % AC, PFC scal...
fab975067d6c8ded5ab72effb586fc84ee0e76f2005a7d13842ddf02982c917d
MATLAB
3,276
119
function y = psdscale(ud,x,K,transp) % y = psdscale(ud,x,K [,transp]) % % PSDSCALE Computes length lenud (=sum(K.s.^2)) vector y. % !transp (default) then y[k] = vec(Ldk' * Xk * Ldk) % transp == 1 then y[k] = vec(Udk' * Xk * Udk) % Uses pivot ordering ud.perm if available and nonempty. % % ********** INTERNAL F...
166c98b169ba713fbc560552153cc7df108455c6810cc55d725e70d03e11157c
MATLAB
3,277
97
% Example 6.8: Spline fitting % Section 6.5.3, Figure 6.20 % Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 10/03/05 % (a figure is generated) % % Given data u_1,...,u_m and v_1,...,v_m in R, the goal is to fit to the % data piecewise polynomials with maxi...
9ef10508004066b66a5018290a0f467c0b07ae1c91e00db5fdfdca802d03fd58
MATLAB
3,279
108
function [maxsize,clstat,sizes] = palm_clustere(X,y,thr,opts,plm,varargin) % Compute cluster extent statistics, for volume or surface % data (vertexwise or facewise). % % Usage: % [maxsize,clstat,sizes] = palm_clustere(X,y,thr,opts,plm) % % Inputs: % - X : Statistical map. % - y : Modality index (of those store...
c1b2afe7f1f3f9c571304baa22c46926f22816112f23254ef90fc5f3b6682497
MATLAB
3,281
100
function obj=stat_fit(obj,varargin) % stat_fit() Display a custom fit of the data % % Example syntax gramm_object.stat_fit('fun',@(alpha,beta,x)alpha*cos(x-beta),'disp_fit',true) % % This fuction uses the curve fitting toolbox function fit() to % fit a provided anonymous function with arguments % (param1,param2,...para...
23c69234f630f6a36470409d290509b41357d1ca400a6ad06414161f100ddb9c
MATLAB
3,282
80
% The canlab_dataset object is a way of collecting behavioral data % and/or meta-data about fMRI (and other) studies in a standardized format. % It has entries for experiment description, Subject-level % variables, Event-level variables (e.g., for fMRI events or trials in a % behavioral experiment) and other fields fo...
4d28d3e152f7aabd0ab656b73e506b68eae4833f1d411ddc2d5501d48ff8a94d
MATLAB
3,283
95
% written by Yiyuan Han, Essex BCI-NE Lab, 04/03/2020 % Build the binary clssifiers using the CFC as features function [sFeatures,fWeights,perfMat] = binaryClassCFC(class1,class2,blockTagsAC,CFCdata,mode,folderpath,featureNum) %% Extract the data in specific conditions indices = find(char(blockTagsAC(:,2))==class...
acf5202f26e86f6973b6a08b77ce2cabb6d4eca13ae3b8644de21ed1b5b1149b
MATLAB
3,284
78
function ex_ftrstruct_Curves2dx = impexp_cfg_ftrstruct_Curves2dx % 'Export Mori to DX' - MATLABBATCH configuration % This MATLABBATCH configuration file has been generated automatically % by MATLABBATCH using ConfGUI. It describes menu structure, validity % constraints and links to run time code. % Changes to this file...
11ece020ab0fd9b4cc248d8378304dcf1a66d6516e09efb87f2e06cc95bb349e
MATLAB
3,285
115
function [pointset_resources] = populate_point_resource_str(points, colors, n_resources) % % See also VERBATIM. % % File: populate_point_resource_str.m % Author: Ioannis Filippidis, jfilippidis@gmail.com % Date: 2012.06.14 - % Language: MATLAB R2012a % Purpose: point resource strings % Copyrig...
0788e5c63b47271715c3c03ac2a5754333f1eb42949302da73ce253a4b82dc6a
MATLAB
3,287
108
function compile(varargin) %% History % 2008-04-01: Added check for pre Matlab 2006b for non-large dim % sparse matrices. %% debug = 0; if strmatch('-debug',varargin), debug=1; end verbose = 0; if strmatch('-verbose',varargin), verbose=1; end clear mex mbglfiles = {'astar_search_mex.c', 'bfs_mex.c', 'd...
28b9a58d08cfa434a5d05d5c76d30b703c345b91e87c57c811dec13494200b7c
MATLAB
3,287
77
function obj=stat_glm(obj,varargin) % stat_glm Display a generalized linear model fit of the data % % Example syntax (default arguments): gramm_object.stat_glm('distribution','normal','geom','lines','fullrange','false') % This will fit a generalized linear model to the data, display % the fit results with 95% confidenc...
3be11e049b3435a036733c7866bddefc073b62fa28a5ebd8906aaf80636a518b
MATLAB
3,287
102
% icavar() - project ICA component activations through the ICA weight matrices % to reconstitute the observed data using selected ICA components. % Returns time course of variance on scalp for each component. % % Usage: >> [srcvar] = icavar(data,weights,sphere,compnums); % % Inputs: % data ...
7efcc7440f97937f8fa2964e0fc05235c0295d27df7bf01785d3cee7ed152549
MATLAB
3,291
85
% Name: Robert Kim % Date: 03-18-2024 % Email: robert.f.kim@gmail.com % plot_timeconstant.m % Description: Script to plot the synaptic decay time constants of inhibitory vs excitatory units across trained RNN models. The script can be used for both one-modality and two-modality models by changing the model_dir variable...
58b804ad4e56653e5882d61d89bf7431d0cb7a4687763eeae959c352b4cbcfab
MATLAB
3,292
131
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...
ac41e41664777d8a4c7489d9914cffe6402a2222c31942e67749e1a332d01cc3
MATLAB
3,292
101
function [fid, sens, label] = read_polhemus_fil(Fname_pol,skip) % Reads Polhemus files: % either sensor file or headshape file or both % % FORMAT [fid, sens, label] = read_polhemus_fil(Fname_pol,skip) % Input: % Fname_pol - Polhemus ASCII file containing sensor locations (cm) % (headshape can also be con...
226a0133d53b76829c837b7df5ab05b9f9cb4ebbed256fae0233dee0432a9fa0
MATLAB
3,294
79
function [dims, isndarray, maxlevel, count] = nestbracket2dim(str,brackets,testndarray) % % [dims, isndarray, maxlevel, count] = nestbracket2dim(str,brackets) % % Extracting the dimension vector of a JSON string formatted array % by analyzing the pairs of opening/closing bracket tokenss; this function % only returns v...
94cec96d9d0284f8736043531dc9c1d15ae1bca2b133165a19c2cd07fe38ac84
MATLAB
3,295
96
function X = build_concat_design(Fs, block_T, nBlocks, baseline_sec, block_sec, aux, varargin) %BUILD_CONCAT_DESIGN Design matrix for concatenated epochs via glmproc.make_design. % X = variance.build_concat_design(Fs, block_T, nBlocks, baseline_sec, block_sec, aux, ...) % % Positional inputs: % Fs ...
574e4592f627400acc63f7368ee40f22645673b4e93414558da65060769b4065
MATLAB
3,297
100
function [P, beta] = x2p(X, u, tol) %X2P Identifies appropriate sigma's to get kk NNs up to some tolerance % % [P, beta] = x2p(xx, kk, tol) % % Identifies the required precision (= 1 / variance^2) to obtain a Gaussian % kernel with a certain uncertainty for every datapoint. The desired % uncertainty can be specifie...
23607e37a49adab722f458899ed5df5055ad707de5f225b0756ef4a857b60bf6
MATLAB
3,298
78
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% CPC METACOGNITION TUTORIAL 2019: PLOT TYPE2ROC %%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function to plot type2 ROC curve from observed ± estimated data fit %%%%%%%%%%%%%%%%%%%%...
bd92c5d574375731d95cb8b8f6676e0d1d0d1ce7fc4416313e015efc63243682
MATLAB
3,298
89
function separatePausedNSx(varargin) % separatePausedNsx Saves paused data segments from a single NSx file % as individual NSx files % % separatePausedNSx(FILENAME) where FILENAME has N paused segments % will create N individual files with the same extension named % FILENAME-1,...
d3debdd4bf84cce47c553bfad1f79184d6a5cf91bb1634262e229ec102494b5b
MATLAB
3,299
104
%% figure S8 % TE tuning selectivity is robust to the choice of time lag (tau). % (A) Overall TE tuning curves for tau = 5, 10, 15, 20 ms (awake & anesthesia) % (B) Selectivity index vs tau for each motif load('figureS8_data') addpath('functions'); set(0, 'DefaultAxesFontName', 'Arial'); set(0, 'DefaultTextFontName...
d81a4bb907037a42999acb83c20d8ad25b2678b8cb09df72d8ccae45b06d3746
MATLAB
3,299
106
%%***************************************************************************** %% HSDsqlpmisc: %% produce infeasibility certificates if appropriate %% %% Input: X,y,Z are the original variables, not the HSD variables. %% %% SDPT3: version 3.1 %% Copyright (c) 1997 by %% K.C. Toh, M.J. Todd, R.H. Tutuncu %% Last Modifi...
e6580472a12afceb625f66fcea468882a9065788db341085399275c6c8dd549e
MATLAB
3,301
100
% REPR TOML representation of a MATLAB object % % REPR(obj) returns the TOML representation of `obj`. function str = repr_syntalos(obj, parent, grandparent) if ispc newline = sprintf('\r\n'); else newline = sprintf('\n'); end switch class(obj) % strings case 'char' % A Syntalos error o...
a425a5d1d452beac6cda651aa21ba630f1763b2f5da24e99cf19bdedc4cd6e16
MATLAB
3,303
98
%% Publishing reports %% Why? % % Publishing reports of your data analysis is a great way to save code and % results. % % If you're doing a paper, you can save a record of what you did in the % report, and what the results were. % % You can save figures in your report, and stats and tables too ... % And even interpret...
27264733cf07f7d76b03b0d892e14a4c2c92cdc3e2faccbc9dbabf9c5abf99d4
MATLAB
3,305
76
function [sv,sp,fm] = spsvd(data,params,mdkp) % Space frequency SVD of input data - continuous processes % Usage: [sv,sp,fm] = spsvd(data,params,mdkp) % Inputs: % data (data matrix in timexchannels form)-required % params structure containing parameters - params has the % following fields: tapers...
2570e582d04ddff542ca0cebdcd8f787b10c9ce1a76b77c48cec04f37bf9b147
MATLAB
3,306
115
% CLIP_NII: Clip the NIfTI volume from any of the 6 sides % % Usage: nii = clip_nii(nii, [option]) % % Inputs: % % nii - NIfTI volume. % % option - struct instructing how many voxel to be cut from which side. % % option.cut_from_L = ( number of voxel ) % option.cut_from_R = ( number of voxel ) % option.cut_from_P ...
a662bde9844c3b5bd47edca16c8c6816d551374a5282b450ec042a6d8278664a
MATLAB
3,307
90
function proc = process_NSC_frac_data(data, k, alpha) % Process NSC counts and fraction data % Automatically scales, filters, computes mean/std using filterLognormalGaussian, % and stores both raw and filtered full-time vectors for plotting. % ---------- NSC TOTAL ---------- nsc_times = []; % mean per...
3e626d7386c9d5ae1853a5eb01676cb2db39e9c4ab19b620dbd09e893c7c60a0
MATLAB
3,308
89
function dpvl = palm_vtxlabel(dpv,fac) % Label a DPV file (vertexwise data). % % Usage: % dpvl = palm_vtxlabel(dpv,fac) % % - dpv : Binary data per vertex to be labelled. The non-zero % regions receive an unique identifier. % - fac : Face indices (see palm_srfread for details). % - dpvl : Labelled data per...
fe0d1f1c5fef42d6e0f0e8e46912761fdee31e0a23d867ceafdbe028ca60ebb0
MATLAB
3,310
96
% Figure 8.16: Quadratic placement problem % Section 8.7.3, Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 10/24/05 % (a figure is generated) % % Placement problem with 6 free points, 8 fixed points and 27 links. % The coordinates of the free points minimi...
4ecfa945eaff124aaa3763c1fff0b87a2bb99466ac9aa641cc95ef5aebf3c45f
MATLAB
3,311
94
function ea_newseg(files,dartel,del,force) % SPM NewSegment % we cannot generate the TPM from the SPM TPM anymore since % we use the enhanced TPM by Lorio / Draganski: % http://unil.ch/lren/home/menuinst/data--utilities.html % keep the 'y_*' and 'iy_*' file by default if ~exist('del', 'var') del = 0; end if ~exist...
2c1d3fa56e38b69ff389110ddc4c7f31b736310e3031860fb338af05e525db8e
MATLAB
3,312
108
function [sel1, sel2] = LeG_match_str(a, b, fullout) % MATCH_STR looks for matching labels in two lists of strings % and returns the indices into both the 1st and 2nd list of the matches. % They will be ordered according to the first input argument. % % Use as % [sel1, sel2] = match_str(strlist1, strlist2) % % The s...
5712f2c5ec8e9bae9ad2c31679243f048cd5bd9298be5dd215f906f16a452146
MATLAB
3,312
75
function [RegPara, ds_val_threshold] = Call_initialReg(RegPara, handles, k, fext, imageinfo, Nbatch) RegPara.Corr_initial = 0; if RegPara.NimgFirstRegistration >= 20 ini_iter = 1; Corr_initial = 0; t0 = ceil(RegPara.Imagelength(1)*0.1); while Corr_initial < RegPara.MinCorr_initial && ini_iter <= RegPara.in...
0116b4c7bb4ecfed680ae0428f79a6496d9072a4a179a835c4d36a6e1a311205
MATLAB
3,313
110
function [maxsize,clstat,sizes] = palm_clustert(X,y,thr,opts,plm,varargin) % Compute cluster Tippett statistics, for volume or surface % data (vertexwise or facewise). % % Usage: % [maxsize,clstat,sizes] = palm_clustert(X,y,thr,opts,plm) % % Inputs: % - X : Statistical map. % - y : Modality index (of those stor...
76edb66a6e07088a46f0b6571ea9c6d65a5d5c66f19fe10d550017e0b4c27a6b
MATLAB
3,315
98
function [Sc,Cmat,Ctot,Cvec,Cent,f]=CrossSpecMat(data,win,params) % % % Multi-taper cross-spectral matrix - another routine, this one allows for multiple trials and channels % but does not do confidence intervals. Also this routine always averages over trials - continuous process % % Usage: % % [Sc,Cmat,Ctot,Cvec,Cent...
259d4c695ce84994fee38c45d8f4481e0ed8cd39fd6b29b6c96646161b1a5e43
MATLAB
3,317
80
function Obj = SOFAconvertBTDEI2SOFA(BTDEI) % OBJ=SOFAconvertBTDEI2SOFA(BTDEI) converts the HRTFs described in BT-DEI % to a SOFA object. % % BTDEI format is used by Michele Geronazzo, University of Padova. % % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences; % Licensed und...
e3d5b9514c10eb1e773722f4ae0a14042a125faa5e57283d5666723d8bb3ca24
MATLAB
3,317
84
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
ff2e61a950d519da44c93773cb84d71ce29cfe098f4afea3c641b780f21c33b1
MATLAB
3,318
90
%Produces high pass filtered versions of background subtracted LFP data to %use in single unit analysis. %Specifically needed to find waveforms that correspond to spike times %identified by kilosort/phy. %Doing this ahead of time makes single unit analysis code run much faster %and saving this data removes the...
006460bcb4e6f3ae642d165a31c5230d1fd16c73de008f4a26c9566fdbc1e785
MATLAB
3,319
103
function plotEBC(root,out,fign, fig_row) % % Downloaded from the Github of Hasselmo's lab % Modified by Yanbo Lian for the purpose of displaying figures % %% occupancy circular % figure(fign); subplot(1,4,1); % % the +pi/2 brings "forwards" to "up" % [t2, r2] = meshgrid(wrapTo2Pi(out.params.thetaBins+p...
6909ff10c55e5e1f94278fcd467f89eedfdafc849d741effab8065c9c533fad8
MATLAB
3,319
94
% Figure 8.17: Fourth-order placement problem % Section 8.7.3, Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 10/24/05 % (a figure is generated) % % Placement problem with 6 free points, 8 fixed points and 27 links. % The coordinates of the free points min...
e34d7600704e7c94e886ac54318b24c046339fae754b342f2b8f8908176ea922
MATLAB
3,320
77
function ea_predict_leave_nothing_out(uipatdirs,stimname,typemap,regressor,fdmri,dowhat) if size(regressor,1)<size(regressor,2) regressor=regressor'; end if ~exist('fdmri','var') fdmri.do='both'; % can be fmri, dmri or both end for pat=1:length(uipatdirs) [~, subPrefix] = fileparts([uipatdir{pt}, '_']); ...
6d2d6d2ca6a5ec0e4ec7da2d858f5afefda79e0df591358d4b5d6718b8bafe15
MATLAB
3,324
59
function unitClassif = classifyCells(ephysProperties, paramEP, region) % classify striatal, GPe and cortical cells unitClassif = cell(size(ephysProperties,1),1); if ismember(region, {'CP', 'STR', 'Striatum', 'DMS', 'DLS', 'PS'}) %striatum, classification as in Peters et al., Nature, 2021 unitClassif(ephysProperti...
478956a4c1a54b089fac0d70d11ec14e7a7ceb9525e0414a3eaf0c0e5d307dc7
MATLAB
3,326
80
% configure file for calculation of tensors % DTI Configuration file % BATCH system (Volkmar Glauche) % % File created by Susanne Schnell function tensor = dti_cfg_tensor % --------------------------------------------------------------------- % filename Input raw data filename % -------------------------------------...
3e9043a82a6bb3981302f349d0364151d6150a0e40682cc4c98e52521110340c
MATLAB
3,329
111
function [maxsize,clstat,sizes] = palm_clusterm(X,y,thr,opts,plm,varargin) % Compute cluster mass statistics, for volume or surface % data (vertexwise or facewise). % % Usage: % [maxmass,clstat,masses] = palm_clusterm(X,y,thr,opts,plm) % % Inputs: % - X : Statistical map. % - y : Modality index (of those stored...
5062c339112fb438cd8c787943e19da373799dfed1b1ca090b8a2a3192f148d4
MATLAB
3,329
103
%% Red-Black Ordering with MatlabBGL % In this example, we will use the MatlabBGL library to compute the % red-black ordering of a matrix. For certain matrices, the red-black % ordering does not exist, but if a red-black ordering exists, then this % algorithm will find it. % % A matrix has a red-black ordering if t...
20a13f88f9fd77a18999f33b58bc46bcc7219e6290a3336e9da0fa302e84261e
MATLAB
3,330
99
% axcopy() - Copy a Matlab figure axis and its graphic objects to a new pop-up window % using the left mouse button. % % Usage: >> axcopy % >> axcopy(fig) % >> axcopy('noticks') % >> axcopy(fig, command) % % Notes: % 1) Clicking the left mouse button on a Matlab figure axis copies...
ec9ef00c267f143875eeb375a69f185f33333c4a28c45084866035a29f094a2e
MATLAB
3,330
115
% plotAverageWaveforms % % Plots average waveforms for all channels and specified units across the % array. It will prompt for a CMP file to map each channel to its electrode % representation. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Use plotAverageWaveforms(NEV, units) %...
9cc5296133ac8257193309a64db208fd97217c1192f2f6a706754a9d7d02d755
MATLAB
3,331
90
% sph2spm() - compute homogenous transformation matrix from % BESA spherical coordinates to SPM 3-D coordinate % % Usage: % >> trans = sph2spm; % % Outputs: % trans - homogenous transformation matrix % % Note: head radius for spherical model is assumed to be 85 mm. % % Author: Robert Oostenveld, SMI/FC...
905a0c7057ec90112fca7acd024e3bc05dc095c114e79980e66e0d12c2421d65
MATLAB
3,333
123
function cvx_optpnt = lorentz( sx, dim, iscplx ) %LORENTZ Real second-order cone. % LORENTZ(N), where N is a positive integer, creates a column % variable of length N and a scalar variable, and constrains them % to lie in a second-order cone. That is, given the declaration % variables x(n) y % the cons...
bdfd018e3ee3e1577e92e3b6b198fd7a640af73143bbf2730c2bc1fe4c0527cb
MATLAB
3,339
94
% sph2topo() - Convert from a 3-column headplot file in spherical coordinates % to 3-column topoplot() locs file in polar (not cylindrical) coords. % Used for topoplot() and other 2-D topographic plotting programs. % Assumes a spherical coordinate system in which horizontal angles...
e2b80705fba0a5855c156becbc0e8c79f0b8a9b5f6ec18885a16b02ec12cdcb3
MATLAB
3,339
89
function imData=read_file(path_to_file,sframe,num2read,options,im_info) % Reads uncompressed multipage .tiff, .hdf5, .avi or .raw files % Usage: my_data=read_file('path_to_data_file, start frame, num to read); % INPUTS: % path_to_file: location of file to be read % sframe: first frame to read (optiona...
64c810bb32268cb5974681ae53863a3a9de7b672fa4d4c15452eae2e9d206857
MATLAB
3,340
98
function [TermLabels] = PIDTermLabels(N) %PIDTermLabels creates a list of the term labels to ease interpretation of %the PID output. % [TermLabels] = PIDTermLabels(N) is a cellular array that contains the % term labels for the output of the PID function. It follows the notation % of Williams and Beer. % % P. L....
c8a79e1e597fccf3a4e2d8475969aa94d7998ca3553da72f770e33ba3f29ad8d
MATLAB
3,341
99
function signal = simulate_noisy_model_signal(SANDIinput, model_params) % Builds the dataset for supervised training of the machine learning models % for SANDI fitting. % % Author: % Dr. Marco Palombo % Cardiff University Brain Research Imaging Centre (CUBRIC) % Cardiff University, UK % 4th August 2022 % Email: palomb...