sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6550447d2c8cd4cd72571f7daaa3013a43e631cdad5c839121f99f71d81f0a19
MATLAB
8,893
240
% Code to produce figure 2 clearvars close all load('rainbow_cmap.mat') load("colour.mat") %% Load AUTO files load('KpLCr1.dat') load('KpLCr2.dat') % Hopf bifurcations load('HB1.dat') load('HB2.dat') % limit points load('LP1v1.dat') % homoclinic bifurcation load('HOM1.dat') load('HOM2.dat') % ...
9df90b20b3b355cdbf38b464a27b66c251a98367356830a3c83cbcd41990f50c
MATLAB
8,895
183
clear all close all %% Parameter initialization run('spiking_parameters_simple_dopa.m') %most parameters are stored in this file plot_var = 1; %set to 0 to turn off trial by trial plotting %% main program for l = 1:num_trials tic %% initialization [v_it,v_kt] = deal(zeros(N,1)+v_rest); %membrane po...
a28276564e8a33cb5017878f3607051c8655172a66d234631225ffa35fa8a3a9
MATLAB
8,906
196
clear all; globals; initglobals; FramesInf.act = 0; FramesInf.noact = 0; FramesInf.xy00 = 0; FramesInf.removed = 0; FramesInf.totalFrames = 0; DATA_TYPE = 'OF'; %'OF' / 'EM' DATA_TYPE = 'EM'; %'OF' / 'EM' switch DATA_TYPE case 'OF', base_folder = 'Data\OpenField'; %base_folder ...
e914d8d6324cf0656f7f12277be0416231473ad6334a6105cf6c8f181292dcd5
MATLAB
8,914
212
function [S, varargout] = genCorrelatedSpikeTrains2(spike_opts, varargin) % function S = genCorrelatedSpikeTrains(spike_opts) % % Function to generage a set of correlated spike trains by using a Hawkes % process, or a discrete approximation of a Hawkes process. % % 2017 - Adam Charles %%%%%%%%%%%%%%%%%%%%%%%%%%%%...
2f36bc27c34325335e57a869525065dd4ffcc63ce7f05d16d249a46fe3cf3ec7
MATLAB
8,915
238
function [montage, cfg] = ft_prepare_ODtransformation(cfg, data) % FT_PREPARE_ODTRANSFORMATION returns the transformation matrix from % optical densities (OD) to chromophore concentrations such as (de-) % oxygenated hemoglobin. % % Use as % [montage] = ft_prepare_ODtransformation(cfg, data); % % It is neccessary to...
6c5be83ab95cdfdaa4f8aeca66afa978309921249a2cd6e34cc35bd88d29e5a7
MATLAB
8,915
228
function [dat] = read_neuralynx_ds(dirname, hdr, begsample, endsample, chanindx); % READ_NEURALYNX_DS reads multiple single-channel Neuralynx files that are % all contained in a single directory. Each file is treated as a single % channel of a combined multi-channel dataset. % % Use as % [hdr] = read_neuralynx_ds(di...
f62e67ef03aac06f1e05b89c82b052e3aaedeb00c5556407b8f1b48ecd87885b
MATLAB
8,915
219
% findFlyNotMoving.m % % Function to find when the fly isn't moving, based on the criteria that % the 2 midlegs are not moving in X and Y (velocity below threshold). % Finds based on smoothed velocity below threshold and non-smoothed % velocity also below (separate) threshold % Returns indicies of not moving times % ...
7029249849d0e70e278c6c827d650098cc51cfc15e7592ebe629759ed99f9203
MATLAB
8,919
284
%% Detect EP bursts mkdir('Bursts'); Events=[]; interval=300000; i=0; %% i=i+1; % Manually for each image iImage=FileList(i,1).name; ep=EP(1,i).all; % Load EP. x = xEP(i,1).all; % Convert to frames nFrames=frequency(i,3); figure() reduce_plot(x,ep); ylim([mEp 20]); ...
b9586629a0c6c2355375d803ce4e98308e7018c2123a321bf4d8c2df76bf0ad7
MATLAB
8,919
278
function [num,status,strarray] = str2double(s,cdelim,rdelim,ddelim) %% STR2DOUBLE converts strings into numeric values %% [NUM, STATUS,STRARRAY] = STR2DOUBLE(STR) %% %% STR2DOUBLE can replace STR2NUM, but avoids the insecure use of EVAL %% on unknown data [1]. %% %% STR can be the form '[+-]d[.]dd[[eE][+-]dd...
3c8ceb9e93a609655a8f21021f474ac870544c5902c8135d6090564c4444372f
MATLAB
8,923
251
% findCondYawVelPeaksFT.m % % Helper function for saveBallLegStepParamCond_bouts() that takes in % fictracSmo, cond, and moveNotMove and returns times for valid yaw % velocity peaks as well as start/end times for corresponding bouts. % Boolean for whether to extract right or left turns % % Adapted from findCondYawVe...
b71512bd0977f6540e49e7e5d13bb209043f94cf5b320847d0f544b266ef959b
MATLAB
8,927
282
% plotContLegStepParamCond_bouts.m % % Function to plot output of saveContLegStepParamCond_bouts(), compared % with reference from saveContLegStepParamCond_indpt() % One figure with 6 subplots, 1 for each leg % Can select more than 1 output file, will plot on same graph % Has option to plot reference steps (from saveL...
297d7364f824992a8e5b5b41591b3b05a52422a1d1346f1aa04138b47b2ebcb7
MATLAB
8,937
309
function varargout=buildSectionPreview(sectionToPlot,channel) % Builds a preview image of the last completed section and sends to WWW % % function buildSectionPreview(sectionToPlot,channel) % % Purpose % This function builds a low-res preview image of the first depth, a montage % of all depths, and a histogram (current...
098a48ae179d88dc99aecc73db636d4afbdc321822b7193b2b3b2f5e4b672319
MATLAB
8,941
413
classdef My_net_util methods(Static) function group_info=gen_group_info_basic(net_config, group_name) net_config.ref.group_counter=net_config.ref.group_counter+1; group_info=[]; group_info.child_group_idxes=[]; group_info.net_info=[]; group_info.child_relation='chain'; group_info.group_idx=net_co...
2ce299c169907c8b900d85fba9c30b51fefdb5d4d6f7fac2a3456d9c5a681e83
MATLAB
8,943
201
function data = TDMS_readFileHelper_v1(fid,optionStruct,metaStruct,paramsStruct) %TDMS_readFileHelper_v1 % % % Time stamps in TDMS are stored as a structure of two components: % (i64) seconds: since the epoch 01/01/1904 00:00:00.00 UTC (using the Gregorian calendar and ignoring leap seconds) % (u64) positive fr...
bafde48fbd00279635adf0f899688f7abe354a9849e673aa677b6a1200e35c0f
MATLAB
8,954
249
function [nsout] = read_neuroshare(filename, varargin) % READ_NEUROSHARE reads header information or data from any file format % supported by Neuroshare. The file can contain event timestamps, spike % timestamps and waveforms, and continuous (analog) variable data. % % Use as: % hdr = read_neuroshare(filename, ...) ...
4764bfa7a687d6c7341537b7d7dc3ce69cf2ae5431f8715354e522b8e46111fa
MATLAB
8,959
232
function hdr = read_yokogawa_header_new(filename) % READ_YOKOGAWA_HEADER_NEW reads the header information from continuous, % epoched or averaged MEG data that has been generated by the Yokogawa % MEG system and software and allows that data to be used in combination % with FieldTrip. % % Use as % [hdr] = read_yokoga...
c0d95047f260b4ec39d3795b5f7f4114b9bd01b33a5e2e0afdc9f3cd1c7f3c47
MATLAB
8,961
266
function spm_preproc_write(p,opts) % Write out VBM preprocessed data % FORMAT spm_preproc_write(p,opts) % p - results from spm_prep2sn % opts - writing options. A struct containing these fields: % biascor - write bias corrected image % GM - flags for which images should be written % WM ...
7b25fc5469c2600f7044e101b374fb36063c86d98aa9b507f610c981008cd967
MATLAB
8,993
231
%This script allows the user to pick a watershed region in a t-SNE map and %finds when the animal transitions into that region and plots their %behavior, not used in paper %% STEP 1: establish plotting constants N_rows = 4; N_columns = 4; N = N_rows*N_columns; fps = 14; frames_before = 5*fps-1; frames_after = 5*fps; ...
da699a7f7efd644eaa6e41bf5a5d97e658597119ed4964687ffcfda435fbdba0
MATLAB
9,001
275
function [] = ExtDataFig03_DecayRateComparison_PtoS_OptOffset() % Code for comparing half decay time of the dPR1 neurite GCaMP signals during pulse-to-sine transitions and after the offset of the song driver stimulation in Extended Data Fig. 3g. GT = 'dPR1NP'; %% pulse-to-sine transitions DurThre_sine = 5; DecayRange...
da72f21c566086e062f169eea6303a3129e2ef58aae51300d2068dd2f30f92b4
MATLAB
9,010
279
% mglTestGammaSet.m % % $Id:$ % usage: mglTestGammaSet() % by: justin gardner % date: 03/06/15 % purpose: Test gamma table setting % % 6/1/2018 Seems to be broken again on 10.13 High Sierra. The gamma table that % gets sets first off seems to be missing the first few values - maybe about...
8405559c2d3ae5b0abdd87d3d1d39727bb18f5ded196f02b1afe88f4c6b94c53
MATLAB
9,014
208
function chanunit = ft_chanunit(input, desired) % FT_CHANUNIT is a helper function that tries to determine the physical % units of each channel. In case the type of channel is not detected, it % will return 'unknown' for that channel. % % Use as % unit = ft_chanunit(hdr) % or as % unit = ft_chanunit(hdr, desired) ...
c7bd7ddbfa38153190f817eaa80196e7037455acc677b00bee5b29e26e6f2c33
MATLAB
9,025
320
%% Pre-process the flocking data % for paper "Inferring stochastic dynamics of complex systems", T.-T. Gao, % B. Barzel, and G. Yan clc, clf, clear, close all tic % timestamp, x, y, z, dxdt, dydt, dzdt, dxdt2, dydt2, dzdt2, gps_con N = 9; % birds number % load the data from different datasets: hf1, hf2,hf3, and hf4 d...
d2f41d82e94685ce09b298c47c8ba00b54f5ad5b040aab5f1bb0e59b72832d27
MATLAB
9,029
221
function script04_2D_images_transverse_to_axons() % get 2D original/segmented images transverse to the axons % % This script needs the original volumes and the results from script: % script02_proofread_vols.m % It also needs the information in the text file % 000_animal_exp_axons_cells_nx_ny_nz_cclims_cglims.txt ...
d1e3ca00dad89d0d6f171c6dc243ff039b7aad9182610008222e170c8f01c0cb
MATLAB
9,040
262
function outliers = detect_outliers(X,Y,fig_flag,method) % Finds univariate and multivariate outliers % 3 'methods' are available and they can return different % results % % FORMAT outliers = detect_outliers(X,Y) % outliers = detect_outliers(X,Y,fig_flag,'method') % % INPUTS: X and Y are two vectors of the s...
c948d7ca1ee5215f1f0142302ce387a78ed0a13a8aa3087d1a05445e682a31fd
MATLAB
9,048
246
function [obj] = ft_convert_units(obj, target, varargin) % FT_CONVERT_UNITS changes the geometrical dimension to the specified SI unit. % The units of the input object is determined from the structure field % object.unit, or is estimated based on the spatial extend of the structure, % e.g. a volume conduction model of...
2e242139eee7d1e675b442989caad7abf60c3ae0bc69dd1975e7643f7baaaaaa
MATLAB
9,073
180
function out = dfa_ripquantpertrial_allphase_NF(index, excludeperiods, rippleskons, trials, pos, varargin) % Parse through trials; note size and time of each ripple in each trial phase % Also save whether or not wait trials contain a trigger event (t22) for later exclusion % For each trial phase, include the trial...
9679011092a27ea0d5529d5aaf3f87fd5c1c4b23a354b71e1216e11bdf8441d5
MATLAB
9,073
277
function [list,sumbytes,varargout] = dirr(chemin,varargin) % % % dirr % Lists all files in the current directory and sub directories % recursively. % % [LIST] = dirr(PATH) % Returns a structure LIST with the same fieldnames as returned % by LIST = DIR(PATH) % PATH can contain wildcards * and ? after the last ...
1ba3cda62f86fa89f1caf7401b8ae47922bc215b13171b262db9777de7a435b1
MATLAB
9,074
217
clear all; close all; clc %%%% janine.thome@zi-mannheim.de %% RF classifier reported in "Classification of amyotrophic lateral sclerosis by brain volume, connectivity, and network dynamics" (HBM) %% SPECIFY: groupN = [0,1]; % group coding groupL = ["Controls"...
9e94cf7d28267a65f25e7d846fa0d71f33c497c31a19746ad3ee5ee52e16bf85
MATLAB
9,077
226
function [event] = read_trigger(filename, varargin) % READ_TRIGGER extracts the events from a continuous trigger channel % This function is a helper function to read_event and can be used for all % dataformats that have one or multiple continuously sampled TTL channels % in the data. % % This is a helper function for ...
fddaff9ad72f9d3e2d3e652850e8365e4036650a65b0fab5ebe4e4bb1278d2f0
MATLAB
9,077
188
function stPred = stPredSimSeqWrapper(params) % preallocate space stPred = struct(); stPred.predHRF = []; stPred.predNeural = []; stPred.params = []; stPred.prfResponse = []; stPred.rf = []; stPred.hrf = []; % Use average ROI spatial exponent as static exponent if params.analysis.useM...
14b78625a23c7a81c5af6bdbee48c31c32775e20a2ab57671fa06b5eb3c37cc9
MATLAB
9,081
254
function script05_align_axons(samplei) % This script aligns the axons to the z axis, it saves the transformations % Original->Aligned and Aligned->Original. Instead of rotate coordinates, % the final rotated volume is "interpolated" using the unrotated volume % as reference so the original can be recovered in a...
083b803ffa5632bd119d9a50807465c83f69f3e41bd415deb9b5aacf0f2ac082
MATLAB
9,085
217
clear all; close all; clc %%%% janine.thome@zi-mannheim.de %% RF classifier reported in "Classification of amyotrophic lateral sclerosis by brain volume, connectivity, and network dynamics" (HBM) %% SPECIFY: groupN = [0,1]; % group coding groupL = ["Controls"...
6c5a206a2d9e303a35b4964cfb4949f3c71880dceef5c5ad773441e3ade60d7a
MATLAB
9,089
197
function [mri, hdr] = read_ctf_mri(filename); % READ_CTF_MRI reads header and image data from a CTF version 2.2 MRI file % % Use as % [mri, hdr] = read_ctf_mri(filename) % % See also READ_CTF_MRI4 % Copyright (C) 2003-2010 Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fiel...
ce451449119ad601508d98f49b37879a861def677847eb5ed64c678423d4d5f7
MATLAB
9,094
263
function varargout = filetype_check_uri(filename, ftyp) % FILETYPE_CHECK_URI % % Use as % status = filetype_check_uri(filename, type) % % Supported URIs are % buffer://<host>:<port> % fifo://<filename> % global://<varname> % mysql://<user>:<password>@<host>:<port> % rfb://<password>@<host>:<port> % seri...
0038720e27e6f2b4301cc86ddaf2b63c131fd630b4a9b485549b9869db3c47d3
MATLAB
9,097
217
clear all; close all; clc %%%% janine.thome@zi-mannheim.de %% RF classifier reported in "Classification of amyotrophic lateral sclerosis by brain volume, connectivity, and network dynamics" (HBM) %% SPECIFY: groupN = [0,1]; % group coding groupL = ["Controls"...
b1ab14f67907ecf753f16245c248343c9ff4459f477937470a5c5b9f5ea3ec8b
MATLAB
9,120
226
% findLegFtCmbNotMove.m % % Function that takes in start and end indices for not moving bouts, as % calculated on leg data and FicTrac data, and returns start and end % indices for not moving bouts on both datasets, as calculated as % intersect, union, leg only, or FicTrac only % % Helper function for interactGetNo...
001f59491ea18c2bdef64dc1cfb3a665b7746e2ffbd1b3ccabea254c15b37a45
MATLAB
9,123
234
function grad = yokogawa2grad_new(hdr) % YOKOGAWA2GRAD_NEW converts the position and weights of all coils that % compromise a gradiometer system into a structure that can be used % by FieldTrip. This implementation uses the new "yokogawa_meg_reader" % toolbox. % % See also FT_READ_HEADER, CTF2GRAD, BTI2GRAD, FIF2GRAD...
651a265710a789fddd45424a407f5c23721e75743d29b4399c964828562d3a3f
MATLAB
9,126
207
clc ManualMark_on=get(handles.cue_channel,'Value'); if ManualMark_on>1 if isfield(passdata,'cal') && isfield(passdata,'cue') if isfield(passdata,'correction_data') if ~isempty(passdata.correction_data)&& ~isempty(passdata.cue) t=passdata.interval_cal*(1:1:size(passdata.cal,1)); ...
b26144b4849cd55996a07701aecdb7f2e6e55c6c996b879fd9b05444c9b3eb3c
MATLAB
9,127
255
% plotNormCondLegStepParam_allFlies.m % % Function that takes output files from saveLegStepParamByCond_fly() and % generates a plot of the legStep param for each leg. Plots mean +/- SEM % for each fly. Different conditions in different columns. Points from the % same fly are connected by lines. % Select output fil...
aa3e9a95544c7b600fd97a4a336b62b531f332ba435c8f8e308f2f7aa5df1ada
MATLAB
9,138
230
function [recall, precision, info] = vl_pr(labels, scores, varargin) %VL_PR Precision-recall curve. % [RECALL, PRECISION] = VL_PR(LABELS, SCORES) computes the % precision-recall (PR) curve. LABELS are the ground truth labels, % greather than zero for a positive sample and smaller than zero for % a negative on...
888bc1161dff6b2cb227ce5b14e300d3fbc384ad79988bf7ea24117814440960
MATLAB
9,148
366
function train_opts=gen_net_opts_model_type1(run_config, class_info) train_opts=run_config; train_opts.eva_param=gen_eva_param(run_config, class_info); train_opts.get_batch_ds_info_fn=@my_get_batch_ds_info; train_opts.epoch_model_cache_fn=@my_epoch_model_cache; train_opts.batch_disp_step=0.2; train_opts.net_run_ver...
d39bef6d7babe971a62b89cd5ad2fae6c522987a72b97bdae532372c26c2af97
MATLAB
9,163
220
function [perCell, total] = mltp_compute_bfo_general(obj, session, rotDeg, mirrorContexts) % mirrorContexts should be the same length as the number of contexts % an entry of 0 means do not mirror, and 1 means to mirror % this is used because often context 2 has the reward cup mirrored % Allow the f...
16634b56b92156678de176f351125a37599414ba4e6878a5c7d9bd0d16d1de1e
MATLAB
9,173
206
%function [Spikes,nose,Fs]=getSpikesOF(File); %getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct %2016 % %1. parse the data according to gaps in Timestamps (> 1s) %Session_str, e.g.,'20150906Thalamus36\20150906Thalamus36_1to...' % %Spikes{Nelecs,Nunits}, cell holding spike times in ms fr...
8d1f262326508c1d772fe2e3b1ec6168f50da225ba171a4430385bbcdb18d7a3
MATLAB
9,176
179
function [] = PlotValidateBehavioralMappingExperimentGroup (TestLNPStats, LNPStats, meanLEDPower, stdLEDPower, L, density, xx) %Takes in structure LNPStats and plots them depending on the settings; not used in paper % Detailed explanation goes here fps = 14; BTA_seconds_before_and_after = 10; BTA_seconds_...
db75250db95102d56435c9d003d292854a26d6b722dcf5bc066a64f870084cf7
MATLAB
9,189
297
function [out,scale] = physicalunits(arg1) % PHYSICALUNITS converts PhysDim inte PhysDimCode and vice versa % according to Annex A of FEF Vital Signs Format [1] % % HDR = physicalunits(HDR); % adds HDR.PhysDim or HDR.PhysDimCode, if needed % % PhysDim = physicalunits(PhysDimCode); % converts Code of PhysicalUnits...
dd968fe70808a88b396d6d6fcc884ff828f61ee225cf6d09bbf899b1ea8bbf68
MATLAB
9,189
259
% plotHeatmapEphysVYawVelBinFwdAcc.m % % Function to plot output of getCorrelationEphysFwdAccYawVel_cond_all() or % getSlideWinEphysFwdAccYawVel_cond_all() as heatmap. % Plots yaw velocity on x, forward acceleration on y, normalized spike rate % in color. Mean spike rate for that yaw velocity+forward acceleration bi...
e7a74b0125174e20b50eeb6e90c61e69fbc5210ff3de9cf3f14cf07031327f66
MATLAB
9,193
215
function params = VOR_Default(params) %{ VOR_Default This script takes information stored inside of an smr file and 1) preprocces it 2) run the default sine analysis script This is a modified version of Hannah Payne's script 'runVOR'. Requires three files to be stored in the current folder 1. '.smr' data f...
fa51b098ea376b802ab43ef4a490752c105a4736958b33bbc4248eba58dc2739
MATLAB
9,193
307
function varargout=correctZilluminationInDirectory(sectionDirectory,outputDirectory,verbose) % Correct illumination of different optical sections in a physical section % % function stats=correctZilluminationInDirectory(sectionDirectory,outputDirectory,verbose) % % Purpose % Imaging deeper in a physical section results ...
04d6e94318a298f652db75d358c8013e6c183d5bf36a35c2580a845ce709b50e
MATLAB
9,196
335
function [succeeded,savename,trx] = convert_units_f(varargin) setuppath; fps = 20; pxpermm = 4; % parse inputs [matname,matpath,moviename,ISAUTOMATIC,trx,savename,dosave,readframe_fcn] = ... myparse(varargin,'matname',nan,'matpath',nan,'moviename',nan,'isautomatic',false,... 'trx',[],'savename','','dosave',true,'...
dce56c0d412ebef0f8df25b181b73d89588493c12ddc0a74d15f8048e783716b
MATLAB
9,197
222
%This script allows the user to pick a watershed region in a t-SNE map and %finds when the animal stays in that region and plots their behaivor, not used in paper %% STEP 1: establish plotting constants N_rows = 4; N_columns = 4; N = N_rows*N_columns; fps = 14; frames_before = 1.5*fps-1; frames_after = 1.5*fps; durat...
c5405eceb4d6bdd7019ca18be8f60bbee861eddb30be9ba964064584c2452388
MATLAB
9,204
225
% This script accurately computes and displays electric fields sampled on % a cross-section (transverse plane) via the FMM method with accurate neighbor integration % % Copyright SNM/WAW 2017-2020 bem4_define_planes_big; bem5_figure_scales_big; %% Load/prepare data planeABCD = [0 0 1 Z]; % Equati...
629df15b94f0a6f546c6b1bafa9a894a80005729d372163f85ac9735cc9613d7
MATLAB
9,213
283
%% Figure2 plot of HR and Rossler stochastic dynamics % for paper "Inferring stochastic dynamics of complex systems", T.-T. Gao, % B. Barzel, and G. Yan % Code before line 159 is about HR system, and after line 159 is about Rossler system. % If user want to generate HR(or Rossler) system's results, please comment % o...
c53095685e1c8f8826e34d7472eb6cb8c0c5bbd2e8190a537eca3ae1782e18dc
MATLAB
9,213
318
function varargout=sigstar(groups,stats,nosort,Yloc) % sigstar - Add significance stars to bar charts, boxplots, line charts, etc, % % H = sigstar(groups,stats,nsort) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The user specifies the gro...
16e935e0e4310a0eb5e53d7c5f5382a22e3b46ebd71ca3fe17581dddc2e15b6d
MATLAB
9,219
255
% getCorrelationEphysContParam.m % % Function to extract correlation between spike rate or median filtered % membrane potential and one or more continous parameters (from continuous % estimate of step parameters or FicTrac variables. If more than one % parameter is chosen (i.e. more than 1 parameter and 1 leg), cor...
42a147629675719bcc115c3131d6c583bf19c9127f5a7e9bc1c83b880cbcb9cc
MATLAB
9,231
207
%% Define all three planes (m) X = 1e-6; % YZ Cross-section position, m Y = 1e-6; % XZ Cross-section position, m Z = 200e-6; % XY Cross-section position, m delta = 70e-3; % 3e-3; % half plane window, m xmin = - delt...
bca1b0b9ec87c7d5f6d327f4dd3583b10472369bca354e980a29a6aae70564dd
MATLAB
9,233
242
% saveSpikerateCond_bouts.m % % Function that saves spike rate over time for turning bouts, defined by % yaw velocity peaks. User can specify FicTrac conditions that yaw % velocity peaks must meet as well as the initial forward velocity range % and the change in forward velocity between the start and peak of the % ...
c869c7c0073dd2ff3fb8f6ce50c5cbbad23cec9c3aa58fa7dcbf0252663d10e0
MATLAB
9,236
178
%% calculates the cross-sectional strain distribution induced during micro-fluctuations of accommodation in the living human crystalline lens addpath([pwd '/peak_interp']) namtag='20to25years'; % name of the result files folder='xxxx'; % path to the results folder for jj=1:size(complx1_aligned,2);mtrx_aligned(1:size...
814a586be080817d48ad51eaef952c50819468be5cc350fefdb6c8f84529ac65
MATLAB
9,237
244
function festr = fillExport(propertyNames, RawClass, parentName) exportHeader = 'function refs = export(obj, fid, fullpath, refs)'; if isa(RawClass, 'file.Dataset') propertyNames = propertyNames(~strcmp(propertyNames, 'data')); end exportBody = {strjoin({... ['refs = export@' parentName...
c6e1504b02610466b943df928b3009a93ceb909b9249c005277e3f1d23303835
MATLAB
9,242
243
classdef NwbFile < types.core.NWBFile % NWBFILE Root object representing data read from an NWB file. % % Requires that core and extension NWB types have been generated % and reside in a 'types' package on the matlab path. % % Example. Construct an object from scratch for export: % nwb = N...
6cb118107b75ebc6f070a15c808759dad7cbfbbacb3a5fc0d8a1d78e0efb6d8f
MATLAB
9,243
369
function [maps_out,tmap_th,H] = aedes_fmri_analysis(DATA,varargin) % % This function does a quick fMRI analysis in SPM style. No motion % correction or slice timing at this time... % % Defaults TR = []; contr = [1]; onset = []; durat = []; smooth_kernel = []; d_cutoff = []; % Don't temporally filter data by defau...
54d062d8aefa840bcdb2d0135898939f8fd2a60efbb0bbf49e9151f8fe061e75
MATLAB
9,251
258
classdef BoundPipe < types.untyped.datapipe.Pipe %BOUND Represents a Bound DataPipe which must point to a valid file. properties (SetAccess = private) config = types.untyped.datapipe.Configuration.empty; pipeProperties = {}; stub = types.untyped.DataStub.empty; end prop...
0e17c23d102890d9b320582bfefd8b8467d8eff207631bf51dfb31ce6c17cbce
MATLAB
9,269
264
function varargout=collateAverageImages(theseDirs,deleteOriginalDir) % Loop through data directories and use saved average files to create grand average images % % function collateAverageImages(theseDirs) % % PURPOSE % Create the grand average images that can be used for background subtraction. % Over-writes any existi...
941edf8a274aba5ec578464aacb02f55e55f6d2853e58b1b1859f304c56e06ed
MATLAB
9,269
292
% SUPPLEMENTAL FIGURE 2 %% LOAD FIXED OUTCOMES if ismac load('/Users/christianpotter/Desktop/Analysis/pop_analysis_potter2023/fixed_outcomes.mat') else load('C:\Users\Runyan1\Desktop\Desktop Code\dimred_event_analysis\pop_analysis_potter2023\Figure 1\fixed_outcomes.mat') end %% PLOT INFO ABOUT COMBINATION CO...
b6bd38c900f09c56f04197aab00ee18feacfe4207cc2253b213ecbef094be188
MATLAB
9,275
181
function ds = createDataTable(projectDir,subjnrs,postFix) %% Function to create voxel data table: % NOTE: Requires running s_prepareDataForPlotting.m % % INPUTS: % projectDir : base folder where cloned code repo and downloaded data live % subjnrs : subject numbers (as in the fMRI experiment) % postFix : fixed se...
1684913dfa60263799fd2bb2642c541f8bdf3b8094264bcce9270f7bc0c20a87
MATLAB
9,277
325
% Generate figure 3 %% Load data experimentfilename = '/data/experiment_XOR3S2T_0920_ETA=64_VIT=40_[2S2T2G]_23-09-20-15-31-46.mat'; load([cd,experimentfilename]); % cd gives current directory EXP = experiment; addpath([cd,'/helper_scripts/']) %% Set configurations for figure bxlim = [10^-3,10]; selectti...
51f920539b1a2e2005bfd7f62a2d96aece2ea1729592924955deb781cf581915
MATLAB
9,281
302
% f_GetSignalsNico % function [m_EEGSig m_ECGSig m_RespSig] = ... f_GetSignalsNico( ... pstr_FullPath, ... pstr_EEGSigStr, ... pstr_AveStr, ... pstr_ECGSigStr, ... pstr_RespSigStr, ... ps_FirstSam, ... ps_LastSam, ... ps_ScaleData) if nargin < 2 error('[f_GetSignal...
ab052c8914e3599049481972db8b528e0dedb3e100528f15b676b019d61d226d
MATLAB
9,286
207
showfigs = 0; %% Define all three planes (m) X = 1e-6; % YZ Cross-section position, m Y = 1e-6; % XZ Cross-section position, m Z = 200e-6; % XY Cross-section position, m delta = 3e-3; %77.5e-3; % half plane...
0710b4b17f5295a7444f0c45ca55de53bc99cbb881cf467a220b4fbf672ec1eb
MATLAB
9,295
214
function buildToSpike2(ops) %% this function will take a channel of waveforms in either a .txt % or .mda format and add it to an existing .smr file % % See 'options.m' file for various things like file location and initial % sorting method % % - waveform data should be in SAME FOLDER as smr file % - waveform d...
a65ee1694db5197ee5a401c5363992924a37b6e55c9c81bdd44c7a4b8aa99e2f
MATLAB
9,302
310
function Out = aedes_rotateflip(DATA,squareImages) % AEDES_ROTATEFLIP - GUI for rotating and flipping files % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Nis...
f3dd4a0a7852abbbf000c58e29a5c9832137457dd5613b59218e3d8faebb69e2
MATLAB
9,311
245
function [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord) % READ_NEURALYNX_NCS reads a single continuous channel file % % Use as % [ncs] = read_neuralynx_ncs(filename) % [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord) % Copyright (C) 2005-2007, Robert Oostenveld % % This file is part of Field...
217c117bab5867b1c0b88609f5a00a111a39dfca8072929a83c54c83fccb813d
MATLAB
9,331
256
% Auto-correct potential identity swaps of tracked flies. % % To auto-correct identities, use: % % trk = track_auto_id(trk) % % where: % % trk. - tracking structure obtained from tracker_jobs % names - names of fields in .data % data - n_flies x n_frames x n_fields containing raw trackin...
0e68ae2c09c3bce1163734f4abe3a55a063273e3ad7f60f2121f42e10d77968e
MATLAB
9,332
330
clear all close all clc % Calculate ID scores of interest for the ISTART project.. % Daniel Sazhin % ISTART % 12/09/21 % DVS Lab % Temple University %subjects = [1002, 1004, 1006, 1007, 1009, 1010, 1011, 1012, 1013, 1015, 1016, 1019, 1021, 1240, 1242, 1243, 1244, 1245, 1247, 1248, 1249, 1251, 1253, 1255, 1276, 1282,...
3cc125d87f75d54cf283c87c6cd95d1a4a4553229b972c24a6956e653b84a4c0
MATLAB
9,348
153
% run amapOFshow clear all; runMode = 'batch'; close all; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; DATA_TYPE = 'OF'; %DATA_TYPE = 'EM'; PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ; %PLOT_TYPE = {'map'}; % {'map'}, {'trajectory'}, {'tuning'}...
e2ca4388b5357e583811b2a50f4b97ec8cee913ed1a3757271c3f3190120ed88
MATLAB
9,352
208
clearvars -except num_meta_tr ff_values tempi value_list valuei value close all %% Parameter initialization run('spiking_parameters_simple_dopa.m') %most parameters are stored in this file plot_var = 0; %% main program Ach = zeros(1,t_total/dt + dt); for l = 1:num_trials tic %% initialization [v_i...
9062963069d725b5cf865d89f9f048d1f7117f92f77217211919e7e3a43e74ea
MATLAB
9,359
270
function [awf, eas, ias] = wmti_parameters(dt, mask) % Calculation of the white matter tract integrity metrics % % ----------------------------------------------------------------------------------- % please cite: Fieremans, Els, Jens H. Jensen, and Joseph A. Helpern. % White matt...
1f23514477de132364fb5baca49cffef4a23a1642d9d4364e0eae60305add599
MATLAB
9,363
268
%__________________________________________________________________________ % violin.m - Simple violin plot using matlab default kernel density estimation % Last update: 10/2015 %__________________________________________________________________________ % This function creates violin plots based on kernel density e...
c70d1ff9772b79ca63188f433f348e4ffde029670154a7d2e2958a2133d25a5a
MATLAB
9,377
265
function ft_write_event(filename, event, varargin) % FT_WRITE_EVENT writes an event structure to a file, a message daemon % listening on a network socked, or to another computer connected through % the serial port. % % Use as % ft_write_event(filename, event, ...) % % The first argument is a string containing the fi...
09e786d2eb9ce3f21c66ce653786336bb7d840ef4df7e816b28f9e9d73670127
MATLAB
9,384
227
clc if get(handles.EditInputMark,'Value')==1 if isfield(passdata,'cal') && isfield(passdata,'cue') if ~isempty(passdata.cal) && ~isempty(passdata.cue) t=passdata.interval_cal*(1:1:size(passdata.cal,1)); color=['r','g','b','c','m','y','k']; axes(handles.DataPreVie...
4355d405d2a52e3fa94f38d444a0a636f8724c78f7c27fb8cd95776ca47befba
MATLAB
9,385
258
clear clc close all main_folder=('/projects/LEIFER/Sandeep/APIData/20200831_RunRailsTriggeredByTurning_Sandeep_AML17_AVA_10ulRet/Data20200831_162748'); %% main folder path filename='workspace_data_20200831_162748_80uW_5sec_turning.mat'; load(fullfile(main_folder,filename)); %% save the workspace data inside the main f...
72efddaf5ef3052a2fc5ed8eb941741bc641892de0d5780c77f1b59f87a6d6e0
MATLAB
9,386
259
% plotOptomotorOptoDiffLegStepParam_allFlies.m % % Function that takes two sets of output files from % extractOptomotorLegStepParamsOptoCond_fly() and generates a plot of the % difference in the specified legStep param for each leg, across the two % sets of data. Matches across flies. Plots mean for each fly as %...
9d66fb8d6e292ff63f985d963ca2c023ebd8ccaf6c3e808279bc70dabf314e68
MATLAB
9,399
154
% run amapOFshow clear all; runMode = 'batch'; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; DATA_TYPE = 'OF'; %DATA_TYPE = 'EM'; PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ; %PLOT_TYPE = {'map'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'t...
50c4932d6a3931834c1f17677868a2f688fce04a71666bb691f4fb2023b86e6c
MATLAB
9,409
157
function [data_struct, parameters, raw_data] = importEyetrackingData(filename, opt) %IMPORTEYETRACKINGDATA Read the contants in a file and save them as a table % The expected input is a filename and an option list. The file must be a % .tsv file with a comma as decimal operator. It is designed specifically % for ...
0fc81aaa4a176eac4cde8edc85a5d8758dea330e9559c1f5879d5778a504de9f
MATLAB
9,410
227
% This script accurately computes and displays electric fields sampled on % a cross-section (transverse plane) via the FMM method with accurate neighbor integration % % Copyright SNM/WAW 2017-2020 bem4_define_planes_zoom; bem5_figure_scales_zoom; %_alternative; %% Load/prepare data planeABCD = [0 0 1 Z]...
5ffe10818dfd37622b5e38a153c462365afa4f945a51c4d911fb92aeb983fa8a
MATLAB
9,410
351
function [kspace,data,msg_out]=epi_recon(kspace,Dat,procpar) % This is a custom VNMR k-space reconstruction code for EPI data used by % aedes_readvnmr. % If called without input arguments, return the sequence names that % this code reconstructs if nargin==0 kspace = {'epi_se_rapid_sp3','epi','epi_fMRI','epip','epip...
20b2c28b28ca453df385882f3565452355b1e5406374f589d2b1d906e2c5d684
MATLAB
9,415
200
function BurstDetection (peakfolder, end_folder1, end_folder2, end_folder3, nspikes, ISImax, min_mbr, cwin, fs, check) % Function for producing the Burst Detection files % INPUT % % OUTPUT % % by Michela Chiappalone (17 Marzo 2006, 12 Gennaio 2007) % modified by Luca Leonardo Bologna (10 June 2007) in order to handle m...
e9bf6535bed3dc6df4d285c1055f23a4ee5d1fa998691cfacee47dad9a8c4554
MATLAB
9,422
269
function [awf, eas, ias] = wmti_parameters_savedi(dt, mask) % Calculation of the white matter tract integrity metrics % % ----------------------------------------------------------------------------------- % please cite: Fieremans, Els, Jens H. Jensen, and Joseph A. Helpern. % Whi...
3ea1a084fa88be4eb2848b0abc55c57b365baafaba07829a0fb8fc4af4430d52
MATLAB
9,435
262
function [Sc,Tree]=hierarchicalConsensus(Ssample,varargin) % HierarchicalConsensus Compute hierarchical consensus partition. % % Syntax %__________________________________________________________________________ % % [Sc,Tree]=hierarchicalConsensus(Ssample) % % [Sc,Tree]=hierarchicalConsensus(Ssample,alpha) % % [S...
91014b40f3c3223d6bb6b9696a1f3b7b35cd5e2dbb4d022ea7c8f8b9ef5ea51c
MATLAB
9,441
273
function [type, dimord] = ft_datatype(data, desired) % FT_DATATYPE determines the type of data represented in a FieldTrip data % structure and returns a string with raw, freq, timelock source, comp, % spike, source, volume, dip, montage, event. % % Use as % [type, dimord] = ft_datatype(data) % [status] = ft_...
4519c9904aaadf2787a288fd7de93073a7b6fb7f4a0f1ed7ef4cfff6dd8bc211
MATLAB
9,454
229
% preprocessLegVidFiles.m % % Function to preprocess raw leg video .tiff files. % Call on date folder. % Does generates and calls powershell script for renaming .tiff files. % Does command line call to ffmpeg to generate .mp4 video file for each % trial with leg video data. % Generates powershell script and filelist ...
5d7703acae6638b4aab598b0a19925aece8f628f77f31f8af18129c5076b54aa
MATLAB
9,457
202
%%% author: SK %%% date: 28/03/2024 %%% reference :"Neural effects of dopaminergic compounds revealed by multi-site electrophysiology in mice and interpretable machine-learning" clear all; close all; clc; %%Specify the directory to save data save_dir = 'E:\WT Pharmacology Results 2023\SIFT 1KHz Arfit 10s5s'...
a7819ebf9256136af9a678d9866ad056dea8e02e5be81ce4cac635098db3d695
MATLAB
9,459
246
% saveSpikerate_bouts.m % % Function that saves spike rate for turning bouts, defined by yaw % velocity peaks. User can specify FicTrac conditions that yaw % velocity peaks must meet. % Extracts bouts that meet FicTrac conditions and accounts for timing of % step relative to yaw velocity peak % Extracts both right ...
c21b57c5eaa5520bc5b611f7ee85fc2c2f78e7c7363acd82727cd877815bbcab
MATLAB
9,472
278
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function make_stabilitybfo90_percell_formatted_for_sigmastats_separated(analysisSettings, analysisResults) % There will be numDays x 2 = 12 excel files created. % Each file has one days data, and either within or across. % Each file ...
1957cdf25de5c6a4bf4d204d9d06038722a236dc184700675aba81950e2e0d3a
MATLAB
9,474
178
%% Example pipeline going from raw Neuropixels data recorded with SpikeGLX to curated (with Bombcell) units identified with UnitMatch %% User Input %% Path information DataDir = {'H:\MatchingUnits\RawData'};%{'H:\MatchingUnits\RawDataMonthApart'};% ;%Raw data folders, typically servers were e.g. *.cbin files are stor...
5d4171915da20cc3661b8139dc42762b83309b99882084d911760161c26a9e24
MATLAB
9,488
182
function success = auto_resolve_problems(folder_name) % automatically resolve centerline problems addpath(genpath(pwd)) parameters = load_parameters(folder_name); %load experiment parameters if parameters.TrackOnly success = true; return end frames_around_problem_to_cut = param...
fcc4c7a397cfa4c1ded0d03ef863ce811df153b6180a0f4f1b810132333b2a3a
MATLAB
9,490
328
function fig_fMRI_QA(fMRIName,nan_FD, Xd, nan_DVAR_pre_reg, nan_DVAR_post_reg, nan_DVAR_post_all,path_ex_sum) %% This function shows gray plots and some extra info required for quick visual inspection of bold data % Oscar Miranda-Dominguez %silence warnings warning('off', 'all') [r c]=size(Xd); %% settings FDvlow_t...
569cb456210228ed62a3e909eb806ffd6ac8def372a64640018e3a2a284c9e0b
MATLAB
9,491
198
function [params] = simseq_loadstRetPRFParams(pths, hemi, roi, ... spatialModel, temporalModel, veThresh, hvol, subFolder) % Function to select pRF params from toonotopy experiment within ROI % cd to toon data cd(fullfile(pths.dataDirToon, pths.toon)) if ~exist('veThresh', 'var') || isempty(veThresh) veThresh...
c8d3b07b2b0c0a592af89b8732f47e4b7937e757dfa6674d2015dcdf793a341a
MATLAB
9,491
245
%averaging Open field data %Author: Maria Chernysheva %load the data close all clearvars clc %give folder with matlab functions folder_with_matlab_scripts = 'Y:\Chernysheva Maria\MATLAB\Matlab_scripts_AlloLight'; addpath (genpath(folder_with_matlab_scripts)) %give the folder with the data subfolders main_...
1b2845c9875205a0732d3a8dcba0c1bc9cf8f72421232169cc2f16affe5524e2
MATLAB
9,506
328
function postreg_fig_fMRI_QA(fMRIName,nan_FD, Xd, nan_DVAR_pre_reg, nan_DVAR_post_reg, nan_DVAR_post_all,path_ex_sum) %% This function shows gray plots and some extra info required for quick visual inspection of bold data % Oscar Miranda-Dominguez %silence warnings warning('off', 'all') [r c]=size(Xd); %% settings ...
a74740e21f6201a942c5728be9a5a8f77175c5c05cb9977c1167d5b9450482dd
MATLAB
9,516
175
%% s_prepareDataForPlotting.m % Script to prepare data for "createDataTable" function. Mainly combines % ROIs (like VO1 and VO2 into VO1/2) and single voxel pRF parameters with % single voxel model fitting results. % % Code written by E.R. Kupers (2024) Stanford University % %% Define params subjnrs = [1,2,3,7,8...
03a641473e7f65cfdc55242bc785cd01484c07438e5717f32266a9610ca9ab4a
MATLAB
9,522
251
function success = core_tracker_job_combine(output_per_chamber_track_file_name, ... output_segmentation_file_name, ... atomic_track_file_name_from_chunk_index, ... calibration_or_calibrati...