sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
368891bb83d0106244f9bd3c116eafd2e025c32ec99aae0a7fa15f911ba64c7c | MATLAB | 3,931 | 121 | % 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:
%... |
cff0c1ed55cd2328a1880640580e6cf2eb4423a90823473c19039867134d6825 | MATLAB | 3,931 | 143 | function plot_fig6d(datadir)
% Plot side-on DA response on contralateral trials, bottom vs top quartile
% of reaction time distribution. N = 10 rats.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
nbin = 4;
fname = fullfile(datadir, 'data-published/sideOnDAby... |
a671ce408863bb60387807cf711f95733bf2a78b375fa9835ce48b4a8437bb43 | MATLAB | 3,932 | 65 | %% setup
% library things
run('set_library_paths.m');
addpath(SPM_PATH); % per spm docs, do not genpath it
addpath(genpath(CANLABTOOLS_PATH));
%% variables that must be set in targets before the script is called
% THIS SCRIPT IS DESIGNED TO CALCULATE MODEL-BASED FUNCTIONAL CONNECTIVITY FOR A **SINGLE** HELD-OUT SUBJEC... |
e9067d93d241808f5f342b36a49a72cd3fda046c19482d5ec414c0e62be99dc8 | MATLAB | 3,932 | 118 | function [dcrf, err] = tapas_riddersdiffcross(f, x, varargin)
% Calculates the cross-derivative (i.e., d^2f/(dx_1dx_2)) of the function f at point x
% according to Ridders' method:
%
% Ridders, CJF. (1982). Accurate computation of F'(x) and F'(x) F''(x). Advances in Engineering
% Software, 4(2), 75-6.
%
% INPUT:
% ... |
52edf854030e360fac6619b7ebfd2c733bfe64dda4d38f5f176bddcaa4bd7ca0 | MATLAB | 3,934 | 113 | function [nt2, Phi_fb, Lambda_fb, omega_fb, time_dynamics_fb, X_fbdmd, Cv] = fbDMD(X, dt, p, tde, r)
% FBDMD Forward-Backward Dynamic Mode Decomposition with optional
% time-delay embedding.
%
% [nt2, Phi_fb, Lambda_fb, omega_fb, time_dynamics_fb, X_fbdmd, Cv] = ...
% fbDMD(X, dt, p, tde, r)
%
% Compu... |
7d44ebfc671ce2ecb7c0acdb44a0bceac77b29a612814de4a4bdb38f4d241b93 | MATLAB | 3,934 | 117 | function TrainSupervisedClassifier_Callback(hObject, eventdata, handles)
% This function trains a convolutional neural network to classify calls. To
% use this function, prepare call files by giving calls categories.
% Rejected Calls are ignored. This function produces training images from
% 15 to 75 KHz, and with wid... |
141b6a390184bceb3fd7a150965d86314c6f6852e5760c61f7e675a74b76f06b | MATLAB | 3,938 | 81 | function [locs] = support_func_find_nearestPeak(locs,xdata,ydata)
%% ########################################################################
% - [locs] = support_func_find_nearestPeak(locs,xdata,ydata) -
% ######################################################################... |
27d0203373c1484c5eb9720792f8d13a43330db61cd006a1f0c230b31b28d32a | MATLAB | 3,938 | 106 | function [map,timeBins] = SyncMap(synchronized,indices,varargin)
%SyncMap - Create a map from successive event-synchronized data.
%
% Using N repetitions of similar data centered around synchronizing
% events (e.g. N evoked potentials), create a map v = f(t,i) where
% t is the time relative to the synchronizing events... |
3e8f379894d6f9960408240adc187195ad1c86df066bb3e24a4fd0dba91831f0 | MATLAB | 3,939 | 167 | function mov = getOptoImageData(params, fn, m)
analysisDir = getAnalysisDir(params);
%Get imaging stuff
imfn = cell(numel(fn.si), 1);
iminfo = cell(numel(fn.si), 1);
filenum = cell(numel(fn.si), 1);
framenum = cell(numel(fn.si), 1);
for i = 1:numel(fn.si)
imfn{i} = fullfile(fn.pth, fn.si{i});
imi... |
3997ea8906ea9f85d882b434f2ee3ab7440b7d6d3b8c5cfd92a004cceafd4a6c | MATLAB | 3,940 | 101 | function R = RVT_from_PeakFinder(R, Opt)
if (~isfield(Opt,'Demo') | isempty(Opt.Demo)),
Opt.Demo = 0;
end
if (Opt.Demo),
Opt.Quiet = 0;
else
pause off
end
for (icol=1:1:length(R)),
%calculate RVT
if (length(R(icol).ptrace) ~= length(R(icol).ntrace)),
dd = abs(le... |
7c3c7eb3cf1e8ce04b938235a0105ec70e47e19084f5a283de51b4e1f5b49599 | MATLAB | 3,941 | 91 | function ops = make_ops(ETable)
% make ops struct to store info about raw data
% INPUTS: shared ephys table with info for each session, only containing
% the session of interest
% OUTPUTS: ops struct with information about # of channels, sampling rate,
% index of channels used for syncing, opto LED times etc.
% dh: De... |
2878ede2df13395724fe695e4988f5ea1bd49da892d4601fe127197643c1f40e | MATLAB | 3,942 | 127 | %{
Run this file to compile the mex files if you need to
(or if the binaries work for your computer, then you can skip this)
This file also contains two simple test problems
Stephen Becker, Feb 14, 2012 srbecker@alumni.caltech.edu
Updated May 3, 2012 adding the f2c version for Windows userss
Updated ... |
3fa9376efb93e017609b1e3f7fe5c803a3c1e5e30c1f3242e0f4ff422c8176d6 | MATLAB | 3,943 | 100 | % dipfit_erpeeg - fit data dipoles using DIPFIT
%
% Usage:
% >> [ dipole model EEG] = dipfit_erpeeg(data, chanlocs, 'key', 'val', ...);
%
% Inputs:
% data - input data [channel x point]. One dipole per point is
% returned.
% chanlocs - channel location structure (returned by readlocs()).
%... |
6f270271df2a024974a0f460493e8ad088556538d8d73ed81ca42a4e5500a677 | MATLAB | 3,944 | 134 | function [ output ] = tapas_rdcm_compute_signals(DCM, output, options)
% [ output ] = tapas_rdcm_compute_signals(DCM, output, options)
%
% Computes true and predicted signals
%
% Input:
% DCM - model structure
% output - model inversion results
% options - estimation options
%
% Ou... |
3d78731096fb7b1018d47564214ae8da671d02055ef49fd7a58182e846e67d78 | MATLAB | 3,947 | 113 | % 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 -... |
9b8a2ae201c358abaeff0098c3aed0ecc908e16941f8c2f5c48c5bbfca9360b6 | MATLAB | 3,947 | 143 | function [y] = tapas_ceode_int_euler(P, M, U)
% [y] = tapas_ceode_int_euler(P, M, U)
%
% Integration of a (delayed) dynamical system (convolution based DCM)
% based on the continuous extension for ODE methods. ODE step follows a
% forward Euler scheme:
%
% x_{n+1} = x_{n} + dt .* f(xhat_{n-taun})
%
% Also see ceode... |
90f97c6ccbf34a961a1897d8bd8d712cf88d2671efeac2d408c202d712a01886 | MATLAB | 3,948 | 141 | function [maxprop,uncor_prop,maxcsize] = meta_stochastic_activation_blobs(MC_Setup)
% MC_Setup = meta_stochastic_activation_blobs(DB)
%
% This function randomizes n contiguous blobs for each study within analysis mask
% and computes null-hypothesis weighted proportion of activated studies
% (contrasts)
% for whole-brai... |
16ca5253656309f3d5548a262a0e5e5bbe48371658b3b9f068c943cc5b67ce46 | MATLAB | 3,951 | 112 | function varargout = preprocNormalize(S,params)
% Usage: varargout = preprocNormalize(S,params)
%
% Normalize channels of a model. Most commonly, z-score each channel, but
% other methods are available.
%
% Inputs:
% S : stimulus / preprocessed stimulus. Better be 2D (time x channels)
% params : parameter struct... |
423357e1aac21aec3123f4ccd054e17118c2b37e3dbdd1e47a669fc3f8568e33 | MATLAB | 3,952 | 129 | function tapas_rdcm_tutorial()
% tapas_rdcm_tutorial()
%
% Tutorial script to demonstrate the application of regression DCM (rDCM) on
% simulated data. In the analysis, we try to recover the data-generating
% network architecture by pruning a fully connected network using rDCM with
% embedded sparsity constrain... |
626faee7722dd537dd95a790ccb705057f8dd0b64baa683023f8240ddff3934d | MATLAB | 3,952 | 89 | function [lineData, logFooter, linesFooter] = tapas_physio_read_physlogfiles_siemens_raw(...
fileNameLog, referenceClockString)
% Read in raw data/footer lines of logfiles, without data selection/sorting
%
% [lineData, linesFooter] = tapas_physio_read_physlogfiles_siemens_raw(...
% fileNameLog, referenceCloc... |
aaf5c3361d172544e89e700ae51ee6e6b172f1f77bca53dd8006a052e7375c34 | MATLAB | 3,952 | 132 | function detectHeartBeat(basicMetaData,varargin)
paramNames={'lfpFile','nCh','nSample','samplingRate','ecgCh',...
'evtFileName','saveFileName',...
'minPeak','minPeakDistance','medFiltOrder','bufferSize',...
'overlap','threshold','nBaseline'};
if ~isempty(basicMetaData)
if isfield(... |
14915e93cea8c2328db5cc4d7262ba7547925e05033b84f34ff0797261917d74 | MATLAB | 3,954 | 87 | %LC2014. Feb 7
%Deteccion de estados usando conceptos de algebra lineal
%La matriz formada por la multiplicacion de los eigenvalues*eigenvectors'
%indica el conjunto de vectores linealmente independientes que describen el
%comportamiento de la red.
%Una limitacion es que los patrones deben aparecer varias veces
%para... |
8e95f3937f0558aa024d66a9f21ce0bcb8d1c1e7a907d6b63296a6a79eb09173 | MATLAB | 3,954 | 130 | function [bins,binned] = Bin(x,a,b,c)
%Bin - Assign each input value a bin number between 1 and N.
%
% Assign each input value a bin number between 1 and N. Also return the
% corresponding bin values (lower bounds), e.g. assuming that the bins
% are [0,1] [1,2] [2,3] ... the value 2.3 falls in bin #3 and the bin
% ... |
02b7a077d65cfd7a87ad5999ea6af936e67b4b3a87353aee6b5b218a15ad2ddb | MATLAB | 3,955 | 88 | % EEGLAB_ERROR - generate an eeglab error.
%
% Usage: >> eeglab_error;
%
% Inputs: none, simply capture the last error generated.
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006-
%
% see also: EEGLAB
% Copyright (C) 2006 Arnaud Delorme, Salk Institute, arno@salk.edu
%
% This file is part of EEGLAB, see http://www.e... |
d355a86bf5a1c501df2d912f5e372b389633cfbafdf85e26ef6ae2e3a07c5541 | MATLAB | 3,956 | 106 | % Example to export joint EEG and Eye-tracking data (child mind)
% The data is not included here because it is too large, but it
% can be downloaded from http://fcon_1000.projects.nitrc.org/indi/cmi_healthy_brain_network/sharing_neuro.html
%
% Arnaud Delorme - May 2023
clear
cd('/System/Volumes/Data/data/matlab/bids... |
e2eca96b1ce2434a60bee6d3c8162dd7309f97e1e3366df002fdb7fd498916b5 | MATLAB | 3,957 | 117 | % Example function to demonstrate surface-based voxel selection.
%
% This function uses two surfaces (pial and white matter, from Freesurfer).
% On the surface, a "center" node is selected randomly, nodes nearby this
% center node are selected, the corresponding voxels are found, and a value
% of one is added to these... |
9cb4b49495d5d524ac69a73934e55bde3da603dd3ab8f8bad4ddf604ffb48eed | MATLAB | 3,958 | 131 | function [ psrf, neff, tau, thin ] = tapas_huge_psrf( samples, nChains, rBurnIn )
% Calculate the Potential Scale Reduction Factor
%
% INPUTS:
% samples - array containing samples from MCMC. 1st dimension: samples,
% 2nd dimension: parameters, 3rd dimension: chains.
%
% OPTIONAL INPUTS:
% nChains - num... |
e93fd53ea6c695b77a1816a0bf7fb6b4c1914760fb7312ff9d80f59faf859353 | MATLAB | 3,959 | 155 | addpath('../../networktools')
%% load network data
NT = NetworkObj('../testing/linear3.net',struct('dim',2));
NT.interpolateEdgePaths(2);
NT.setCumEdgeLen();
%% load snapshot data
resdir = '../testing/';
runname = 'testspreadLinSin';
filename = [resdir runname '.mesh.txt'];
MSH = MeshObj(filename);
snapfile = [resd... |
16f310a0be6531af17df123698043e41cb3a71d15aa155315d8e29a8f70ad111 | MATLAB | 3,960 | 133 | % load in and visualize snapshots
%load('../../ERCaSims/networks/WT/WT_circreg.mat')
%NT = WTnetworks(1);
%
NT = NetworkObj('../test/circlenuchexresv.net',struct('dim',2));
NT.setCumEdgeLen(1:NT.nedge);
%% load snapshot data
resdir = '../testing/';
%filename = [resdir 'testrecoveryWT.mesh.txt'];
filename = [resdir 'te... |
6a3ad7aa3b347564ac525c15a8ec3940462487a264cd9f49b27a5c119baa984c | MATLAB | 3,960 | 120 | function Tpes = getPES(P, onlyCorrectCurrent)
% GETPES Build a long table with one PES value per subject and age.
% OUTPUT: table with columns {Subject, Age, PES}
%
% PES = RT_01 - RT_11, where:
% 01: previous trial (t-1) = error, current (t) = correct
% 11: previous trial (t-1) = correct, current (t) = corr... |
870c70088d06f16e5b2f3fc171975e517e5b2f6fe2d87f26c46cb768afa7bc66 | MATLAB | 3,960 | 109 | function [chVals_out, chMNIs_out] = voxelAvg_chVals_3Dconv(chVals, plotInfo, d_mm)
% returns a running average of channels values in MNI space
% define a larger voxel
% assign voxels by channels values (chVals)
% smooth/average (3D convolution) & division by the number of times the values
% were assigned in each voxel
... |
05a24103ce48f6591008caf2d33011e2378a1d6e67dec5f911d56b8d9afcf0fb | MATLAB | 3,961 | 113 | % fit_OspreyMM2.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [fitParams] = fit_Osprey(dataToFit, resBasisSet, fitOpts);
%
% DESCRIPTION:
% THIS RETURNS A CLEANED MM SPECTRUM - need to fix up comments and maybe
% change name to somethign useful
function [out] = fit_OspreyCleanMM(dataToFit, basisS... |
262282c4e2af83dd9d9e85b1fd533398b3b1f8a936199cfa505cec104cb3b03e | MATLAB | 3,963 | 87 | function p = HT_MarginalTests(y, theTest)
% HT_MarginalTests p-value of a hypothesis test about the marginal distribution of values.
%
% These tests ask a question about the distribution of the values in the time
% series (its center, spread, symmetry, or shape) and are insensitive to the
% temporal ordering of the... |
6a7bba473a2bf55dbd2f84a3b3a01c4a622fa476ee1aa2371a61239875057771 | MATLAB | 3,963 | 118 | function ch2roi_plot_allFreq_SNR(GRUP, groupInfo)
% plots trials SNR (var of means / mean variance) over clz
% variable: GRUP.SNR_trials
% FIG:
% - subplots = freqBands x ROIs
% - 1 subplot: time x 1
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected freq. band
% - signifi... |
310a76e068e71af2a1c99dfc1628b993e7377cb19a63ffc51342bb9d4d0b2db8 | MATLAB | 3,964 | 96 | function out = DN_HistogramAsymmetry(y, numBins, doSimple)
% DN_HistogramAsymmetry Measures of distributional asymmetry
%
% Measures the asymmetry of the histogram distribution of the input data vector.
%
% ---INPUTS:
%
% y, the input data vector.
% numBins, the number of bins to use in the histogram.
% doSimple, whet... |
ace22efac6395551e12e6cc8cafaff598fe9311a947196b5803fb505e2715582 | MATLAB | 3,964 | 133 | %% BRENTMIN: Brent's minimization method in one dimension
function [xmin,fmin,funccount,varargout] = ...
brentmin(xlow,xupp,Nitmax,tol,f,nout,varargin)
% code taken from
% § 10.2 Parabolic Interpolation and Brent's Method in One Dimension
% Press, Teukolsky, Vetterling & Flannery... |
c1c22bab62390b748ed3b3e1f8d74dd8481a655241f25152011b85af3f356282 | MATLAB | 3,964 | 53 | function pix_hdr = GE_readHeaderPixel(fid, byte_align)
%
% pix_hdr = read_pixel_header(fid, byte_align)
%
% Loads the pixel header from the file with filed id fid
% and returns it as a structure.
% if byte_align = 1 then 32-bit alignment (SGI, LX2 format)
% if byte_align = 0 then 16-bit alignment (Sun, 5.X format)
%
% ... |
9a43c485236c32359b8a68f14a9ac0f36551cfab9561e7362b1e7e680dc188a1 | MATLAB | 3,967 | 101 | function task_clean_d(sii, PATH, cfg)
% Artifact attenuate ICA decomposed single subject EEG data epoched around gait cycle
% by clustering ICs and finding the best fitting cluster close to an a priory defined ROI
% Use repetitive clustering to overcome limits of kmean clustering, as random seeds
% and get more rel... |
c81b9eeff0e90df6450acdec869732028e0ec1a692f226b8cf17acee60af0649 | MATLAB | 3,967 | 128 | function [ options ] = tapas_rdcm_set_options(DCM, input_options, type)
% [ options ] = tapas_rdcm_set_options(DCM, input_options, type)
%
% Sets options for the rDCM analysis to the default settings. Options can
% also be specified explicitly by the user.
%
% Input:
% DCM - model structure
% i... |
edca91cb271d28dcaf4fac200fc6ec2a2d0af6212fa86522c89b39d2ab4889ef | MATLAB | 3,967 | 107 | function tapas_init_toolboxes(toolboxes,tdir,doShowMessages)
% Function initializing toolboxes
%
% IN
% toolboxes
% Names of toolboxes to add (including their dependencies).
% If empty, all toolboxes are added. Use lower case letters.
% tdir
% TAPAS directory.
... |
124532bfb087e138e35de134b528100fbb7239af3ab85b631ea802f1d0a5ae1b | MATLAB | 3,968 | 113 | function dataCardiac = tapas_physio_siemens_table2cardiac(data_table, ...
ecgChannel, dt, relative_start_acquisition, endCropSeconds)
% extract structured data from table of channel signal and trigger events
%
% dataCardiac = tapas_physio_table2cardiac(...
% data_table, ecgChannel, relative_start_acq... |
1e4ffedf0d5d202c9fed6bb99ea744d244693fa92ef3a9dbb750d4e3b66901cf | MATLAB | 3,968 | 117 | function [gene_id, coexp, status] = y_rand_gs_coexp(G, T, NG, maxDiff)
% Y_RAND_GS_COEXP(...) looks for random gene sets with similar coexpression
% level as the input genes of interest
%
% INPUT
% G -- gene expression matrix, regions by genes
% T -- target mean coexpression level
% NG -- number of genes within t... |
2cd76ee44b2feeccebabafb227e7b801e45b5421bb7836362dd2d955577b6e68 | MATLAB | 3,969 | 82 | function [nRMSE]=optim_TE_2D_IVIM(TEVec,DataMatrix,PhantomPars)
NoisePars.N_noise = PhantomPars.N_noise;
NoisePars.N_rep = PhantomPars.N_rep;
[DataMatrix] = add_noise_IVIM_T2_phantom(NoisePars,[],[], DataMatrix, 0,PhantomPars);
PhantomPars.TE = PhantomPa... |
de52f2c8644689bddf62cef35e273462e1a932c3ea02fc53078dcff8114ca1b8 | MATLAB | 3,970 | 123 | %classdef MeshObj < handle
classdef MeshObj < matlab.mixin.Copyable
% object defining a FVM mesh
properties
ncell
dim
bounds
len
pos
deg
maxdeg
resvind % reservoir index
nodeind % which node index
edgeind % which edge index
rad % mesh... |
990226fd216b8e4cd47d5bcfe6d40e55107417a5a13e7b2e6bcb23a7cc346f45 | MATLAB | 3,971 | 125 | function dat = proc_BeerLambert(dat, varargin)
% PROC_BEERLAMBERT - apply the BeerLambert function, which is useful to analyze
% NIRS data: relative concentration is calculated as a function of total photon path length
%
% Synopsis:
% DAT = nirs_LB(DAT, 'Property1',Value1, ...)
%
% Arguments:
% DAT: data struct wi... |
a9d869e2f55d6d39cbbaa66f32d9a79180048b7fba31b7138946eb82dd8a423e | MATLAB | 3,974 | 87 | %VL_NNCONVT CNN convolution transpose.
% Y = VL_NNCONVT(X, F, B) computes the transposed convolution of
% the image stack X with the filter bank F and biases B. If B is
% the empty matrix, then no biases are added.
%
% X is a SINGLE array of dimension H x W x D x N where (H,W) are
% the height and width of th... |
dd775688d307d12eb0783e9e285fa193333a24b0f8810cbb786170e63e81d9f1 | MATLAB | 3,975 | 105 | %% h = sepia_handle_panel_bkgRemoval_VSHARP(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 ot... |
9253b229bc86542bfcd9ba4222659dc72c045336d093cad832dd9ac64de537db | MATLAB | 3,976 | 95 | function [varargout] = likGumbel(sign, hyp, y, mu, s2, inf, i)
% likGumbel - Gumbel likelihood function for extremal value regression.
% The expression for the likelihood is
% likGumbel(t) = exp(-z-exp(-z))/be, z = ga+s*(y-t)/be, be = sn*sqrt(6)/pi
% where s={+1,-1} is a sign switching between left and right skewed... |
c36f8a0173d91559b6542a7300342434d0eced0194c7c67dc86e7ee5e9026aa3 | MATLAB | 3,976 | 122 | function OPC_calciumAnalysis ( Hz )
% script that analyses ROIs for single channel across different ROIs
% choose folder where data is stored
myFolder = '2.temp excel data';
% load matrices from excel data corresponding to fluorescence data
fPattern = fullfile( myFolder, '*transients.xlsx' );
files_trans = dir( fPa... |
f81be6f1ea31ff679d2caddfdac728629bad4ce8748022f876a75451cddf6ba0 | MATLAB | 3,977 | 98 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This function takes in mouse name as the primary argument and will save the file with the current time and date.
% The function asks the user to confirm the data was just collected othe... |
be188ada981db18e79492d6ac53cfff07e5df07fe2540256e5efb1b5d457f250 | MATLAB | 3,978 | 140 | function plot_fig3e_left(datadir)
% Plot z-scored dopamine at the offer cue conditioned on trial initiation
% time on the subsequent trial, averaged across rats. N = 10 rats.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
nbin = 4;
fname = fullfile(datadir, '... |
c302a504d4bd420e42c5c2a436f21a4f4cc1d2a8eef6aef303d4790ff331bcc4 | MATLAB | 3,978 | 113 | function varargout = motion_c3d(filename, hdr, begsample, endsample, chanindx)
% MOTION_C3D reads motion tracking data from a C3D file, see https://www.c3d.org
%
% Use as
% hdr = motion_c3d(filename);
% dat = motion_c3d(filename, hdr, begsample, endsample, chanindx);
% evt = motion_c3d(filename, hdr);
%
% See al... |
f22a7f944406c9a9a0c756e05e166b23bdf64a1b8f25bb82cc8ba8a8db27e9ee | MATLAB | 3,978 | 123 | function result = validity(result,data,param)
%validation of the clustering
N = size(result.data.f,1);
c = size(result.cluster.v,1);
n = size(result.cluster.v,2);
v = result.cluster.v;
if exist('param.m')==1, m = param.m;else m = 2;end;
if param.val==1
%partition coefficient (PC)
fm = (result.data.f)... |
07055e6c69042b421ab42cd9d5561893a6e30426dcf8247db1c2d1851be9a8ee | MATLAB | 3,979 | 151 | function rasterPlot(File,spikeMatrix,Params,spikeFreqMax, figFolder, oneFigureHandle)
% creata a raster plot of the recording
% Parameters
% -----------
% File : char
% spikeMatrix : matrix
% Params : structure
% spikeFreqMax : float
% figFolder : path to directory
% absolute path to folder to save t... |
31796d2ffd0bafe7ab202c4dc2cd40cdc86bd3594d99936273064d5c028e1aba | MATLAB | 3,979 | 116 | function out = osp_plotCoreg(MRSCont, kk, VoxelIndex)
%% out = osp_plotProcess(MRSCont, kk)
% Creates a figure showing coregistration between T1 image and MRS voxel
% stored in an Osprey data container
%
% USAGE:
% out = osp_plotCoreg(MRSCont, kk)
%
% OUTPUTS:
% out = MATLAB figure handle
%
% ... |
45ba7756c0e28651cd44b65438c8df67e157456495b3f9b291875fdff757f0cd | MATLAB | 3,979 | 114 | function [colPhys, colCard, colResp, colMult, colHRV, colRVT, colRois, colMove, colAll] = ...
tapas_physio_check_get_regressor_columns(SPM, model)
%
% returns indices of physiological regressors in an SPM design-matrix,
% pooled over all sessions for later creation of an F-contrast
%
% INPUT:
% SPM SPM.mat
% ... |
e6de09fea70835dbc580cb8adfc5496080d053cd58023316feae552d623a7574 | MATLAB | 3,979 | 105 | function [] = plot_chemotaxis(xvals,yvals,CPortStdLoc, neutZone,name,pathstr, subsetplot, individualplots)
%% plot_chemotaxis: Function for plotting worm tracks in a chemotaxis setup.
%% Retrieve global variables
global info
%% Cleaning up the data for plotting
% Given the info.radius of the asasy circle, remove trac... |
992fc4fe79160b6b14aa1aa8f40e0485e899cb20c924e817030f5795f4737d50 | MATLAB | 3,981 | 108 | function out = NL_NSAMDF(x, tauMult, winLenRel, shiftLenRel, degree, doPlot)
% NL_NSAMDF computes the nonlinearity measure L through nsAMDF
% (nonlinear average magnitude difference function), developed by:
%
% Ozkurt et al. (2020), "Identification of nonlinear features in cortical and
% subcortical signals of Parkinso... |
edc0fdbdd8675a54d7d0df88cf2d2bf7900b029af859277977b8ea3a09b37df0 | MATLAB | 3,981 | 104 | % Ground-truth network metrics computed by MATLAB's OWN BCT functions on the
% adjacency matrices from THIS parity run (parityRun/OutputData_MATLAB_parity),
% so the Python port can be fed the identical graph.
%
% This isolates the step-4 metric arithmetic from step 3's probabilistic
% thresholding, which uses an indep... |
639418a121ac7fe608e835bcbdcf26f5ffdf004acb1bbd3990628efa09624d71 | MATLAB | 3,985 | 120 | % group stats pipline
% normalized using fsl and gunzip
% smooth using spm
% calculate group stats
% Inputs:
% slName - the search light name
% output_dir - where the results that need to be norm and smoothed are located
% it should be after the data_path
close all
clear all
clc
slName = 'L100_projMat';... |
470781ae88ca767b54a7d86b8c0bddc98a3cc83996e6bf6c0976c6cc561e39b9 | MATLAB | 3,987 | 95 | function [results] = analysis02G2(config)
% Runs analysis02G2: Evaluate fittest reservoirs of populations that were
% evolved in analysis02G1 on unseen data and/ or unseen environments.
% Parameter
% ---------
% config (struct) with fields:
% T (struct) : with fields trainTime (int), testTime (int), spinup (int)
% ... |
75d675638ddf62a2d6b1b4073e93c405982a1a5b3b8c7b50b5b00a9fd018ddaa | MATLAB | 3,987 | 107 | % BIDS_WRITETIEEGINFOFILE - write tinfo file for iEEG data
%
% Usage:
% bids_writetinfofile(EEG, tinfo, fileOut)
%
% Inputs:
% EEG - [struct] EEGLAB dataset information
% tinfo - [struct] structure containing task information
% notes - [string] notes to store along with the data info
% fileOut - ... |
92b62c862d303948d1ccc3850b455a625b27eeb7d8ef85bb18008987ccb8fa60 | MATLAB | 3,988 | 105 | % 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
% ... |
efde52703977c1cf9b79dbfc254180a0a95df987b23b288331c4ea383e95bc63 | MATLAB | 3,988 | 172 | %%% SPLINEFIT EXAMPLES
%% EXAMPLE 1: Breaks and pieces
% Data (200 points)
x = 2*pi*rand(1,200);
y = sin(x) + sin(2*x) + 0.2*randn(size(x));
% Uniform breaks
breaks = linspace(0,2*pi,41); % 41 breaks, 40 pieces
pp1 = splinefit(x,y,breaks);
% Breaks interpolated from data
pp2 = splinefit(x,y,10); % 1... |
88f90ec75ccb9643f26f0a209e36296b0bb7fdb162f4d92786e46754fbc2ae34 | MATLAB | 3,989 | 111 | function string = user_string(string_name, string)
%USER_STRING Get/set a user specific string
%
% Examples:
% string = user_string(string_name)
% isSaved = user_string(string_name, new_string)
%
% Function to get and set a string in a system or user specific file. This
% enables, for example, system spec... |
a3e9418da2869c5d7354c2e15dad4d053a5d3a698dadc3e8c8e29ef412033ca1 | MATLAB | 3,989 | 88 | function out = SB_BinaryGapHomogeneity(x, gapWhat)
% SB_BinaryGapHomogeneity Homogeneity of the gaps between like symbols in a binarization.
%
% The time series is symbolized to a binary string by whether it's above (1) or
% below (0) zero (equivalently its mean, for the z-scored input this is
% registered on). Taking... |
f2c4cabd9d48684411d4f3f2c8c2b92167b4177a9ae9f7df14f404381cf16583 | MATLAB | 3,989 | 117 | %% function [RDF,mask]=BKGRemovalVSHARP(totalField,mask,matrixSize,voxelSize,varargin)
%
% Input
% _____
% totalField : total field
% mask : ROI mask
% matrixSize : image matrix size
% voxelSize : voxel dimensions, in mm (1x3 vector); default = [1 1 1],
% i.e. 'rad... |
db1f14dc46a13636694b1d5ebf68747311fa1b7b06bd30a5a4abce33d8b2ca37 | MATLAB | 3,990 | 163 | function [ layout, found_elecs ] = nmri_make_layout_invasive( subject )
%[ layout ] = nmri_make_layout_invasive( subject )
% Will try to auto-generate a layout for invasice SEEG data
%build a custom layout of all EEG channels
% needs some fieldtrip functions introduced with releases after 05/2019
if exist('ft_append... |
8d981262122771d0ca534e520195cf754438c85be80a0b9da479508175e33c41 | MATLAB | 3,991 | 136 | function plotSpectrum2Axes(spectralData, ch, plotInfo)
% plots a spectrum of a channel 'ch' into axes
% (c) Jiri, Jun20
%% variables
cLims = plotInfo.cLims;
nRows = plotInfo.nRows;
nCols = plotInfo.nCols;
marg_h = plotInfo.marg_h;
marg_w = plotInfo.marg_w;
gap = plotInfo.gap;
thisSub = plotInfo.thisSub;
if ~isfield... |
d6869a53bc47f7a778a9c0a7d5b456b4ccf846fc585c3577e97fccd527886562 | MATLAB | 3,991 | 100 | function [rez] = Waveform(rez,DATA)
M_clust = length(unique(rez.st(:,end)));
M_T = length(unique(rez.st(:,3)));
temp = unique(rez.st(:,3));
nt0 = rez.ops.nt0;
Nchan = rez.ops.Nchan;
%calculate the average template of the merged clusters
template = zeros(rez.ops.nt0,Nchan,M_T);
M_template = zeros(rez.ops.nt0,Nchan,... |
1ea187db5255a083af08b9b119c17098a1e68fe74c670297501ac7facdfdd396 | MATLAB | 3,993 | 117 | function [low, high] = incongruentResponse_twentyPreVsPost_byATI(ephysPath, tablePath, prc)
%Look at responses to 20ul trials pre and post incongruent trial split by
%ATI
%INPUTS:
% ephysPath = path to ephys data structs
% tablePath = path to table with blockiness metric
% prc = percentile to look for blockiness... |
649c80d09885ba0a1cab9c5008972349159fd52d6be66d27bc2a72a62627c751 | MATLAB | 3,993 | 131 | % 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... |
d9c241e9673adae85dce3992a21e5dc9c8f2e3bd61467bf788765332202d79ee | MATLAB | 3,997 | 110 | % 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 t... |
f73dad9c725bd6aaf4e9b41ed78eae1f107c97c6bad4b56b6b08e7c3d8a4f7f3 | MATLAB | 3,997 | 105 | function corrplot(data2,corr_stats,xlabeln,ylabeln,xtk,xtklabel,ytk,ytklabel,ppp,fname)
ax = min(data2):(max(data2)-min(data2))/100:max(data2);
p = corr_stats{1,4};
r = corr_stats{1,1};
figure
N=0;
pwhile = p;
if(p>0)
while(pwhile<1)
pwhile = pwhile*10;
N=N+1;
end
pstr = num2str(pwhile);
pstr =... |
d1c396246fa5d717cffa888bab6921c0a354498674167d193e15e77de0241860 | MATLAB | 4,000 | 88 | %VL_NNCONVT CNN convolution transpose.
% Y = VL_NNCONVT(X, F, B) computes the transposed convolution of
% the image stack X with the filter bank F and biases B. If B is
% the empty matrix, then no biases are added.
%
% X is a SINGLE array of dimension H x W x D x N where (H,W) are
% the height and width of th... |
c1b968009e57bf7d8e16cf493fcbe0788a26de1b999f6bd22bb8f806767c1aa4 | MATLAB | 4,001 | 96 | function [r,p] = CofiringCoefficient(spikes,intervals1,intervals2)
%CofiringCoefficient - Compute the cofiring coefficient between two sets of intervals.
%
% Compute the cofiring coefficient of unit pairs between two sets of intervals
% (such as theta cycles and ripples). First, count the spikes emitted by each
% unit... |
8c67baf2e822894c64a37006792dac40ae5e5a582fa6ed1de3c88333e3f6571e | MATLAB | 4,003 | 103 | function OUT = generateBetaPatterns(clusterSpec, nVoxels, centroid)
% B = generateBetaPatterns(clusterSpec, nVoxels[, centroid])
%
% Generates a [nConditions nVoxels]-sized beta matrix of data where the
% responses are clustered according to clusterSpec (see below). Does not
% simulate scanner noise --- these simulate... |
5cbeed6bc31405e8663e39d58f20d69924af053f14f26147766656c6d009d4ba | MATLAB | 4,006 | 132 | function plot_fig4i_left(datadir)
% Plot reward port poke probability during the delay period on trials
% following hit trials with short vs long delay. Mixed block only.
% Short and long trials correspond to bottom and top quartiles of
% reward delay distribution. N = 16 rats.
%
% INPUTS
% datadir: file path of data d... |
8ce515c4dc0bb68466085b396f2fa98abc1702faef25912486e091983ba495bd | MATLAB | 4,008 | 98 |
%%
for ith_freq = 3:7
keyword = 'vector';
root_path = ['/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/MRI_result_sinusoid/periodic_2501_testing_',num2str(ith_freq),'_fieldmap_',keyword,'_mean/'];
mask = MRIread('/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/mask/mask_MTL_bigger_... |
0f15502c7d43267fc3f8af1e4aa023aa7e98a00e6aa2cd2944c4bb3df57e93e0 | MATLAB | 4,012 | 123 | function out = EN_rpde(x, m, tau, epsilon, T_max)
% EN_rpde Recurrence period density entropy (RPDE).
%
% Fast RPDE analysis on an input signal to obtain an estimate of the H_norm value
% and other related statistics.
%
% Based on Max Little's code rpde (see below)
%
% ---USAGE:
% [H_norm, rpd] = rpde(x, m, tau)
% [H... |
0966a2edaa4a4666e7029c8177fab5a9704789a5ae56530c7358b9227aafdd4f | MATLAB | 4,013 | 83 | function [SIGNAL_subspace_similarity, NOISE_subspace_similarity, SENSAI_score] = SENSAI(artifact_threshold, refCOV, Eval, Evec, noise_multiplier, cov_total, evecs_Template_cov)
% Evaluates GEDAI cleaning quality for a given threshold.
%% Creative Commons License
%
% Credits: Tomas Ros & A... |
32831c15fc6c3561699a6ad30f749bd6ad1343527ab1931f73441693ad9aec1d | MATLAB | 4,019 | 103 | function [fr,xr,h_line,h_points] = BF_plot_ks(dataVector,whatColor,doSwap,lineWidth,markerSize,trimRange)
% Plot a kernel smoothed distribution with individual datapoints annotated
%
%---INPUTS:
% dataVector, a vector of data to plot
% whatColor, the color to plot line and points
% doSwap, (logical) whether to swap axe... |
4ec1dd8ceccac33dd9fe629f333b8a3e95702454cf3e313376f68c67e2cb4072 | MATLAB | 4,019 | 124 | function [err, slc, slcDisp] = GetAfniSlice (Brik, BrikInfo, Opt)
%
% [err, slc, slcDisp] = GetAfniSlice (Brik, BrikInfo, Opt)
%
%Purpose:
% Display a slice as it appears in the AFNI window
%
%
%Input Parameters:
% Brik: is a vector or a matrix containing the brik values
% BrikInfo is a structure containing Hea... |
4c87b2901378f002f9111fc6174741c9fc40e79cd02d84bf34fba16be435c755 | MATLAB | 4,020 | 131 | function fear_icaCoactTrigLFPaverage(basename,varargin)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'
% basename='~/data/Fear/triple/karmeliet190901/karmeliet190901';
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
... |
7572bbcb6daec42820d9525d111478125fe2d9fcf19663aef2bee4cfa8fe1691 | MATLAB | 4,023 | 96 | function out = CO_NonlinearAutocorr(y, taus, doAbs)
% CO_NonlinearAutocorr A custom nonlinear autocorrelation of a time series.
%
% Nonlinear autocorrelations are of the form: <x_i x_{i-\tau_1} x{i-\tau_2}...>
%
% The usual two-point autocorrelations are: <x_i.x_{i-\tau}>
%
% Assumes that all the taus are much les... |
b796b1235e926a1e4579358d1425231f59a96c446194ac44419a6166bb22c6dc | MATLAB | 4,026 | 112 | function [fc, verbose] = tapas_physio_filter_cardiac(t,c, options, verbose)
% Bandpass-filters cardiac data using butterworth/chebyshev filters
%
% [fc, verbose] = tapas_physio_filter_cardiac(t,c,options, verbose)
%
% IN
% t [nSamples,1] time vector of cardiac time series
% c [nSamples, 1] ca... |
35c17cd02738bc24135f954c292d85e1fe9ba7d9feb0ed4c56c3959419497fa5 | MATLAB | 4,027 | 128 | function varargout = getLFPAmpPhase(lfpFile,nCh,ch,varargin)
% get amplitudes and phases of filtered LFP by Hilbert transform
%
%
% [amp,phase]=getLFPAmpPhase(lfpFile,nCh,ch,varargin)
% inputs
% lfpFile : path of .lfp file
% nCh : total number of ch in the .lfp file
% ch : ch to be used
%
% options and defaults
% ... |
5ef1f50463c638fe4c9fbe8ea1dc5e7e975e0721f9b7b1ef8c8817826f8f8601 | MATLAB | 4,028 | 120 | function hfig = tightfig(hfig)
% tightfig: Alters a figure so that it has the minimum size necessary to
% enclose all axes in the figure without excess space around them.
%
% Note that tightfig will expand the figure to completely encompass all
% axes if necessary. If any 3D axes are present which have been zoome... |
fa495b7564efb926a0c150ea89de6576f0728f3e0c2dcd317b52fa417c07ec5c | MATLAB | 4,028 | 111 | function [C,Cproj] = iemcovinterpFunc(dat,theta,thetabasis,foldvar,covtime,thetabasis2)
% [C,Cproj] = iemcovinterpFunc(dat,theta,thetabasis,foldvar,covtime,thetabasis2)
% dat is channelXtrialXtime, theta is angles (from -pi to pi)
thetabasis = thetabasis(:); %make sure the basis set locations are in a column ve... |
3dce27ac54058de2e980f19969b68682dcb5259ebd46377ede323fe81cffea1c | MATLAB | 4,032 | 141 | function [WTOpt, WTMdl, BlkInf, RPE, Belief, Kappa, Prior] =...
GenerateSynthData_Bayes_subopt_onlylambda_flat(params, ratTrial,...
noise_arg, gen_arg, noise_params)
%GenerateSynthData_Bayes_subopt_onlylambda_flat - generates synthetic wait
% times for Bayes SubOpt model with lambda over a
% FLAT PRIOR = [1/3... |
f72e20b88b311a58e289f52bb31a45b0de81ce47c3e09a1c579d75c47e77fbe4 | MATLAB | 4,032 | 139 | function [OUT] = bootstrap_mtx(data,e,varargin)
% [OUT] = bootstrap_mtx(data,e,[meth],[verbose],[niter])
%
% tor wager
%
% BOOTSTRAP TEST FOR SIG. DIFFERENCE IN COVARIANCE FROM e (Ho)
%
% This function takes as input two matrices,
% an actual matrix of data
% and an expected / null hypothesis
% covariance or correlatio... |
7b40f06089c5398dc6ae76069b6b1d3c44f6dedc860f27cfff16c23f0bdca549 | MATLAB | 4,033 | 112 | function isObjectEqual = tapas_uniqc_isequaltol(a,b, tolerance)
% Performs isequal similar to matlab for numeric values, strings and cells,
% but allows for a tolerance (also for cell of cells, recursive compare)
%
% isObjectEqual = tapas_uniqc_isequaltol(a,b, tolerance)
%
% NOTE: the odd cases empty, nan and inf are ... |
dee7ab91ffdd1dc088ee17f68b464920a028088fcd7e48e6ca449f6ab703940f | MATLAB | 4,033 | 98 | % This script imports data about the recordings ("meta-data") from csv /
% excel files to the matlab variables
if strcmp(spreadsheet_file_type, 'excel')
[num,txt,~] = xlsread(spreadsheet_filename,sheet,xlRange);
ExpName = txt(:,1); % name of recording
ExpGrp = txt(:,3); % name of experimental group
Exp... |
ba7743d2bd6ea51a920760233daf0cae077e12b2c1ae2ba67e496b2e21ba8ec1 | MATLAB | 4,034 | 121 | % ZICA - Z-transform of ICA activations; useful for studying component SNR
%
% Usage: >> [zact,basesd,maz,mazc,mazf] = zica(activations,frames,baseframes)
%
% Inputs:
% activations - activations matrix produced by RUNICA
% frames - frames per epoch {0|default -> length(activations)}
% baseframes - vector o... |
d1a75ca05527b9ebbb8de377a5f253e961b7ad31946628693f3afebfdf90b3cb | MATLAB | 4,034 | 140 | function [unmixsource,umxcoeff,options]=umxPCA(source,reference,varargin)
% GOAL: Unmix the two signal using Principal Component Analysis method.
%
% INPUT:
% - source: source trace 'sce' to be unmixed from the reference trace 'ref'.
% - reference:
% - options (as input struct or variable arguments):
% ... |
23276f9d1b84f3f5eb8f52b0ad0fb5e2318acf66744684d50e0ad72fbe61713f | MATLAB | 4,035 | 110 | % GRADMAP - compute the gradient of an EEG spatial distribution.
%
% Usage:
% >> [gradX, gradY ] = gradmap( map, filename, draw )
%
% Inputs:
% map - level of activity (size: nbelectrodes x nbChannel)
% filename - filename (.loc file) countaining the coordinates
% of the electrodes, or array... |
e23302c21ee846aa9925683fca1d027320aa28315a4067c2e95e670cda1af5b9 | MATLAB | 4,036 | 105 | %% get_set_echocombine_medinonlinearfit(h,mode,input)
%
% Input
% --------------
% h : structure contains all handles of SEPIA
% mode : 'set' - extract information from GUI to config file
% 'get' - extract information from config file to GUI
% input : if mode is 'set' then i... |
677ed8effc07310e053e38b14ead304beb516f83256a3c19d405d699e7594fd1 | MATLAB | 4,037 | 146 | function [WTOpt, WTMdl, BlkInf, Belief, Prior, Kappa] =...
GenerateSynthData_Bayes_Bias(params, ratTrial,...
noise_arg, gen_arg, noise_params)
%GenerateSynthData_Bayes - generates synthetic wait times
%for optimal Bayes model.
% Inputs:
% params - Parameter vector. [kappa_mi, kappa_hi, kappa_lo, D, lambda, bi... |
4b4ea0015231419cb9270f97e8d3372196bd905411545cde92bd6171da87ba5d | MATLAB | 4,039 | 127 | function [refShift, refFWHM] = osp_XReferencing(dataToFit,frequencies,polarity,lim,realpart)
%% [refShift, refFWHM] = osp_XReferencing(dataToFit)
% Calculates the reference shift and full-width half-maximum (FWHM) of a
% spectrum according to the LCModel algorithm. The algorithm is described in:
% S.W. Proven... |
835ddb8d61f50d8c0ec228f5176977b03a06fab26b1693db86bd177c3a3c0ef0 | MATLAB | 4,040 | 89 | function ProcessData_ExtendedData5(datadir, savedir, codedir)
%ProcessData_ExtendedData5 - Process raw data saved under datadir such that it can be plotted by PlotExtendedData5.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_ExtendedData5.mat' from Zenodo was saved
% codedir - Local directory wh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.