sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b6247373bd96db1ec1c7783b0614e5a18291b8be73b711adf1b5f7fe7e5113b2
MATLAB
7,063
217
function [x,w,ww]=nt_star2(x,thresh,closest,w) % [y,w,ww]=nt_star2(x,thresh,closest,w) - sensor noise suppression % % y: denoised data % w: 1 for parts used to calculate covariance (time*1) % ww: 0 for parts that needed fixing, 1 elsewhere (time*chans) % % x: data to denoise (time*chans or time*chans*trials) % th...
f32670cf5ed044ffc78cf735e2001c662a44d86052981c11f9cb257a63b9cc23
MATLAB
7,081
256
function [A,B,R]=nt_cca(x,y,shifts,C,m,thresh,demeanflag) %[A,B,R]=nt_cca(x,y,shifts,C,m,thresh,demeanflag) - canonical correlation % % A, B: transform matrices % R: r scores % % x,y: column matrices % shifts: positive lag means y delayed relative to x % C: covariance matrix of [x, y] % m: number of columns of x ...
39c2828eefb76fbd390f1ee6052f1c68d21cf97cea21b3f6a956811860625a3c
MATLAB
7,086
152
function CBIG_AuthorTopic_VisualizeComponentsOnBrainSurface(paramsPath, ... outputDir, discretizationRes, minThresh, maxThresh, ... colorscaleName, doRemoveSmallClusters) % CBIG_AuthorTopic_VisualizeComponentsOnBrainSurface(paramsPath, ... % outputDir, discretizationRes, minThresh, maxThresh, ... % colorsca...
13cceca458e4dbf3aa17c70814129642738ba2d81414da7bcbdc8f9de1d63a57
MATLAB
7,128
225
function [img_mask_f, results] = analyse_masks_SAP(img, biom_folder, fname, biom_set_folder, biom, repeat_name, normalise_imgs, normalise_brightness) %% threshold images and create masks close_figs = 0; %% Settings if biom_set_folder == 'B1' pixel_size = 0.5682; % 581.82/1024 elseif biom_set_folder == 'B2' pi...
3e0cc95841bad8dadfb86583ce44a52870b70f64b2820100986be218cf07e1a0
MATLAB
7,133
255
function u = units(varargin) % % SAK : Copied from somebody in the MatLab file exchange, but heavily % edited. % % % The units.m function returns a struct containing the SI values of % many common units. The example below demonstrates how to use % this struct to cleanly and effeciently perform matlab calc...
ef934bf4ad4728f9ee54eb10037f9bb5049219e994390674e8529aa260d29bf0
MATLAB
7,176
164
function aaa___ifversion___test(varargin) %This is not a true test suite, but it should confirm the function runs without errors. if nargin==0,RunTestHeadless=false;else,RunTestHeadless=true;end % suppress v6.5 warning v=version;v(strfind(v,'.'):end)='';v=str2double(v); if v<=7 warning off MATLAB:m_warning_end_wi...
eeeb031b62dafc4bbf849fa802bd408a59deb9333f5928e6c30c68ccd4382ea1
MATLAB
7,203
180
fname = 2711-p1-multifile-mHaT2_7 %% Add path restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/development/ addpath /network/lustre/iss01/charpier/anal...
5f43477c33ed394e5abeb01831b4c378b19834f1a0d7c2cbd586725292c0aa25
MATLAB
7,205
151
classdef CBIG_AuthorTopic_unit_test < matlab.unittest.TestCase % % Wrapper function to unit-test a coordinate-based meta-analysis with the author-topic model. % The inference was performed with the following hard-coded hyperparameters % - K = 2:3 - number of cognitive components to be estimated is 2 and 3 % - alpha =...
8d38ff682080d3799234def147060b8589cd7899e32da375cb846413da6c41dd
MATLAB
7,206
213
function TrialPETHZScore( Fs, Ts, Pre, Post, EventTS,Ch490,Ch405,prefix, varargin) %Original code by David J. Barker; Modified for use with PhotometryGUI by %Carissa A. Bruno for the Barker Lab at Rutgers University. %Trial Analysis: This code will take inputs and create Photometry %Raster-PETH. The Raster PETH i...
e0e6fc4aa04bfa31e85a8f64631b5a2252564ed1e3e23af4b1db3560cdaed36f
MATLAB
7,209
161
function Figure2 restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/git/fieldtrip addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/shared/ addp...
42acc055443e42bf072f7214aa17bff29cb68fa895be0c6639b94e8ba7b5238a
MATLAB
7,219
183
function Error_Bootstrap_Interval_Prediction() % Load true observed data and predicted data load('true.mat'); % True observed data: T_test load('IVMD_CNN_SVM.mat'); % Model predictions: IVMD_CNN_SVM_TSIM2 % Call plotting and metrics function plot_confidence_intervals_with_metrics(T_...
503847c10698a3f9a48dab3f85d4fa93a69260c4b4ddfad426a9b8d64d4a787c
MATLAB
7,254
215
classdef TDTUDP < handle %TDTUDP TDT UDP class. % obj = TDTUDP(TDT_UDP_HOSTNAME, TYPE) connects to RZ specified by % TDT_UDP_HOSTNAME, which can be either the RZ's IP address or % NetBIOS name % TYPE (optional) specifies the data type to expect. Default is % 'int32'. % % ob...
00772ff3aa34054bdf17bd8934d89c8d1fd2a9c3a35fa847ce952e72228198be
MATLAB
7,271
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,plt,f) % 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_tes...
58e6ef880f76e050cabeccb3ede8fa486e766ec0486371ef76b68eac69e29a32
MATLAB
7,277
235
function [img_mask_f, results] = analyse_masks(img, results_folder, fname, biom, repeat_name, normalise_imgs, normalise_brightness) %% threshold images and create masks close_figs = 0; %% Settings pixel_size = 0.5682; % 581.82/1024 color_map = [1,0,0]; transparency = 0.2; % biom folder repeat_name = strjoin(repeat_n...
d78519e08e2f315ac95ed981cefdd83810980fb40209af610e738b222b493164
MATLAB
7,289
212
function varargout=wtc(x,y,varargin) %% Wavelet coherence % % USAGE: [Rsq,period,scale,coi,sig95]=wtc(x,y,[,settings]) % % % Settings: Pad: pad the time series with zeros? % . Dj: Octaves per scale (default: '1/12') % . S0: Minimum scale % . J1: Total number of scales % . Mother: Mother ...
284c103228f3ab3c268907bc51a71d74a8eb7de79b73f0264498f7593f2b6482
MATLAB
7,298
135
function writeSpykingCircusDeadFile(cfg, MuseStruct) % WRITESPYKINGCIRCUSDEADFILE crawls and searches through data % directories and markerfiles for artifact definitions for SpykingCircus. % % use as % writeSpykingCircusDeadFile(cfg, MuseStruct) % % The input structure can be read by readMuseMarkers.m, and edited be...
1a03ed0d0908edfd3002b6378e076dc2cace88936551f7691c491a71439bdc85
MATLAB
7,313
186
function tab2output = compute_features(datafile, outdir, f_range, f_range_fooof) % compute_hurst - compute the Hurst exponent % % INPUT % datafile = full filename to a .mat file. % outdir = directory to save output csv files % % OUTPUT % tab2output = a table of H values and other parameters % % Example usage:...
0b0bf9e3d695191228ff026480aa3535026ce2baf63838e2f48c39866be9a03d
MATLAB
7,319
229
% Online calculation of (weighted) sample mean and variance % % ss=SampleStatistics; xx=randn(100,1); for ii=1:numel(xx); ss.add(xx(ii)); end; % ss.sampleMean() - mean(xx), ss.sampleVariance() - var(xx) % % ss=SampleStatistics; xx=randn(100,1); ww=randn(size(xx)); for ii=1:numel(xx); ss.add(xx(ii),ww(ii)); ...
84100fcc8d67dc243ce4c54bc00da2e415e51321e0ad475a2ad50f27885f0312
MATLAB
7,351
271
function [p,data]=nt_read_data(fname,flag) %[p,data]=nt_read_data(fname,flag) - read data from file % % % fname: file to read % flag: specify how to deal with complex data % 0: walk through and select % 1: choose first of each [default] % 2: return all as struct % % VERBOSE=1; if nargin < 1 ; ...
bb2c180ad9cd83a8017fed27e15dd9839301b48e608fa8bcdb4df3ade92a1cf2
MATLAB
7,351
198
function Error_LSCV_B_interval_prediction() % Load true and predicted values load('true.mat'); % T_test (true values) load('IVMD_CNN_SVM.mat'); % IVMD_CNN_SVM_TSIM2 (predictions) % Print array lengths fprintf('Length of true_values: %d\n', length(T_test)); fprintf('Length of predictions:...
1b0fb2e9030f2c1b8bc461d9b84f203175fb53958e465c049c2e075745abe472
MATLAB
7,357
212
function [fileNameTSVGZ_blink,fileNameJSON_blink] = natview_eye_preprocess_blinks(fileNameTSVGZ,fileNameJSON,outputDir) %% PURPOSE: This script converts EyeLink EDF files into the BIDS format % % Raw eye tracking data contains column with NaN entries during % periods when participant is blinking...
d1ba18cfcff9e6d1c119c8a896234415bf95f14a45b58e625d1125089518d97f
MATLAB
7,363
280
function ctpath(CT0,varargin) % CTPATH(CT,{CMODEL},{MARKERSIZE},{OPTIONS}) % Plot the trajectory of a color table in a selected color space. % Create a datacursor to help inspection of the trajectory. % % CT is a Mx3 color table of any standard image class % The values in CT must be scaled appropriately for the ...
cb81956ead3952a414b368079111acf3580b5e3e4fa9dca438501adb6a1667b4
MATLAB
7,373
255
function results = run_gcmi_regression_tests() %RUN_GCMI_REGRESSION_TESTS Deterministic smoke tests for the MATLAB package. % % results = run_gcmi_regression_tests() executes a small set of regression % checks covering the public wrappers, helper fixes, and discrete-class % validation behavior. The function print...
9610d1e67e422fcf54143bafe300755ca7761cbe0f5a66e8e5c289fe5b06bf0d
MATLAB
7,390
132
function hspike_write_spykingcircus_cluster(ipatient) %% Analysis script for SLURM cluster % % (c) Stephen Whitmarsh, stephen.whitmarsh@gmail.com % %% Add path restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss0...
aa6a6eaa1603df064de263ea9276d69b3ec345959ee76a2be260338b75d495dc
MATLAB
7,390
196
function wpict = vectorscan(inpict,numlines,scanamp,varargin) % OUTPICT=VECTORSCAN(INPICT, NUMLINES, AMPLITUDE, {OPTIONAL PARAMS}) % Loosely emulates the appearance of a scan processor output on a % monochrome display with persistence. Vertical deflection and beam intensity % are modulated by input...
b17ab0c8b97d9cd93fcacab21afd7d371417064f152203c67e5278f830b480e9
MATLAB
7,396
187
function tab2output = compute_features_remove_channels(datafile, outdir, f_range, f_range_fooof) % compute_hurst - compute the Hurst exponent % % INPUT % datafile = full filename to a .mat file. % outdir = directory to save output csv files % % OUTPUT % tab2output = a table of H values and other parameters % ...
011668d8ea0c6492b4f8f656892773827402995ae7902f17c12b52ddb0cc5155
MATLAB
7,397
215
function varargout=wtcJA(x,y,varargin) %% JOACHIM OUTCOMMENTED stuff about significance!! %% Wavelet coherence % % USAGE: [Rsq,period,scale,coi,sig95]=wtc(x,y,[,settings]) % % % Settings: Pad: pad the time series with zeros? % . Dj: Octaves per scale (default: '1/12') % . S0: Minimum scale % . J...
84385e24a08116bdeaaafd5c04e3e302a948ba4d7c971452961d4d5e027be839
MATLAB
7,423
143
classdef NullModelAnalysisBatchRunner % Manages batch execution of null model analyses using NullModelAnalysisUnit properties GeneratorModel NullConnectomeGeneratorModel NumUnits (1,1) {mustBeInteger} HoldoutOptions HoldoutParameters % results holder FullDataCorr...
e52b5d1281d50c9fc6b861d60ab94e54bb60c4c239de7c219bd680b6fb507871
MATLAB
7,440
187
function celltype = classification_celltype(config, force, do_plot) % % Use as % celltype = classification_celltype(config, force, do_plot) % % force : whether to redo analyses or read previous save (true/false) % do_plot : optional (default = true), can be set to false to only compute % value with...
652d706e801031d25870c77e3bcc12ec910672a45a298473fea933e3f1413fdf
MATLAB
7,446
232
function plot_distributions_and_stats_with_cdf() % =============================== % 1. Load data % =============================== load('true.mat'); % T_test load('IVMD_CNN_SVM.mat'); % IVMD_CNN_SVM_TSIM2 % =============================== % 2. Error calcu...
d85cb10ab039291c4d253b02092ddc36c3e0421298fdca4ff2d859f807234864
MATLAB
7,447
232
function plot_distributions_and_stats_with_cdf() % =============================== % 1. Load data % =============================== load('true.mat'); % T_test load('IVMD_CNN_SVM.mat'); % IVMD_CNN_SVM_TSIM2 % =============================== % 2. Error calcu...
7653f4f09ad1a1b4a3f5bf5276977d416bd513e79596077eb1eaebad761b2ee6
MATLAB
7,450
241
function [z,s] = smooth1q(y,s,varargin) %SMOOTH1Q Quick & easy smoothing. % Z = SMOOTH1Q(Y,S) smoothes the data Y using a DCT- or FFT-based spline % smoothing method. Non finite data (NaN or Inf) are treated as missing % values. % % S is the smoothing parameter. It must be a real positive scalar. The % large...
0ac95fdbb3568d492d10a780be650f984624b5963caebd83f33a7a2fb31435c3
MATLAB
7,452
220
classdef Dataset < matlab.mixin.Copyable %DATASET Class that stores structured character data % This class stores, and provides easy access, to the % sturctured character data. Using the "get" method, % you can easily access particular alphabets/characters/drawers. % You can also pick random...
7aca7741d121773bb0bca538379254beea7ade0149e6cb53844b68c2e5ca5779
MATLAB
7,461
219
function varargout=xwt(x,y,varargin) %% Cross wavelet transform % Creates a figure of cross wavelet power in units of % normalized variance. % % USAGE: [Wxy,period,scale,coi,sig95]=xwt(x,y,[,settings]) % % x & y: two time series % Wxy: the cross wavelet transform of x against y % period: a vector of "Fourier" periods a...
7ebad94eff4cee825478295f5e1ccdb4abd0f6029ffda279d7874092da48cad1
MATLAB
7,500
112
function plotstats(cfg) nrows = 1; ncols = 4; SpikeDensity_timelocked = spikeTrialDensity(cfg); for ipart = 1 : size(SpikeDensity_timelocked, 2) for markername = string(fields(SpikeDensity_timelocked{ipart}.sdf_bar))' nrows = max([nrows, size(SpikeDensity_timelocked{ipart}.stat.(markername), 2)]); en...
7c7742660bedda7e19f78b41d5a10cd2f96b70a95d44bb918b38ee423c6ffb90
MATLAB
7,515
260
function stats=nt_statMatrix(x,plot_params) %stats=nt_statMatrix(x,plot_params) - calculate statistics arrays for each dim of matrix % % stats: array of statistics arrays % % x: data to stat % plot_params: parameters %% arguments if nargin<1; error('!'); end if nargin<2; plot_params.bottom=0.1; plot_params....
c87141143b8c8e07a1c40dc3304320c20673e82b7bd93e09dcabd0d4f34e1e19
MATLAB
7,520
193
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(DATAMATRIX, CATEGORYNAMES) plots violins for each % ...
d983ce77b7aec837af84d97b1e37799ffbc730c1a26ecc8e444842ff84f3f953
MATLAB
7,540
150
function [maskwalker, mperiods, mphases, nscrdots] = mmprepare_randmask(maskdata, nd, plotsize, mazimuth, msize, minvert, mscrambleoption, mmultiply) % DC: added output "nscrdots", "nd" now = "nscrdots", added "mmultiply", % "mwalkersoppo", etc. to equate local motion direction of display + mask %[maskwalker, mp...
5d5cfc984f2289f99edf7eee92a4a436b19b48e5560b410982c22b62e4bc2947
MATLAB
7,560
137
% Help for file Mat2NlxTT.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract data fr...
ac21175c3c3201ce488cdd282a92c90198c730a29b9443e8f35ccfd0bc3f98f8
MATLAB
7,569
137
% Help for file Mat2NlxSE.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract data fr...
6ddb8d13d111d8aa4d523c00c732f44b1d7fe8a1c96d2aea6f137d14673e78ad
MATLAB
7,576
188
function [marker, hypnogram, stats] = hypnogramMuseStats(cfg, MuseStruct, force) % HYPNOGRAMSTATS creates statistics based on hypnogram and markers in MuseStruct % % use as % [MuseStruct, marker, hypnogram] = hypnogramStats(cfg, MuseStruct, force) % This file is part of EpiCode, see % http://www.github.com/stephenw...
ae18ccfc7449d237d15f940e1641629abf86a550bd3963bd1c6f9b650758df26
MATLAB
7,576
128
function preictal_project(ipatient) restoredefaultpath if ispc addpath (genpath('\\lexport\iss01.charpier\analyses\vn_preictal\scripts\EpiCode\shared')) addpath (genpath('\\lexport\iss01.charpier\analyses\vn_preictal\scripts\EpiCode\external')) addpath (genpath('\\lexport\iss01.charpier\analyses\vn_preicta...
0e0a3ad9f7f8c067bb4c47a9d03bd95b1ca4941a5cf8ca6f2a88c68d6007af4d
MATLAB
7,578
201
function preictal_project_SW restoredefaultpath if ispc addpath (genpath('\\lexport\iss01.charpier\analyses\stephen.whitmarsh\EpiCode\shared')) addpath (genpath('\\lexport\iss01.charpier\analyses\stephen.whitmarsh\EpiCode\external')) addpath (genpath('\\lexport\iss01.charpier\analyses\stephen.whitmarsh\Epi...
314642afeb9d9f6666f572119a8e21460bdb59fa8485a47112e9541f75860e80
MATLAB
7,579
139
function [mm, markers, wperiods, wphases, xcenterw, ycenterw] = mmprepare_single(mm, scrambleoption, scramblex, scrambley, invert, trans, offx, offy, plotsize, xcenter, ycenter) %DC: if invert == 5, invert z; %[mm, markers, wperiods, wphases, xcenterw, ycenterw] = mmprepare_single(mm, scrambleoption, scra...
20ee0b6cd8f3cdae4e03f9b23b53c48888bb1c3f17a55cf0b26e8338fd155e20
MATLAB
7,603
269
function Sout = learn_coefficients(B, X, alpha, gamma, L, Sinit) % The feature-sign search algorithm % L1-regularized least squares problem solver % % This code solves the following problem: % % minimize_s 0.5*(||xi-B*si||^2 + alpha*si'si + 2*alpha*si(sigma(Lijsj)) + % gamma*||si||_1 % X : data matrix % B : basis...
40ba847b362eb4e615bacdd1b89161b63ebcd088e43a514579938df1d0a2f5f3
MATLAB
7,613
137
% Help for file Mat2NlxCSC.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract data f...
6509b0bb08e859e2893651030b8a78ab1fafdabb7b3ba55d299ae68c5838f82d
MATLAB
7,673
292
function map = viridis(N) %VIRIDIS Perceptually uniform sequential colormap (Matplotlib viridis). % % map = viridis % map = viridis(N) % % Input: % N : nonnegative integer, number of colours (default: current colormap length) % % Output: % map : N-by-3 RGB colormap in [0,1] if nargin < 1 || isempty(N) N = siz...
f1bda0b37d423ee5013c5a9065d505ddd66b8f0aca9499b6b5ff6426db2b46b5
MATLAB
7,696
225
function [lme,h,p] = mixed_model_SAP(data, stats_folder, filename, name, biom_1, biom_2, coloc) diagnostics = 0; alpha = 0.05; tech_rep = 0; var_names = {'Sham vs Theta'}; if iscell(stats_folder) stats_folder = char(stats_folder); end if iscell(biom_1) biom_1 = char(biom_1); end if iscell(biom_2) biom_2...
930cd86f0a4fb4f3349f54a9302737ab434da8728e334ca738f1f946a06560ac
MATLAB
7,697
137
% Help for file Mat2NlxTT.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract ...
17230bd4fd778a509cbfee48bf03920a212646b4d255a13463a685cec1563b16
MATLAB
7,706
137
% Help for file Mat2NlxSE.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract ...
470ed3cf948e0951bf30bca2d8104ba712205ea8472e2f589466a3e8dc0ed818
MATLAB
7,718
164
function [session, init_params, glm_params] = fLocAnalysisParams(session, clip) % % Generate data structures for preprocessing and analyzing localizer data % using vistasoft functions (https://github.com/vistalab/vistasoft). % % [session, init_params, glm_params] = fLocAnalysisParams(session, clip) % % INPUTS % 1) s...
68ebd59019493009b0d35d25f7e21a0fa5a7aa92db701d872d126fd6b20cfb05
MATLAB
7,736
190
function [covariates] = CBIG_generate_covariates_from_csv( csv_files, subject_header, ... covariate_names, covariate_types, subject_list, FD_file, DVARS_file, outname, delimiter ) % [covariates] = CBIG_generate_covariates_from_csv( csv_files, subject_header, ... % covariate_names, covariate_types, subject_list...
688c919c7a964918dcf7a728feece23f99866844c02b3975986686f6cf7c2cfc
MATLAB
7,750
137
% Help for file Mat2NlxCSC.dll % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to extract...
830637aa4f96d8aea5a9b2f7997d70bbbcdf99c853efb1932264e00049aba87b
MATLAB
7,755
212
%% function [varargout] = browse(path, loadables, varargin) %----- Parse input options = inputParser; options.addParameter('extension', '.fig'); options.addParameter('dataExt', '.mat'); options.addParameter('figureName', []); options.addParameter('figureTitle', []); options.addPar...
5b7eefce1c7b567a387fc8606fd1b93b5f0a1665fd8b00fa537004ed285670c6
MATLAB
7,769
149
function [artefacts] = writeSpykingCircusDeadfilesMultichannel(cfg, MuseStruct, force, suffix) % WRITESPYKINGCIRCUS_DEADFILES creates artefact files (deadtime) for % SpykingCircus in data directories for spike analysis % % use as % writeSpykingCircus_deadfiles(cfg, MuseStruct, force) % or % writeSpykingCircus_dea...
328985388681410e0648f18ea2d04f745967bbb859053a3ed0eee6c0cf920d71
MATLAB
7,807
185
% Correlate varA with varB accounting for confounds (SPM) clear, clc, close all %% Paths / data path_batches = 'D:\Projects\2023_multib\MK_multi_b\Scripts'; cd(path_batches) load('Table_297_subjs_demographics_biomarkers_2024_05_03.mat') n_subjects = size(T_subjects,1); path_stats_group = 'D:\Project...
4dae22595cc4fc638d6de5a7ea96031b0d138028aef712c59c48934a3b69ca7f
MATLAB
7,807
242
function [G ugl] = impatsort(fpathexpr,varargin) % [PATGROUPS LEVELS] = IMPATSORT(PATHEXPR,{OPTIONS}) % [PATGROUPS LEVELS] = IMPATSORT(INSTACK,{OPTIONS}) % Read a number of image files (ostensibly tileable patterns/textures) % and sort them into groups based on their average gray level. This is % used as th...
e2af6a063e41623696c58ddcf58f8d9707ea726d6227fa1bc0494bacbe876361
MATLAB
7,840
204
%%%% Version 4 (MGG) %%%% %%%% Cell classification in a semi-automated way %%%% %% clc; close all; clear all; warning('off','all') reset(0); select_monitor = 1; %------------------------------------------------------------------------------% %% Select steps to run %%% Step 1 %%% % Select cells % set...
be11452d867d7e7bcba4dde6f89046c389eaf568f69386e8381861faf8cd2c30
MATLAB
7,866
211
%% % Inputs folder='.\'; % Results will be saved in this folder J_dial = "Enter number of protofilaments : "; J = input(J_dial); % r_dial = "Enter spacing between tracing points, nm : "; % r = input(r_dial); r=2; %minimal spacing between tracing points c_dial = "Enter curvature, deg/dimer : "; c = input(...
ef143e7eec92b4f2f3482f0f8e94dda7aae8fb5509ae1b77150992680bbc9292
MATLAB
7,872
239
function varargout = imcropzoom(varargin) % IMCROPZOOM({INPICT},{WIDTH}) % OUTPICT = IMCROPZOOM({INPICT},{WIDTH}) % [OUTPICT RECT] = IMCROPZOOM({INPICT},{WIDTH}) % Interactively use IPT imcrop() to crop an image. This is a simplified utility % that aims to improve the practical usability of imcrop() within the c...
be6bbcca5cf11df129282c2ccceb078aaf345928ba484f6f021e8f34dcaeb831
MATLAB
7,874
194
function outpict = lcdemu(inpict,vangle,screenprofile) % LCDEMU(INPICT,{ANGLE},{SCREENPROFILE}) % Emulate the effect of using an old or low-quality TN-type LCD monitor % Both horizontal and vertical viewing angle influence is emulated % Image is assumed to be scaled to screen extents % % INPICT is...
4649117fd2830331520e42dfa4c111fcb854976c362ea3b08eee0212bf3ca2f7
MATLAB
7,923
150
function [allData_combined,DataToCombine] = combine_experimenters(save_path) %%% Combine data from different experimenters for the same cohorts/brain slice - V2 (MGG) %%%% %% Combine all data in a single table and generate results % Find mat files for each dataset files = dir(fullfile(save_path,'*.mat')); % Re...
565ec1a67f34a831b3656d290b6d3d5478484ffbdca526161879ed2e1098e084
MATLAB
7,959
246
function TrialPETHDeltaF( Fs, Ts, Pre, Post, EventTS,Ch490,Ch405, prefix, varargin) %Original code by David J. Barker; Modified for use with PhotometryGUI by %Carissa A. Bruno for the Barker Lab at Rutgers University. %Trial Analysis: This code will take inputs and create Photometry %Raster-PETH. The Raster PETH ...
d1ad2912aa2c93d03791368fa0daeae864c0502e7a42bc1717c631fe782e78d9
MATLAB
7,964
144
%% |NATSORTFILES| Examples % The function <https://www.mathworks.com/matlabcentral/fileexchange/47434 % |NATSORTFILES|> sorts filenames or filepaths in an array |A| (cell/string/struct) % taking into account number values within the text. This is known as % _natural order_ or _alphanumeric order_. Note that MATLAB'...
75efbcec47d007ec425597e4e81575f561e2cbbbc5914a22640510977df513e8
MATLAB
7,977
215
function err = functionalPreprocessing(session, init_params, clip, stc, QA) % Automated preprocessing of fMRI data % using vistasoft functions (https://github.com/vistalab/vistasoft). % % INPUTS functionalPrepcrocessing(session, init_params, clip, stc, QA) % 1) session: name of session to analyze (string) % 2) init_...
6f0b5086edfbc020014908e4dd45983c401bce85c3d95ae3e10f60c2d906eb03
MATLAB
7,978
171
function output = CBIG_Projectfsaverage2MNI_Ants(lh_surf, rh_surf, interp_type, MNI_mask, index_map, delimiter) % Usage: output = CBIG_Projectfsaverage2MNI_Ants(lh_surf, rh_surf, interp_type, MNI_mask, index_map, delimiter) % % Function projects surface data to the volume % Also see reverse transform CBIG_ProjectMNI2f...
c7fb8416b13be463a98b885968f99ce1d8e95ab654155756d5dda99e6c5f935c
MATLAB
7,989
220
%% % draw3DProjections(description, canvas, subs, histo, xyzArray, [@combiner]) % draw3DProjections(description, canvas, subs, x, y, z, xyzArray) % draw3DProjections(description, canvas, subs, x, y, z, w, nXYZBins, xyzMin, xyzMax, [zRange], [doProfile]) % % Units can be specified for axes by either providi...
7f55209ee1b09ce84c32c8fff7cc04a05d1b6c963eafe6a2523c28ec6c9525a0
MATLAB
8,016
219
function plot_kde_90p_prediction_intervals() % load load('true.mat'); % T_test load('IVMD_CNN_SVM.mat'); % IVMD_CNN_SVM_TSIM2 x = 1:length(T_test); errors = T_test(:) - IVMD_CNN_SVM_TSIM2(:); errors = errors(~isnan(errors)); % 去除 NaN % 设置带宽方法 bandwidth_methods = {'RuleOfThumb...
8c163189ced4f7c5e804d186eda1071bd94999d5003a81530ad82ecea7047ccb
MATLAB
8,036
201
function [isih] = ft_spike_isi(cfg, spike) % FT_SPIKE_ISI computes the interspike interval histogram % % The input SPIKE should be organised as % a) the spike datatype, obtained from FT_SPIKE_MAKETRIALS % b) the raw datatype, containing binary spike trains, obtained from % FT_APPENDSPIKE or FT_CHECKDATA. In this cas...
a3a96b5089010400a49d809cd90bb240fb14059f60d46d5722f18ea29c9829a2
MATLAB
8,075
265
% BLEND MODE DEMOS % depending on your filesystem, your pwd and where you stick this script, % you may need to change the path strings used for input/output. % some of these may be configured for viewing on an inverted display % if something looks inverted, just check the call to imshow() or imshow2() % This file ex...
d7ecd3569904b2904622785d811797515f42ec8dac981fee9deb6ff4728f55f1
MATLAB
8,077
176
function [hline,hdata] = plotPsych(result,plotOptions) % plot your data with the fitted function %function plotPsych(result,plotOptions) % This function produces a plot of the fitted psychometric function with % the data. % In the struct plotOptions you may set a lot of options, which are listed % here with their defa...
613d7e58e2accb20bba3bd9e2d226bf88ceaeae2c519fbe288c0d31d58bb7e50
MATLAB
8,085
178
%% Create filename list clear RLfilename fout_table fout_data % loop over patient ifname = 1; electrodetype = []; for ipatient = 1:length(vect_pat) % loop over sleep vs wake for iperiod = 1:2 % loop over macro vs micro for electype = 1:2 for elec = 1 : nr...
f4183deeb68da9c467f71f477179d86dd2fab021d3e2b397e2282c589e38a1fe
MATLAB
8,095
204
%% FAQ % Frequently Asked Questions for the Wavelet Coherence Matlab Toolbox % % http://www.glaciology.net/wavelet-coherence %% How do I know whether AR1 noise is an appropriate null hypothesis to test against? % It is usually an appropriate null hypothesis if the theoretical AR1 % spectrum is �a good model� for the ...
a7ee368fdcf9a2dbf2407385c3786772255316444c15ad9bdc27bc29d18c6163
MATLAB
8,120
280
function outpict = ibcomposite(outpict,FG,BG,FGA,BGA,FGhasalpha,BGhasalpha,compositionmode,blendmode,opacity,camount,nframes) % this is the composition section of IMBLEND % this is not intended to work independently % i only split this because editing a 3000+ line file is a pita % prepare things if ~strcmp(compositi...
89429166407ae2d3d7bae554ccd9b57347f60b2f61ae9dfe5866f0112e626d38
MATLAB
8,134
153
%************************************************************************** % % create_ismrmrd_3Dvol_and_send extracts a block of 3D data in ISMRMRD % format and sends it back to the host. % input: Structure with fields of data and reference % connection: Link with Gadgetron. Required to get global...
f1369999dbd1abe18d4fa01b7b55e2a19873df93d0f7c208257c392bc6ba0dae
MATLAB
8,149
162
function [X, fX, i] = minimize(X, f, length, tol, P1, P2, P3, P4, P5, P6, P7); % Minimize a continuous differentialble multivariate function. Starting point % is given by "X" (D by 1), and the function named in the string "f", must % return a function value and a vector of partial derivatives. The Polack- % Ribiere fl...
ff7957b24f37b19185957e393eee4173c848e8c4e9a932f16246af21f1cadc5c
MATLAB
8,171
237
clear all; close all; clc addpath(genpath('/data/code/matlab')); % error('to here') % /usr/local/MATLAB/R2018a/bin/matlab -nodisplay -nosplash -r RunMacro19 % nohup /usr/local/MATLAB/R2018a/bin/matlab -nodisplay -nosplash < RunMacro19.m >&! out.1 & CHRONUX = 0 % Use 0/1, NOT T/F CROSSED = 0 SPLIT_UP = 0 % [0] Bre...
daf37f65f23cb0cad0eb2b8f23d5bdff86753d113678acfc8676da3a11f08c47
MATLAB
8,174
163
function [Xcorr, XcorrGH, PosPvalues, NegPvalues, num_pairs] = ... computeXcorrHGonly(animal_name, spike_matrix, autocorr, max_lag, repeat_calc, save_data, output_folder) %% By Mattia 01.02.19 % computes cross-correlograms (CCH) and their "significance" values % as in English et al., 2017. % requires spike matrices...
6dac0974e6da0facb1fc4b428bb174f390d30753774316bc7a951fb9f5536040
MATLAB
8,216
279
function outpict = imrectrotate(inpict,angle,varargin) % IMRECTROTATE(INPICT, ANGLE, {OPTIONS}) % Rotate an image using pixel displacement to crudely maintain boundary geometry. % Characteristic creasing effects can be maximized with iterative application. % This is not intended for any technical pu...
ec2886621faca2c883ee429f2810c3960b07483d791fb2b3e8e5d07cc697b092
MATLAB
8,239
220
function preictal_project_LC restoredefaultpath if ispc addpath (genpath('\\l2export\iss02.charpier\analyses\vn_preictal\scripts\EpiCode\shared')) addpath (genpath('\\l2export\iss02.charpier\analyses\vn_preictal\scripts\EpiCode\external')) addpath (genpath('\\l2export\iss02.charpier\analyses\vn_preictal\sc...
c09832efdcaa1dccd19ab7d4a555d37c6c3153d5165425598abd31cc2a95db14
MATLAB
8,250
233
% Load the Gaussian filtered FC matrices % FC_all = load('.../FC_filtered.mat'); average_conn_matrix = squeeze(mean(FC_all.FCE, 1)); % Load saved 1-Cycle vectors & cycle coefficient to save time for subgroups % load('/Results/kCycleVect.mat'); % load('/Results/Alpha.mat'); demographics = readtable('.../DemTable....
36c8c341a5ff56139b00545691e0000f52e01e93c21784b7e7ec62b89656eb3e
MATLAB
8,292
203
function seizure_infos = dtx_stats_seizure_timings(cfg, MuseStruct_concat,ipart) % computes some descriptive stats for data with or without EMG, with % seizure start/end (rats) or slowwave (patients). For rats, time is % relative to the injection of DTX. % ## INPUT : % - cfg : %mandatory : % cfg.seizuretimings.mark...
a78d848abf380ec39491841897c8e74f5db11c2357704c13b7a21b71ee37c293
MATLAB
8,303
269
% This script provides a tutorial application of the Gaussian-Copula Mutual % Information (GCMI) estimator to quantify temporal interactions in an % event-related EEG response modulated by a continuous stimulus feature % % This script uses cell mode - cells are delimited by %% lines and can % be run with: % ctrl-ent...
a2575c538dbe3f151422681733516be6294af495aa23f0d394c6d44d713ed79c
MATLAB
8,308
214
function [taskLengthDiff,percentMissingSamples,percentOffSamples] = natview_eye_data_qc(fileNameSET,fileNameTSVGZ,fileNameJSON,outputDir,saveFlag) % PURPOSE: This function calculates quality control (QC) metrics from eye % tracking data. Using the raw EEG file, function calculates the % difference bet...
02422349acb824d892d778a730df9b344190d3ec570ac3fdbf2c2f36c819d90e
MATLAB
8,319
241
clear all; close all; clc addpath(genpath('/data/code/matlab')); % error('to here') % /usr/local/MATLAB/R2018a/bin/matlab -nodisplay -nosplash -r RunMacro19 % nohup /usr/local/MATLAB/R2018a/bin/matlab -nodisplay -nosplash < RunMacro19.m >&! out.1 & CHRONUX = 0 % Use 0/1, NOT T/F CROSSED = 0 SPLIT_UP = 0 % [0] Bre...
b322905093b3768ca2aba4830564a8f78e3c7a9d880ccbc103f3389758a3d0f1
MATLAB
8,340
157
function [artefacts] = writeSpykingCircusDeadfiles(cfg, MuseStruct, force, suffix) % WRITESPYKINGCIRCUS_DEADFILES creates artefact files (deadtime) for % SpykingCircus in data directories for spike analysis % % use as % writeSpykingCircus_deadfiles(cfg, MuseStruct, force) % or % writeSpykingCircus_deadfiles(cfg, ...
a8abdc731c6d80f0085a04a5a28e56554625047fae6836d78428fafb1db433d3
MATLAB
8,359
227
%load data from csv as table GTEx version 8 T= readtable('Male+Female.csv'); %T should be (the number of samples by how ever many input and output features) %T = (n_samples x n_features) data = T(:,:); %Extract ID feature ID = table2array(data(:, {'ID'})); %Set input parameters x_names = {'HDAC1','HDAC2','HDAC3','HD...
765b0c967e1baf31db5478e73d8c11df9c0988b9184196b12ba0c9f2c5a331ab
MATLAB
8,361
234
function [result] = bfopen(id, varargin) % Open microscopy images using Bio-Formats. % % SYNOPSIS r = bfopen(id) % r = bfopen(id, x, y, w, h) % % Input % r - the reader object (e.g. the output bfGetReader) % % x - (Optional) A scalar giving the x-origin of the tile. % Default: 1 % % y - (Optional) ...
05c6c9d71461f1484d630c08a2f40fc37784437cfa0c72190c77892c0fcc3229
MATLAB
8,363
269
function [p,padj,h,lme] = stats_VMstim(results_folder, results_to_plot, biom_1, biom_2, name, coloc, allData) %% setup AB=1; norm_to_zero = 0; no_carrier = 0; rem_outliers = 1; if AB sprintf('Pipeline setup for Alamar Blue!!'); end stats_folder = fullfile(results_folder, biom_1, 'Stats'); if AB stats_fol...
ae9c60ccb086ebd2d5749bb6c943d83512716aa64ab3ac2f4a1c03e835133c72
MATLAB
8,384
200
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function hdr = load_untouch0_nii_hdr(fileprefix, machine) fn = sprintf('%s.hdr',fileprefix); fid = fopen(fn,'r',machine); if fid < 0, msg = sprintf('Cannot open file %s.',fn); error(msg); else fseek(fid,0,'bof'); hdr = read_header_load_u...
2c2a0b101d233b68b30c51f5d62b37c83cfc3d3fa2101ca5bccadcd3864229b1
MATLAB
8,389
310
function spm_prf_review_surface(PRF,pidx,img) % Displays PRF results on a cortical surface % % PRF - estimated PRF structure % pidx - index of the parameter to display within PRF.Ep{1} % img - (optional) displays this parameter map (.nii) % Default hemisphere hemi = 'lh'; alpha = 0.8; if nargin < 3 img = ''; e...
b88fc34e557dc28f46af6c179344ff2357dcdeb951521582c1a9854d976dfd0a
MATLAB
8,412
189
%% Create filename list clear RLfilename fout_table fout_data % loop over patient ifname = 1; electrodetype = []; for ipatient = 1:length(vect_pat) % loop over sleep vs wake for iperiod = 1:2 % loop over macro vs micro for electype = 1:2 for elec = 1 : nr...
0b126b30eb5f27b00a8069f85e3da1356222df447640ddd36db420bf145a2339
MATLAB
8,419
200
%PARAMETERS % nodestdThresh. This is the standard deviation threshold for exclusion of % skeleton nodes based on prePeriod activity nodestdThresh = 1; [textFileName, textFilePathName] = uigetfile('*.txt', 'Pick txt file specifying input'); fid = fopen(strcat(textFilePathName,textFileName)); % filename pathname conditi...
eef60bb2f3da21d38cbe824d7a4527baa096a0c7905933a4aa17f8178c8863b6
MATLAB
8,422
182
classdef PairDataCCAResultsVisualizer % PairDataCCAResultsVisualizer % Visualizer for CCA analysis results, including correlation plots % and 3D visualization of wiring PI components. methods (Static) function ax = scatterCCACorrelation(ccaResults, componentIdx, options) % Scatter ...
959abab4ec140cc421b9a2bf3ace9dda42f9b634f19336f2a1b409890dd80c32
MATLAB
8,426
172
function stats = spikeWaveformStats(cfg, SpikeWaveforms, force) % SPIKEWAVEFORMSTATS computes average and variance of the spike waveform. % Then, the average is interpolated and the following parameters are % computed : amplitude, halfwidth, peaktrough and trouhpeak. % Input spike waveform data is get from readSpikeW...
9cd08b1f1785d572416b9d25f6c4f55d00faf2562fc190e40d2632393d29dac3
MATLAB
8,434
259
function outpict = nhfilter(inpict,varargin) % OUTPICT=NHFILTER(INPICT,MODE,{BLOCKSIZE},{ORDER}) % Perform the selected sliding-neighborhood filter operation on an image. % % This is a passthrough to various IPT functions, with internal fallback implementations to help % remove the dependency of MIMT tools o...
993eeaa7e0edfcbaa463d66bb94169ee00e1eefbf5b9eea100917cb1bbb87c33
MATLAB
8,435
196
%% % function [varargout] = enhanceCopying(handles, copyWholeFigure) %----- Get axis handles if none are provided if nargin < 1 handles = vca; end if nargin < 2 copyWholeFigure = all(ishghandle(handles, 'figure')); end %----- Available context menus if copyWholeFigure ...
3b68ac24f2472ea4fa1b50cf93ed3c8a2e006844ec1d5ea773be6a0d930971b4
MATLAB
8,447
284
function varargout = cropborder(inpict,varargin) % OUTPICT=CROPBORDER(INPICT, {WIDTH}, {OPTIONS}) % [OUTPICT WIDTHUSED]=CROPBORDER(INPICT, {WIDTH}, {OPTIONS}) % crops a border of WIDTH pixels from the edges of INPICT % this is much more convenient than using imcrop() % % INPICT is an I/IA/RGB/RGBA/RG...
323161b61fb730429fd86c874ebacafefae8c53e17e56a7b84446b41fac2385b
MATLAB
8,457
217
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function hdr = load_untouch_nii_hdr(fileprefix, machine, filetype) if filetype == 2 fn = sprintf('%s.nii',fileprefix); if ~exist(fn) msg = sprintf('Cannot find file "%s.nii".', fileprefix); error(msg); end else fn = sprint...
4d905b73f509bf83fcf72c01f371655f077fe0d30e231b59284a9ba50e3d6b34
MATLAB
8,511
207
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function save_untouch_nii_hdr(hdr, fid) if ~isequal(hdr.hk.sizeof_hdr,348), error('hdr.hk.sizeof_hdr must be 348.'); end write_header_save_untouch_nii_hdr(hdr, fid); return; % save_nii_hdr end %----------------------------------------------...