sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
a18d5916d433be7d011460c6332da0db1ce381072e64ea09bcc7a90b680d4b0a | MATLAB | 7,010 | 178 | % forcelocs() - rotate location in 3-D so specified electrodes
% match specified locations.
% CAUTION: Only for use on electrodes in
% and remaining in the upper spherical hemisphere,
% otherwise it will work improperly. Written primarily for
% adju... |
6da4d34e412c20bf9941b6efb24e7ecb96ba3fcaac490b270becd937656e47b2 | MATLAB | 7,019 | 247 | % eeg_amplitudearea() - Resamples an ERP average using spline interpolation
% at a new sample rate (resrate) in Hz to get the exact limits
% of the window of integration. Finely samples the window
% and adds together very narrow rectangles capped by
... |
b36c1ff4e36edf5bb9d99d35542011d3535eac8f8827f4804a1431ccedbd580b | MATLAB | 7,020 | 233 | % eegplotsold() - display data in a clinical format without scrolling
%
% Usage:
% >> eegplotsold(data, srate, 'chanfile', 'title', ...
% yscaling, epoch, linecolor,xstart,vertmark)
%
% Inputs:
% data - data matrix (chans,frames)
% srate - EEG sampling rate in Hz (0 -> 256 Hz)... |
d328849850be834408be9054b2ebb80daadfcbfc2ab2ee45822356243e418028 | MATLAB | 7,023 | 224 | function [t,x,y,vx,vy,ax,ay] = KalmanVel(posx,posy,post,order,Q,R)
% Returns the velocity estimation using the Kalman Filter on recorded position.
%
% Kalman filter for obtaining an appriximate Bayesian MAP estimate to the rat's
% trajectory from raw video tracker data.
%
% The trajectory model is the set of Taylor s... |
9dc73668d3e7f70edbf50e367c9d616d4dbad5bf1f93488d286f4d1581623074 | MATLAB | 7,025 | 199 | function [vals] = ea_networkmapping_calcstats(obj,patsel,Iperm)
if ~exist('Iperm','var')
I=obj.responsevar;
else % used in permutation based statistics - in this case the real improvement can be substituted with permuted variables.
I=Iperm;
end
AllX = ea_get_AllX(obj);
% quickly recalc stats:
if ~exist('pat... |
fa654277c68f67cb34850e31f3c4632f3259e84dd37e68306e8c1e87ea74d808 | MATLAB | 7,028 | 210 | function [wavespec] = bz_WaveSpec(lfp,varargin)
%[wavespec] = bz_WaveSpec(lfp) calculates the
%wavelet transform of a signal with nfreqs frequencies in the range frange
%[fmin fmax]. Spacing between frequencies can be 'lin' or 'log'.
%Time-frequency resolution is defined by ncyc, the number of cycles in each
%wavelet... |
17fd77a1b24b6716e72ccb8fc3548e756fc6621a8c055a9a7329066d15726381 | MATLAB | 7,032 | 135 | function [chosenfluor,chosenred,chosenROIs,chosentemps,chosenFrameRate,chosenIndex]=compare_tuning(headpath,savemode)
%give the headpath (genotype) go to the extracted folder
%bring up the different ROIs for each
%let the user select which ROI they want to use as the one to compare for
%THAT fly
%take the dff for thos... |
e0e2e7c0b69de1efb886f39ef41fba5660c7d98f97f87ebecb31dea9f3ca8c1a | MATLAB | 7,033 | 233 | % chanproj() - make a detailed plot of data returned from plotproj()
% for given channel. Returns the data plotted.
% Usage:
% >> [chandata] = chanproj(projdata,chan);
% >> [chandata] = chanproj(projdata,chan,ncomps,framelist,limits,title,colors);
%
% Inputs:
% projdata = data returned from plotpro... |
e94c9b6c664dc0b75385afd3393dd4878270794b0fab194ea332c343eda71dc4 | MATLAB | 7,033 | 159 | function [Temptrace_batch, tempRoi_batch, trace_cor, handles] = SegmentationBatch_autoThresh(handles, disppara)
if nargin<2
disppara=1;
end
scrsz = get(groot,'ScreenSize');
pos_seg = round([scrsz(3)*0.1 scrsz(4)*0.55 scrsz(3)*0.4 scrsz(4)/3]);
mov = handles.mov;
mov2d_filt = handles.mov2d_filt;
%%%%%% setup paramet... |
0b25ee1aa7489f7d46a4633423f873267b1accfddacbec90b599ef202411a4a5 | MATLAB | 7,035 | 244 | function [power, tfFreqs, tfTimes, efwhm] = fun_tfr_morlet(data, srate, times, varargin)
% Time frequency decomposition using complex Morlet wavelets.
%
% This function should be considered highly experimental and may not yield
% desirble results in all settings
%
% Required inputs:
%
% data: Either a channel x timepoi... |
c8c268fd9cc25a5bfade4d97d4bb009b8d92f65d5613711ab5b7ea4ac697a438 | MATLAB | 7,044 | 166 | function varargout = impexp_run_nifti2MrStruct(cmd, varargin)
% Template function to implement callbacks for an cfg_exbranch. The calling
% syntax is
% varargout = impexp_run_nifti2MrStruct(cmd, varargin)
% where cmd is one of
% 'run' - out = impexp_run_nifti2MrStruct('run', job)
% Run a job, and retu... |
49460627c2c8d1a9974fb26e73d9cfdfc48e0ddd5f9f019fbc31af55657d5d89 | MATLAB | 7,045 | 174 | function [] = bz_compareReplay(spikes,ripples,template,include)
% spikes - buzcode cellinfo file (requires spikes.times, an Nx1 cell
% array of timestamps in seconds for each neuron; spikes.UID and spikes.spindices)
% ripples - buzcode ripples events file (only requires ripples.timestamps,
% an N... |
7013e88a6ab5c2afdf6eef723cecef9b947da0063bef3ef5599c2a2227d693f6 | MATLAB | 7,048 | 197 | function [P,apar,kpar,upar] = palm_pareto(G,Gdist,rev,Pthr,G1out)
% Compute the p-values for a set of statistics G, taking
% as reference a set of observed values for G, from which
% the empirical cumulative distribution function (cdf) is
% generated. If the p-values are below Pthr, these are
% refined further using a ... |
467332e990b61cf0817bf73f0f721adeb9ae993684b3d77e4e1b6e33ed342062 | MATLAB | 7,056 | 160 | function writePLXFile(filename, data, h)
% writePLXFile - Write data to a PLX file.
%
% writePLXFile(filename, data, headers)
%
% writePLXFile is designed to generate a new PLX file using spiking data
% and header information. The header data can be taken from an existing PLX
% file using the companion function ... |
5b45263266fcddfd553d5fa1c5bdd1a8655248e05f8b9ca54473b0a65f2f58f5 | MATLAB | 7,061 | 183 | % pop_rmdat() - Remove continuous data around specific events
%
% Usage:
% >> OUTEEG = pop_rmdat( EEG); % pop-up a data entry window
% >> OUTEEG = pop_rmdat( EEG, typerange, timelimits, invertselection);
%
% Graphic interface:
% "Time-locking event type(s)" - [edit box] Select 'Edit > Event values'
% ... |
218bec5bd4c726939fd0bc04584538cda859b9258ab69f85274160dc916b4e02 | MATLAB | 7,063 | 176 | function [flag, m2, SE, Va, Ve, Lnew] = Morphometricity_1RandEffect(y, X, K, alg, tol, MaxIter)
verbal = 0;
% This function implements morphometricity.
% It fits a linear mixed effects model using the restricted maximum likelihood (ReML) algorithm,
% and produces the morphometricity estimate and its standard error.
... |
2d6410ba615444a18a261cbce83a3fbfd7f9d752161fce7b4cb4a8dd6db3e5ec | MATLAB | 7,063 | 180 | %%% Supplementary Figure 9
% Cross-ratio Spearman correlation matrices of deviance-related differential GC
% topographies for monkey C.
% Structure:
% 1) Compute correlation matrices across monkeys, because the marker for
% significance in both monkeys depends on both animals
% 2) Draw Supplementary Figure 9 f... |
b33c93a1e322b59c4fc3fdcc4627d3dfa1ab3ecc44a4601cc44a9755b636bc9d | MATLAB | 7,065 | 174 | %% MULTIVARIATE_CONNECTIVITY_WALKTHROUGH
% This helpfile contains a walkthrough of the steps need to complete a
% Multivariate Connectivity Analysis with fMRI Data
%
%
% This walkthrough was written by Marianne
% at the Cognitive Affective Neuroscience Lab, CU Boulder
%% GENERAL INSTRUCTIONS
% Prepare you... |
dc06af82cf945c5994cc4ccaea203fb6446489836b133d8d1a17242bf4db7df9 | MATLAB | 7,067 | 213 | function [t,x,y,vx,vy,ax,ay] = KalmanVel(posx,posy,post,order,Q,R)
% root.KalmanVel(x, y, t, order);
%
% Code adapted from Sturla Molden (see below) to work within CMBHOME
% framework. Returns the velocity estimation using the Kalman Filter on
% recorded position.
%
% Kalman filter for obtaining an appriximate Bayesian... |
583460be302a3b1f24dd5ad2b2f3e87b249f6e19aaaf6dd19443b304b0b9590f | MATLAB | 7,068 | 187 | % Load NIfTI / Analyze header without applying any appropriate affine
% geometric transform or voxel intensity scaling. It is equivalent to
% hdr field when using load_untouch_nii to load dataset. Support both
% *.nii and *.hdr file extension. If file extension is not provided,
% *.hdr will be used as default.
% ... |
42ba781d578030a90710df66d637d2c228b1031859d551dd3904ac31bf61d14b | MATLAB | 7,069 | 165 | function [spkEventTimes] = bz_getRipSpikes(varargin)
%
% [SpkEventTimes] = bz_getRipSpikes(varargin)
% Saves spike times of all units inside given events in different ways:
% 1. Absolute and relative time of spikes by unit and by event
% 2. Absolute and relative time of spikes by unit
% 3. Absolute and relativ... |
cc47607519b9621c62b7b8269f6923f7f4d047f9afa9a2fde37fdbd49099e564 | MATLAB | 7,077 | 154 | function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpt(data1,data2,movingwin,params,fscorr)
% Multi-taper time-frequency coherence,cross-spectrum and individual spectra
% continuous process and point process times
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpt(data1,data2,movingw... |
fb089f89470924868389e0c283a4d92a0422e26fc96589c2cb87b0648824d391 | MATLAB | 7,078 | 158 | %% Import and Process Data from Excel
% Define the file and sheet for each dataset
Wt_E8_fileName = 'Data_1.xlsx';
Wt_E8_sheetName = 'Wt_E8.5_data';
Gloid_hNMP_filename = 'Data_2.xlsx';
Gastruloid_sheetName = 'Gastruloid_D5_Data';
hNMP_sheetName = 'hNMP_Spatial_D3_Data';
% Read the full table from the specified shee... |
74464f4b8349385b0ead82c9574c249026ecdc4f468e5501f4e1dfb213b4286a | MATLAB | 7,080 | 175 | % Name: Robert Kim
% Date: 12-15-2023
% Email: robert.f.kim@gmail.com
% plot_cross_temporal.m
% Description: Render the 1x4 panel of cross-temporal decoding (TxT)
% matrices for the one-layer two-modality (instr2) RNNs. Reads the per-
% condition .mat files written by cross_temporal_across_models.m and adds
% epoch bou... |
c7fca325827924977464ab2713e28fa8a795f1704ae84efcd38c74fd3312e860 | MATLAB | 7,080 | 179 | %% Check whether contrasts are defined
% ------------------------------------------------------------------------
if ~isfield(DAT, 'contrasts') || isempty(DAT.contrasts)
% skip
disp('No contrasts specified. Skipping contrast estimation');
return
end
%% Specify which montage to add title to. This is ... |
4378422997f72b5a27929f631945202905cfc3e760b8cfdcb0e7fab61488e02b | MATLAB | 7,082 | 211 | function [flag, m2_tot, se_tot, M2, SE, Vc, Lnew] = Morphometricity_NRandEffects(y, X, K, alg, tol, max_iter, verbal)
% This function implements morphometricity for multiple kernels.
% It fits a linear mixed effects model using the restricted maximum likelihood (ReML) algorithm,
% and produces morphometricity estim... |
c10d2f0292c5a5f586b1af1f37023f91f269f43c03e75d1546af14030f292e98 | MATLAB | 7,093 | 211 | %% Summary
[G,X] = grid_graph(6,5);
K5 = clique_graph(5);
[is_planar ksubgraph EI]= boyer_myrvold_planarity_test(G);
X = chrobak_payne_straight_line_drawing(G);
test_planar_graph(G);
K = kuratowski_subgraph(K5); % K5 has a Kuratowski subgraph
A = make_maximal_planar(G);
A = make_connected(G);
A = make_biconnected_plana... |
dd6a89d2baedcad451420035b398563e80221e2ea82c040f5fbac2a1deb92f07 | MATLAB | 7,097 | 152 | function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampt(data1,data2,movingwin,params,fscorr)
% Multi-taper time-frequency coherence - two point processes given as times
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampt(data1,data2,movingwin,params,fscorr)
% Input:
% Note units have to b... |
7f69631f74b1cea7a43de46997ba81573c7c848b56e80de3dbacbf093244be14 | MATLAB | 7,101 | 207 | % Check and set up paths to toolboxes
%
% Example of what you will need on your matlab path:
% -----------------------------------------------------------------------
% cd('/Users/tor/Documents/code_repositories/spm12')
% addpath(pwd);
%
% cd('/Users/tor/Documents/code_repositories/CanlabCore')
% g = genpath(pwd); add... |
8b5fbb94cbec4084f6599a0ca43c573bb5534e47c9efc643e632e7388a5e15e6 | MATLAB | 7,104 | 159 | % std_loadalleeg() - constructs an ALLEEG structure, given the paths and file names
% of all the EEG datasets that will be loaded into the ALLEEG
% structure. The EEG datasets may be loaded without their EEG.data
% (see the pop_editoptions() function), so many... |
605ae13493f592ab536176602652c9f3cdb4e3e502ed1bb0ed9fa1f2ac0cf046 | MATLAB | 7,109 | 165 | % demo file for applying the NoRMCorre motion correction algorithm on
% 1-photon widefield imaging data
% Example files can be obtained through the miniscope project page
% www.miniscope.org
clear;
gcp;
%% read data and convert to double
name = '/Users/epnevmatikakis/Documents/Ca_datasets/Miniscope/msCam13.av... |
02b34f23fc562b312d688433d2ca7d9baee03e582645495664c1a299cc3d4ae5 | MATLAB | 7,111 | 177 | function [rho,out]=surr_find_rho(y,tau,dim,varargin)
% rho=surr_find_rho(y,tau,dim)
% inputs - y, time series
% - tau, time lag for phase space reconstruction
% - dim, embedding dimension for phase space reconstruction
% inputs - rhoL, optional lower search bound. Default 0.1.
% - rhoH, option... |
bc1c493cfce8df3d7da305ad043762c9d1cf1a7c6f06774aabe9e34fc44fdb06 | MATLAB | 7,117 | 241 | % [kcMax,A0,kcGM,d0,d] = getDcorr(im,r,Ng,figID)
% ---------------------------------------
%
% Estimate the image cut-off frequency based on decorrelation analysis
%
% Inputs:
% im 2D image to be analyzed
% r Fourier space sampling of the analysis (default: r = linspace(0,1,50)
% Ng Number of hi... |
49ee22b0996c0af4dc0c49fcea755457b5d90c30000a33d92c9b79742fc5a2d4 | MATLAB | 7,124 | 175 | function img = dicm_img(s, xpose)
% Read image of a dicom file.
%
% img = DICM_IMG(metaStructOrFilename, xpose);
%
% The mandatory first input is the dicom file name, or the struct returned by
% dicm_hdr. The output keeps the data type in dicom file.
%
% The second input is for special purpose. When it is pr... |
9be870a428f4e48a4f48544ed784af3d4958fc697d7723e0c68f2c98f6dfb708 | MATLAB | 7,124 | 221 | function CFA_MakeRes_Clustercorrected(C05,C05P,C05N,PmapDir,THRESHOLD,VQ,Voxdir2out05)
[VP DP] = Dynamic_read_dir_NIFTI(PmapDir);
[pth nam ext] = fileparts(PmapDir);
THR1P = find(DP>1-THRESHOLD);
THR1N = find(DP<THRESHOLD&DP>0);
THR1 = zeros(size(DP));
THR1_P = zeros(size(DP));
THR1_N = zeros(size(DP));
THR1(THR1P) =... |
9929c3853d09c54d82336569efc34381a4fe2c78e47e0cf5fd921919ad629b11 | MATLAB | 7,128 | 210 | function [stampsel, varsel, trialsel, trialIDsel, condsel, plotwin,...
neusel, dosave, varNames] = ...
prepBehResp(handles, ttlabel, mainfig_pos)
notes = '';
dosave = 0;
neusel = [];
% set up primary behavior parameter for analysis (eg. motion vs. stationary)
stampsel = ''; % select the prim... |
240a88e5fca0120cf71d830fc8783b219d6d8eb050ece9d13c5408736b5297d5 | MATLAB | 7,131 | 180 | % pop_fileio() - import data files into EEGLAB using FileIO
%
% Usage:
% >> OUTEEG = pop_fileio; % pop up window
% >> OUTEEG = pop_fileio( filename );
%
% Inputs:
% filename - [string] file name
%
% Optional inputs:
% 'channels' - [integer array] list of channel indices
% 'samples' - [min max] sample po... |
705f5df100ed11f4967b709be5b25c2a65dd73fa9cc2cb324c943353e40fc5a8 | MATLAB | 7,131 | 210 | function report = LaBGAScore_prov_protect_reflogs(githubrootdir, archivedir)
%
%
% *USAGE*
%
% Archives the git reflog of every repository cloned under githubrootdir,
% and reports whether each one is protected against reflog expiry.
%
% The reflog is what lets LaBGAScore_prov_resolve_retrospective work out
% which com... |
d113fa1b7065c8267888e45b02180ed6f7d575d61119d50794b329c37e189997 | MATLAB | 7,136 | 258 | function S = dispstick(D, a, n,sch,type)
if length(size(sch)) == 3,
for k = 1:size(sch,3),
[U S] = eigs(sch(:,:,k));
scheme(:,k) = U(:,1) *sqrt(S(1,1));
end;
elseif size(sch,1) == 2,
n = [1 0 0]';
scheme = [sqrt(sch(1,:)) ; sqrt(sch(2,:)) ; sch(2,:)*0];
else
scheme = sch;
end;
if ... |
3bea94315e53420d5a1b6553f10c2f4d8227d182848fe59b32d044466dc087a9 | MATLAB | 7,142 | 160 | function p_NBS = CBIG_ASDf_FCDiffInFactorGroups_wrapper(outputDir, cluster)
% p_NBS = CBIG_ASDf_FCDiffInFactorGroups_wrapper(outputDir, cluster)
%
% Wrapper function to compare FC difference between all ASD and control subjects,
% as well as between ASD and control subjects within each factor group on
% ABIDE-I sample... |
1367239952effe890e5b99218e79300e7fe9fcc42867cf6b058c01c35d948fda | MATLAB | 7,146 | 206 | % biosig2eeglab() - convert BIOSIG structue to EEGLAB structure
%
% Usage:
% >> OUTEEG = pop_biosig2eeglab(hdr, data, interval);
%
% Inputs:
% hdr - BIOSIG header
% data - BIOSIG data array
%
% Optional input:
% interval - BIOSIG does not remove event which are outside of
% the data range when i... |
ec787d4d51749a3fb4dca9578c83f8a1013b646c1d00e71a8ff08fcb031579ed | MATLAB | 7,146 | 200 | function aggregatedResults = computeTrackingMetrics(aggregatedTracks, outputFolder, options)
% COMPUTETRACKINGMETRICS Run distance and speed analysis on a compiled
% tracking table and write one results file per top-level group.
%
% Takes the raw coordinate table produced by collectTrackingData (or
% filtered by filter... |
a6894e417253f30a0628b5fb33cf09903978f29713ea06d7cd868e4300d7d162 | MATLAB | 7,147 | 178 | % eeg_insertbound() - insert boundary event in an EEG event structure.
%
% Usage:
% >> [eventout indnew] = eeg_insertbound( eventin, pnts, ...
% abslatency, duration);
% Required Inputs:
% eventin - EEGLAB event structure (EEG.event)
% pnts - data points... |
134c22658de39df62e2ef3122b043ad06a8c56b94d947f202c99b00dd2dcf618 | MATLAB | 7,150 | 154 | function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpb(data1,data2,movingwin,params,fscorr)
% Multi-taper time-frequency coherence,cross-spectrum and individual spectra
% continuous process and binned point process
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpb(data1,data2,m... |
10b98415435b3921a1636e3f6718743067206dd440e0cd8f1a823fa3bb7f5671 | MATLAB | 7,154 | 262 | % compdsp() - Display standard info figures for a data decomposition
% Creates four figure windows showing: Component amplitudes,
% scalp maps, activations and activation spectra.
% Usage:
% >> compdsp(data,weights,locfile,[srate],[title],[compnums],[amps],[act]);
%
% Inputs:
% data =... |
cc587dadcea7c863cdd3b02f30e21220193bf6a85b05a51d66d74bb1d02b6195 | MATLAB | 7,161 | 233 | function [t,x,y,vx,vy,ax,ay] = trajectory_kalman_filter(posx,posy,post,order,Q,R)
%
% Kalman filter for obtaining an approximate Bayesian MAP estimate to the rat's
% trajectory from raw video tracker data.
%
% The trajectory model is the set of Taylor series expansions:
%
% x(t) = x(a) + x'(a)*(t-a) + 1/2 * x''(a)... |
6a2b72b0fc93f98be1b403d7e31ab93521e35ba1c1af0b3aa18dd91bd48ffd7c | MATLAB | 7,169 | 172 | % demo file for applying the NoRMCorre motion correction algorithm on
% 1-photon widefield imaging data
% Example file is provided from the miniscope project page
% www.miniscope.org
clear;
gcp;
%% download data and convert to single precision
name = 'msCam13.avi';
if ~exist(name,'file') % download file if it doesn'... |
fc749e47ce248ee10e80ed6cb22e5d2778def41a398355c1d71b127fc563abf6 | MATLAB | 7,172 | 209 | %% SC-POR model: load data
clear
close all
clc
addpath('datasets')
addpath(genpath('functions'))
original_file_name = 'SouthWhite0.6_light0.6_120H50W0.8F0.5_w150h90f3000_p0_rat_run_20Hz_1.2x1.2m_1800s.mat';
data_file_name = 'SouthWhite0.6_light0.6_120H50W0.8F0.5_w150h90f3000_p0_1.2x1.2m_1800s_SC.mat'; % load SC pre-p... |
8a43a5b2109b745af872ced5ba68514c4e569e76a21475b6001998dfaba7b7e5 | MATLAB | 7,176 | 251 | function ea_crop_nii(varargin)
% This function crops bounding-box of niftis to non-zeros or non-nan values.
% usage: ea_crop_nii(filename, [prefix (default: overwrite), threshstring -
% can be 'nn' for non-Nan or 'nz' for non-zero (default), interp, rim]).
% _____________________________________________________________... |
78bea9dd5e3a6356d0a74a1f046d8cce9bc4f17dab2004af9df78e96827d0111 | MATLAB | 7,179 | 211 |
function [ wavAvg, lfpAvg ] = bz_eventWavelet (lfp, events, varargin)
% [ wavAvg, lfpAvg ] = bz_eventWavelet (lfp, events, varargin)
% Calculates event-triggered (i.e. SWRs) wavelet spectrogram
% INPUT
% lfp a buzcode structure with fields lfp.data (only 1 channel)
% ... |
ef0fe08ea92c4570ea4a7599d03fd0a8f850a6e54d90854a8b8f129ff0048544 | MATLAB | 7,179 | 176 | function [isolationDist, Lratio, silhouetteScore, histogram_mahalUnit_counts, histogram_mahalUnit_edges, ...
histogram_mahalNoise_counts, histogram_mahalNoise_edges] = getDistanceMetrics(pc_features, ...
pc_feature_ind, thisUnit, numberSpikes, spikesIdx, allSpikesIdx, param)
% ------
% Inputs
% ------
% pc_feat... |
265015937fda485b324c5d872c7f0c8676b983e1091521eff4a3749e069d491a | MATLAB | 7,183 | 189 |
function headers = checkPLXData(data, headers)
% checkPLXData - Check that PLX data and update/create PLX file headers.
%
% headers = checkPLXData(data, headers)
%
% checkPLXData is designed as a companion function to writePLXFile and
% readPLXHeaders. It takes spiking data that is destined for a PLX file,
% a... |
4387f0047a4dfed4486c33a0416b271c67dfd4b980ee5ff943cf04977e01554e | MATLAB | 7,188 | 197 | % show_events() - Display events in epochs. Events selected by
% make_timewarp() function can be optionally highlighted.
% Each epoch is visualized as a row in the output image with
% events marked by colored rectangles.
%
% Usage:
% >> im = show_events(EEG, 'key1'... |
3b56a9fda4e06945850753c268cf14dde3f069247f5376dbb2d0071598a8a303 | MATLAB | 7,189 | 175 | % pop_loadstudy() - load an existing EEGLAB STUDY set of EEG datasets plus
% its corresponding ALLEEG structure. Calls std_loadalleeg().
% Usage:
% >> [STUDY ALLEEG] = pop_loadstudy; % pop up a window to collect filename
% >> [STUDY ALLEEG] = pop_loadstudy( 'key', 'val', ...); % no pop-up
%
% Opt... |
c7a653ecf5702f4c85ecb35838bb46f19054759ca6fdcb4c9ecc41eec9fada1a | MATLAB | 7,196 | 130 | function varargout = ea_normalize_ants(options)
% This is a function that normalizes both a copy of transversal and coronal
% images into MNI-space. The goal was to make the procedure both robust and
% automatic, but still, it must be said that normalization results should
% be taken with much care because all reconstr... |
212eb7d3ba06e9bc2442eb15f6cd9f6d5c077b0804ab78880d2ea167dd8c687b | MATLAB | 7,202 | 206 | function out = run_subject_glm(snirf_path, nirs_model, jacobians, opts)
%RUN_SUBJECT_GLM Run preprocessing, channel-level GLM fitting, and source reconstruction for one SNIRF recording.
%
% out = fnirspower.pipeline.run_subject_glm( ...
% snirf_path, nirs_model, jacobians, ...)
%
% Description
% --------... |
54cec7fab72ecd96cff288e17ced61418580e33b7c672548676a8fdab4dfec3e | MATLAB | 7,207 | 193 | % Name: Robert Kim
% Date: 11-20-2023
% Email: robert.f.kim@gmail.com
% one_modality_two_layer_lesion_across_models.m
% Description: Synaptic-lesion sweep on the two-layer one-modality (instr)
% RNNs. For each (layer-pair, lesion-type) combination, scale the chosen
% submatrix of the recurrent weights and re-evaluate a... |
86aaf4d6d71983df38bc2786f833654de90c72799123d627185839611ccbe1f2 | MATLAB | 7,209 | 264 | function Intan2PLX(parameterSets,tet,varargin)
% function converts an Intan file to a plx file that can be read by Offline
% Sorter etc..http://www.plexon.com/software-downloads
%
% calls read_intan_data available at http://www.intantech.com/downloads.html
% requires spike detection software package from http... |
751f1f434683a7ce56e0232168ed6106aaf99de38031ed91193ed10c154f9971 | MATLAB | 7,215 | 240 | function delay = PETHTransition(psth,timeBins,varargin)
%PETHTransition - Find a transition point in a peri-event time histogram.
%
% Find a transition point in a peri-stimulus time histogram using the maximum
% likelihood or mean square error algorithm of Friedman and Priebe (1998), or
% piecewise linear fit.
... |
16bd348ca5f8dccbed2655d75707bdb0709ba200347a95f5ef060775f3bbf52d | MATLAB | 7,221 | 219 | function fig =...
plotClusterReactivity(PSTH,trig,sweeps,timeLapse,binSz,IDe,expName,stims,IDs)
%PLOTCLUSTERREACTIVITY gets the individual PSTH from the getPSTH function
%and plots it for each cluster. It also plots the population PSTH on the
%bottom of the figure and draws a line for the beguinning and end of the
... |
d8bec342bf86c9c17353ae6ee8ab15a278520dfae102f7d96b217d16c0ffd08b | MATLAB | 7,225 | 171 | function res = myPLS_analysis(input,pls_opts)
% This is the main function computing the PLS analysis
%
% Inputs:
% - input : struct containing input data for the analysis
% - .brain_data : N x M matrix, N is #subjects, M is #imaging variables
% - .behav_data : N x B matrix, B is #behavior/design variable... |
8f9ce555b45533c5102531e146b4ce4d286fe4d38520605eea9230800eae82d0 | MATLAB | 7,228 | 167 | function [Z, discretized_Z] = CBIG_ASDf_FC2doc_forInference(corr_mat, reg_CN_mean,...
reg_CN_std, regressors, dx_info, cohort_label, output_dir, output_name)
% [Z, discretized_Z] = CBIG_ASDf_FC2doc_forInference(corr_mat, reg_CN_mean,
% reg_CN_std, regressors, dx_info, cohort_label, output_dir, output_name)
%
% Conv... |
232d90896faf2e58594385744959ae0e904b9ccd573f7addce7e85db86de868a | MATLAB | 7,231 | 154 | function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpt(data1,data2,movingwin,params,fscorr)
% Multi-taper time-frequency coherence,cross-spectrum and individual spectra
% continuous process and point process times
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpt(data1,data2,m... |
e0727dd7c748e0f19a6cff888c97ed40cd58269cc0c62d83d6ec73a4adb5358a | MATLAB | 7,236 | 164 | function [ S_all, S_same, S_other, W_same, B_all, B_same, B_other] = segregation_by_type_prcont(M, Ci, Ti, varargin)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% segregation_by_type_prcont.m
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION:
% ... |
c65b1ca95596f82458573abc3e030605775f068dbd6fc9e90e21f1365694536e | MATLAB | 7,237 | 210 | % This is a standard data format class for in vivo lfp data at the CMB
classdef LFP
properties
signal % Raw LFP signal
ts % Timestamps of LFP signals=
fs % Sampling rate
channel_name % Name of the channel
user_def % ... |
4a825d8fd3fa90fb1d955f6ec9635142959d09f8782bc03bd2f5cedcd09972a5 | MATLAB | 7,238 | 163 | % pop_subcomp() - remove specified components from an EEG dataset.
% and subtract their activities from the data. Else,
% remove components already marked for rejection. When used
% with the options 'keepcomp', the function will retain [1]
% or reject[0] t... |
c8662820c91ccde8daef55beb526aeae12bd6381b58393afa38d36b2aba716f8 | MATLAB | 7,239 | 202 | function ConvertKilosort2Neurosuite(basepath,basename,rez)
% Converts .kwik/kwx files from Klusta into klusters-compatible
% fet,res,clu,spk files. Works on a single shank of a recording, assumes a
% 16bit .dat and an .xml file is present in "basepath" (home folder) and
% that they are named basename.dat and base... |
facebeccecf25ba3d7a717c58ee6a5ada0d8d7e6c6d772924c25cb658534a1ae | MATLAB | 7,243 | 197 |
function [ csd, lfpAvg ] = bz_eventCSD_lv_by_speed(lfp, events, animal, group, filter, csd_lyr_borders, region, varargin)
% [ CSD ] = bz_eventCSD (lfp, events, varargin)
% Calculates event-triggered (i.e. SWRs) CSD map from a linear array of LFPs
% INPUT
% lfp a buzcode structure with fields lfp.data,
... |
3d9fc1f99dd2578345b0c1ca36da3a9d6116e26438da68d246bb797522cd7a48 | MATLAB | 7,245 | 194 | function SANDIinput = make_direction_average_forGUI(SANDIinput, fig_ax)
% Calculate the direction-average of the data
%
% Author:
% Dr. Marco Palombo
% Cardiff University Brain Research Imaging Centre (CUBRIC)
% Cardiff University, UK
% 8th December 2021
% Email: palombom@cardiff.ac.uk
data_filename = SANDIinput.data... |
242eb102cfcd1c1b17791b2ce3827eef5c6c36cc4368b950231d7ab2976b66b2 | MATLAB | 7,249 | 152 | function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampt(data1,data2,movingwin,params,fscorr)
% Multi-taper time-frequency coherence - two point processes given as times
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampt(data1,data2,movingwin,params,fscorr)
% Input:
% Note units ha... |
08fbf2dab700aee39aa200be0209b9a7d51929246e96dc807882f896169174ae | MATLAB | 7,251 | 176 | function [dz,vdz,Adz]=two_group_test_coherence(J1c1,J2c1,J1c2,J2c2,p,plt,f)
% function [dz,vdz,Adz]=two_group_test_coherence(J1c1,J2c1,J1c2,J2c2,p)
% Test the null hypothesis (H0) that data sets J1c1,J2c1,J1c2,J2c2 in
% two conditions c1,c2 have equal population coherence
%
% Usage:
% [dz,vdz,Adz]=two_sample_test_cohe... |
92f10cbe111b48db836dd3b2c93197bf71a69689e5d743b8e24408a83dc3fc93 | MATLAB | 7,254 | 188 | %% Perform a voxel-wise t-test
%
% Edited/commented by Bogdan Petre on 9/14/2016, Tor Wager July 2018
%
% In this example we perform a second level analysis on first level
% statistical parametric maps. Specifically we use a t-test to obtain an
% ordinary least squares estimate for the group level parameter.
%
% Inci... |
0cff52be8d4a4fb8f4dac14209d3e40fdc5e176dffef53f424b3fe04a06b1368 | MATLAB | 7,265 | 222 | %%*******************************************************************
%% Read in a problem in SeDuMi format.
%%
%% [blk,A,C,b,perm] = read_sedumi(fname,b,c,K)
%%
%% Input: fname.mat = name of the file containing SDP data in
%% SeDuMi format.
%%
%% Important note: Sedumi's notation for free variab... |
983ced6542a98d95426a17ab2cb365a7f1482c74e4ad5d2b6490a1128b8dd980 | MATLAB | 7,266 | 209 | %% V1-RSC model: load data
clear
close all
clc
addpath('datasets')
addpath(genpath('functions'))
original_file_name = 'SouthWhite0.6_light0.6_120H50W0.8F0.5_w150h90f3000_p0_rat_run_20Hz_1.2x1.2m_1800s.mat';
data_file_name = 'SouthWhite0.6_light0.6_120H50W0.8F0.5_w150h90f3000_p0_1.2x1.2m_1800s_V1.mat'; % load V1 pre-p... |
7491b5f4838e185f58b0cdceb6074a24d5e19b8904e2cb18c6a6f183fcb9cc4e | MATLAB | 7,268 | 220 | function out = run_forward_model(opts)
%FNIRSPOWER.PIPELINE.RUN_FORWARD_MODEL
% Build a two-wavelength NIRFAST/NIRFASTer forward model.
%
% This function loads a tetrahedral head mesh and NIRx probe geometry,
% projects the optodes onto the head surface, constructs a NIRFAST mesh,
% computes wavelength-specific J... |
36c860c1336635a6ba14044f0a596370cc94f9f31bf149d9d9329ae237d6da2c | MATLAB | 7,269 | 205 | function [cutpos,cutvalue,facedata,elemid]=qmeshcut(elem,node,value,cutat,varargin)
%
% [cutpos,cutvalue,facedata,elemid]=qmeshcut(elem,node,value,cutat)
%
% fast tetrahedral mesh slicer
%
% author:Qianqian Fang, <fangq at nmr.mgh.harvard.edu>
%
% input:
% elem: integer array with dimensions of NE x 4, each row cont... |
e6d743a20298fd2ca8bb46c64b9b22d9b63df78211da6342f2e5d4b394053138 | MATLAB | 7,276 | 193 | function [results] = my_histplot(obj,draw_data,params,setylim)
%Presets for dodge parameter
if isempty(params.dodge)
if strcmp(params.geom,'bar') && draw_data.n_colors>1 %With 'bar' do we dodge by default if there are several colors
params.dodge=0.8;
else
params.dodge=0; %With all others we pu... |
edb46f6e89fedd3d9428f9c6c633c31038808157efb52e79adeab9a1695eb2ed | MATLAB | 7,277 | 170 | function [hObject, handles] = dan_segment_tool(hObject, handles)
% Controls the verious options for the plot segment tool
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
%% Mark arousal/bad segment etc.
if handles.segmentFunction == 1
[newSegTime, ~] = ginput(2);
newSegSample = newSegTime * handles.p... |
e1bb7a63c6fd7b496911385215a0cc351e379da0e53660fe4b8075908a40d85d | MATLAB | 7,281 | 224 | function [f_peak, thetaMod, rVal, acN, fullResults] = IntrinsicFrequency3(self, cel, print_to_screen, speed_thresh, varargin)
% Intrinsic frequency of a unit
%
% ARGUMENTS
%
% cel [tetrode index, cell index] in Session object root
%
% [print_to_screen] optional - 0 or 1 (0) plots analysis
... |
6728339925adb48ade1f8f7e8c6762b6a2ceba005d7f5637511b33d973bd79f6 | MATLAB | 7,285 | 201 | function varargout = variable( varargin )
%VARIABLE Declares a single CVX variable with optional matrix structure.
% VARIABLE x
% where x is a valid MATLAB variable nm, declares a scalar
% variable for the current cvx problem. A variable with that
% name is added to the problem, and a cvx object with that
% ... |
2025f98ff793b42452168d5bed77983ed29a17e1298f320ee64fa56765ac8f2f | MATLAB | 7,288 | 176 | function varargout = impexp_run_mrstruct2nifti(cmd, varargin)
% Template function to implement callbacks for an cfg_exbranch. The calling
% syntax is
% varargout = impexp_run_mrstruct2nifti(cmd, varargin)
% where cmd is one of
% 'run' - out = impexp_run_mrstruct2nifti('run', job)
% Run a job, and retu... |
2d59d1bd5478f4c561f97246140df0ca71596acbe9068237b6e5d276b9f58ff4 | MATLAB | 7,308 | 184 | function status = prairieView_Com(cmd_str, varargin)
% SYNTAX: status = prairieView_Com(cmd_str, varargin)
% prairieView_Com('zs')
% tells prairie view to acquire a z stack
%
% METHOD: Given a command or sequence of commands, sends them to prairie
% view over a TCP socket so they will be executed. Returns... |
247b4cf24320ea6a9d6255f4804cd73171e80640ad4bbef6c7881e6e1be2b1ff | MATLAB | 7,315 | 205 | function varargout = palm_moments(varargin)
% For a statistic that can be expressed as trace(A*W), for
% a sample size of n observations, this function returns the
% expected first three moments of the permutation distribution,
% without actually computing any permutation.
%
% [mu,sigsq,gamm1,gamm2] = palm_moments(G)
%... |
9f4c32c5784b4f3c35dbd474d744ae74a239a4d54dbc9ac15396728a94915fc8 | MATLAB | 7,316 | 221 | function [fs1, fs2, er] = comp_struct(s1,s2,n1,n2,p,tol)
% check two structures for differances - i.e. see if strucutre s1 == structure s2
% function [fs1, fs2, er] = comp_struct(s1,s2,n1,n2,p,tol)
%
% inputs 6 - 5 optional
% s1 structure one class structure
% s2 structure ... |
08a8812185af482b7d01daf7ea3a9ca07f27a40698c6b97ef08a56e0401875ee | MATLAB | 7,319 | 146 | % std_erpimageplot() - Commandline function to plot cluster ERPimage or channel erpimage.
%
% Usage:
% >> [STUDY] = std_erpimageplot(STUDY, ALLEEG, key1, val1, key2, val2);
% >> [STUDY data times freqs pgroup pcond pinter] = ...
% std_erpimageplot(STUDY, ALLEEG ...);
% Inputs:
% STUDY - EEGLAB... |
30eae66d0d5b923b007a117ed8d5f095da66ff059c3ce466b053d4130ee0934b | MATLAB | 7,320 | 173 | function ea_thomas(inputImage, imageType)
% Wrapper function to run THOMAS segmentation
arguments
inputImage {mustBeFile}
imageType {mustBeMember(imageType, ["t1", 'wmn', 'fgatir'])} = "t1"
end
% Check docker image
dockerImage = 'anagrammarian/sthomas:latest';
ea_checkDocker(dockerImage);
% Prepare parameter... |
0e0b49c3f264a3d260d56e8220cedc66d5447843dde61d0386ff8ff8792f07b2 | MATLAB | 7,325 | 148 | % Freely Moving Animal (FMA) Toolbox
%
% INTRODUCTION
%
% The purpose of the Freely Moving Animal (FMA) Toolbox is to help analyze
% electrophysiological and behavioral data recorded from freely moving animals.
%
% These data typically include broadband brain signals (e.g. local field potentials),
% spike ... |
3e671f4e6eb62a9129e1289ddfb1b6407b65d5d54f329fb88ebc6f32c2761ae1 | MATLAB | 7,327 | 188 | % Name: Robert Kim
% Date: 05-13-2023
% Email: robert.f.kim@gmail.com
% one_modality_one_layer_lesion_across_models.m
% Description: Synaptic-lesion sweep on the one-layer one-modality (instr) RNNs.
% For each of the 16 connection types between {Exc, Inh} populations split by
% task selectivity {anti, pro}, halve the c... |
e9a4ed2a76c246ba892acc740d6769d5cb5d09be424e28ada6047db1b73b7e5c | MATLAB | 7,338 | 189 | function Obj = SOFAload(fn,varargin)
%SOFALOAD
% Obj = SOFAload(FN) reads the SOFA object OBJ with all data from
% a SOFA file FN.
%
% FN can point to a remote file (containing '://') or to a local file:
% Remote file: FN will be downloaded to a temporary directory and
% loaded.
% Local f... |
32e7d30a052cd05533416c4819ac525620c38f67e8e806cab8e53f72d532c178 | MATLAB | 7,345 | 160 | function [mean_V1_perc, mean_CS_hd] = CBIG_hMRF_compute_architectonic_metrics(label, mesh_type, V1_anchors,...
CS_anchors, num_cluster_per_hemi, debug_out_dir)
% [mean_V1_perc, mean_CS_hd] = CBIG_hMRF_compute_architectonic_metrics(label, mesh_type, V1_anchors, CS_anchors,...
% num_cluster_per_hemi, debug_out_dir)
... |
9039520f0547d076a2005ddf2e92af51dd52ce80bd95378bec540513f848f56b | MATLAB | 7,355 | 223 | function NSx = saveChNSx(varargin)
% saveNSx
%
% Saves a given continuous NSx file and saves a subset of the channels in
% the given file into a new NSx file. Ths NSx file has to be opened with
% openNSx version 5.1.1.0 or later.
%
% All input arguments are optional. Input arguments can be in any order.
%
... |
9e2bd31132283db7ac5c20a494d5539d4e0d571e89d9487618afd1b0d3cf12db | MATLAB | 7,364 | 249 |
% Version 26/06/2026
% Authors: Alessandro Petrini and Davide Pierangeli
% -------------------------------------------------------------------------
% This script is provided as a reference implementation of the experimental
% procedure described in the manuscript. It documents the acquisition logic
% and computation... |
d4ba23cebe6df14aff4d86b20e35bece303ed3c4a422000feaded357599ccd1f | MATLAB | 7,376 | 209 | function bz_ConcatenatedTimes(basepath,sortFiles)
% bz_ConcatenatedTimes(basepath)
% This function generates the events.mat file that saves all the merge
% information. Useful if you dind't do this when you merged the dats.
%
% USAGE
%
% bz_ConcatenateDats(basepath,sortFiles)
%
% INPUTS
%
% basepath ... |
fa51a4c482ca797a881b8e4dc158b5c48d4b964658b6aff22effe2983181ba78 | MATLAB | 7,378 | 210 | function y=showStack(stk,ip1,ip2,ip3,ip4,ip5,ip6,ip7,ip8,ip9,ip10,ip11,ip12,ip13,ip14)
% Usage ... showStack(stk,options)
%
% Options: 'axis','overlay','projscale'
% Window Functions: g=goto, m=mark, p=proj_square, q=quit
vars={'axis','overlay','projscale'};
% parse settings
for mm=1:length(vars), eval(sprin... |
43ea94e9c64e9ff307faada552fb9e51005766ef328f3b3197d76ec0b42ca582 | MATLAB | 7,380 | 210 | function y=showStack2(stk,ip1,ip2,ip3,ip4,ip5,ip6,ip7,ip8,ip9,ip10,ip11,ip12,ip13,ip14)
% Usage ... showStack2(stk,options)
%
% Options: 'axis','overlay','projscale'
% Window Functions: g=goto, m=mark, p=proj_square, q=quit
vars={'axis','overlay','projscale'};
% parse settings
for mm=1:length(vars), eval(spr... |
5352c9b67edbbc1b0743e3b869de84d13a0af41fed1e63d4465cedc252381796 | MATLAB | 7,390 | 194 | % dftfilt3() - discrete complex wavelet filters
%
% Usage:
% >> [wavelet,cycles,freqresol,timeresol] = dftfilt3( freqs, cycles, srate, varargin)
%
% Inputs:
% freqs - vector of frequencies of interest.
% cycles - cycles array. If cycles=0, then the Hanning tapered Short-term FFT is used.
% If o... |
95cca5452ded423793b46f79de81fb14b67de22f24c49f649329b762d7249cf4 | MATLAB | 7,391 | 216 | function [ RCMSE, CMSE, MSE, MSFE, GMSE ] = ent_ms_plus( x, tau, m, r )
% [ RCMSE, CMSE, MSE, MSFE ] = RCMS_Ent( x, tau, m, r )
% inputs - x, single column time seres
% - tau, greatest scale factor
% - m, length of vectors to be compared
% - R, radius for accepting matches (as a proportion of the
%... |
470d3937647797377741e414720b259dd60dce81b12948f791d5cfb6e9f4569a | MATLAB | 7,397 | 189 | % pop_importpres() - append Presentation event file information into an EEGLAB dataset
% The Presentation stimulus presentation program outputs an ascii
% log file. This function merges existing EEG dataset events with
% additional field information (fields) abou... |
4a6666c53b3f7ac35548e488dedadb96f4671627852bb22b0aa10984d4b45e3f | MATLAB | 7,410 | 184 | function [cortexH,cortex] = ea_showcortex(varargin)
% This function shows a cortical reconstruction in the 3D-Scene viewer. It
% reads in cortex.mat found in the eAuto_root/templates/cortex folder, or
% in the patientdirectory on button press (Cortical Reconstruction
% Visualization) in the Lead-Anatomy scene. To view ... |
1ac060de143507c5bb8c380417f360268f41724f6c2ce0383520cf728e3cfac7 | MATLAB | 7,412 | 200 | function [dacqInfo] = dacq_set(fname)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% COPY IN FILE %%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Pulls relevant information out of the .set file
%fname = fullfile(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.