sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ed499a987465d53de4a83b4b7586473f93db7d1bcda6f2f5c21d9fbba9071fbe
MATLAB
4,645
148
function output=get_outputs(in_pial, in_white, xmin, ymin, zmin, scale, pialv,cclabel) M=(in_pial-in_white); M(M<0)=0; if isempty(cclabel) cce=0; else cce=1; end disp('removing voxels around corpus collosum') tic %remove any voxels in M on the cc (if info is available) %to do, M is currently not ...
bad01177bd3027bde3ea6dcc39305c00b35d16b493ab020e38105e8fd679fc2c
MATLAB
4,647
99
% permute group_labels of subnetworks % targetMetric_group: mean metric to compare to % allsub_fMRI_select: selected fMRI (total no of subjects along groups) % groupsize: size of each group % masks(): mask of subnetworks % % 2022-08-22 Jonathan Wirsich function counts_p = permute_subjectgroups(iter, b, ...
00693883f15f3d6fbd25e42b1eaade7b75b55d55da73e4e6d56be3b8c98f204c
MATLAB
4,648
136
classdef CSRMatrix < types.hdmf_common.Container & types.untyped.GroupClass % CSRMATRIX A compressed sparse row matrix. Data are stored in the standard CSR format, where column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. % RE...
4d11450c2da70feee72e9f91f899b244fb97d2511b19c9dbe4a227425a610a2d
MATLAB
4,648
167
function [psd_out] = interevent_psd(src_spk,start_events,end_events,boundSpec,psdopt) %interevent_psd.m % runs both uncorrected and shuffle-corrected psd poolobj = gcp; win_len_msec = psdopt.win_len_msec; psd_out.win_len_msec = win_len_msec; filterFRs = optCheck(psdopt,'filterFRs',false,[true false]); storeGMMinfo =...
5791e134cddcc1afeff8c72cdb3e84f3825071791639872bf12466d999a68e52
MATLAB
4,649
207
%% GET PCA VARIANCE EXPLAINED FOR ALL ANIMALS all_som_explained=cell(6,1); all_pv_explained=cell(6,1); pyr_explained=cell(6,1); numsom=nan(6,1); for ds = 1:6 curpv_ex=nan(6,1); curpyr_ex=nan(6,1); all_som_explained{ds}=all_pca(ds).som.explained(1:5); numsom(ds)=length(all_pca(ds).som.explained); ...
8ea6f8f25f458dbd7a21092251fcf0339104fab9cca6095897eea64f28627ab9
MATLAB
4,649
114
function cfg_artifacts=st_expand_artifacts_to_neighbours(cfg_artifacts) % ST_EXPAND_ARTIFACTS_TO_NEIGHBOURS expands grid-based artifacts to neighboring channels % % Non-artifactual channels are labeled artifactual when proportion of artifactual neighbouring channels >= channelexpandthresh. % Lower values are ...
952812be17012af0e212feb54014ff6a0d3252de4068b92ce2194b2bd636f9b3
MATLAB
4,652
130
function [F,acc,conf,SSWs,SSBs,F_rand,acc_rand,conf_rand,SSWs_rand,SSBs_rand] = test_stats(stg,projected_test,M_class) % gets the projected test set and centroids of the training sets, and % returns multiple cross-validation measures. % % [F,ACC,CONF,SSWS,SSBS] = test_stats(STG,PROJECTED_TEST,M_CLASS) gets the % p...
eeeeeb5b0cf0a88b313c7bbedb0368733bce826be1eebd28eab4d283c784c30a
MATLAB
4,653
155
function [] = ExtDataFig04_AveTimeCourse_OptStim_Song % Code for plotting the time course of and the proportions of pulse and sine song in Extended Data Fig. 4e,h. GT = 'dPR1'; % Extended Data Fig. 4e % GT = 'TN1SG'; % Extended Data Fig. 4h %% parameters nTrials = 3; nStim = 6; T = 1370; % T DAQrate = 10000; x1 = [0...
839d9a77c7f76c1b187cfa209d9b807903ea12d0710ff2a445deaee9c6c7317e
MATLAB
4,654
153
function config = vl_override(config,update,varargin) % VL_OVERRIDE Override structure subset % CONFIG = VL_OVERRIDE(CONFIG, UPDATE) copies recursively the fileds % of the structure UPDATE to the corresponding fields of the % struture CONFIG. % % Usually CONFIG is interpreted as a list of paramters with their ...
b8730381ac5f2398562ac563d74bbd44d3c81c4991a08eecb3ae7c7919603670
MATLAB
4,654
126
% ficTracSignalDecoding.m % % FICTRACSIGNALDECODING takes a fictrac position value and extracts ball % velocity. This function will take a FicTrac output signal as aquired by % the DAQ as an analog signal and solve for the ball's angular velocity in % the given dimention. To do this the signal is then UNWRAPPED to...
e2cf4dbae011eee3381a1799e30d3a673c624242a973fbd41d16c75d621c835d
MATLAB
4,654
157
%% function varargout = eyecam(vid, eyetrack, nframes) if ~exist('eyetrack','var') eyetrack = 0; end if ~exist('nframes','var') nframes = 180*30; end himg1 = []; himg2 = []; % Preallocate arrays for storing time time1 = zeros(nframes,1); time2 = zeros(nframes,1); time3 = zeros(nframes,1); % Start recording!...
a254bb247910827c3c079b97abbf66e1af4490f57ec7c1de48161a6efaa17c51
MATLAB
4,657
96
function [x, TFI_params] = delta2chi_TFI(deltaB, D, DPWeight, mask, TFI_params) % [x, TFI_params] = delta2chi_TFI(deltaB, D, DPWeight, mask, TFI_params) % % Auto-TFI method using Gaussian Newton's method (NGCG) % with auto determined P_map, plus Tikhonov regularization as in LN-QSM % Ref: Liu et. al, 2020, 83, 271...
5ba95489e741db5319421af0432a79efda735035e853952fa5445396cf7474b6
MATLAB
4,660
129
% zipFfmpgFictracVid.m % % Function given trial with FicTrac video, generates .mp4 file from % individual tiffs and zip file of same tiffs for that trial. % Called by preprocessFictracVidFiles(). Does not stand alone. % % INPUTS: % inputParams - metadata about trial, loaded from saved data % scriptsPath - full p...
8537475e8b0d677b4d46c5d495bb1d962b7e1827ac7bdaeab738f92eae5593df
MATLAB
4,666
81
function [] = D5_Conditions_HLM(badSubs) data_folder = 'Z:\Load\MEG Data\proc_data\'; %Windows save_folder = 'Z:\MATLAB\Perceptual_Load\FieldTrip\Results\group_level\Lateralization_indices'; load 'Z:\MATLAB\Perceptual_Load\FieldTrip\Results\group_level\Alpha\ROI_alpha\ROI_dt_attRight_nl' load 'Z:\MATLAB\Perceptual_Loa...
cc1c508dccc22a9fb52a9a665452129f89eb723cbe682181939593a66c5115eb
MATLAB
4,672
165
close all clear all clc minDistance = 10; %a = 100; %poly = [0 0; a, 0; a, a; 0, a]; a = [0, 20]; b = [0, 0]; c = [30, 0]; d = [30, 20]; refCanPts = [a(1), b(1), c(1), d(1); a(2), b(2), c(2), d(2)]; poly = refCanPts'; figure plot(poly(:,1), poly(:,2), 'b-*', 'linewidth', 10) hold on plot([poly(1,1), poly(end,1)], [...
6741469b493d125e29b0bfe02bab9809043adff981714fb9ea0ebdc206cb3238
MATLAB
4,673
154
% mglCameraCapture.m % % usage: mglCameraThread(<commands>) % by: justin gardner % date: 10/14/2019 % purpose: Function that starts and interacts with a thread so that we can interact % with an FLIR camera asynchronously. % % First you start the thread which initializes th...
bdf8a7b4789b734538b1668ef88d02c70fa6eb22330b8ef89fa8c425bd67b879
MATLAB
4,674
144
% Code to produce supplementary figure to figure 2 clearvars close all load("colour.mat") % load AUTO data load('KpLCr1.dat') load('KpLCr2.dat') % identify the stability of equilibria Stable=zeros(length(KpLCr1),4); Unstable=zeros(length(KpLCr1),4); for i =1:length(KpLCr1) Stable(i,1)=KpLCr1(i,1)...
219e5c6e015a6292efabb21645ba8b75145818884ee87b5819975833e4a98ff5
MATLAB
4,678
116
% mglTestMirror.m % % $Id: mglTestMirror.m % usage: mglTestMirror() % by: ben heasly % date: 09/01/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Demonstrate usage of "mirror mode" graphics windows. % % This script demos mgl "mirror mo...
b4cbe2f3c822b539f9474e24bdb22833a8729d4c9b1e69296952b41685183c7b
MATLAB
4,681
69
function psf_params = check_psf_params(psf_params) % psf_params = check_psf_params(psf_params) % % This function checks the elements of the struct psf_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - psf_params - Struct conta...
028d27456c03a4c9550a10e540605922cb7e1bb853130d6d782b13c1861d033a
MATLAB
4,682
122
% Fig 9. Benchmarking analysis results for model levels % 9b. Binarry Classification % 9c. Regression %% Set up clear; clc; % Load Data basedir = '/Users/donghee/Documents/project'; % set a path to local project directory githubdir = '/Users/donghee/github'; % set a path to local git directory for external codes ...
7af5029e60dcff696e762714445a5501cadb9c8cdaafe2395bba2abcaccd012e
MATLAB
4,682
110
% findVelZeroXing.m % % Function to find zero crossings in velocity, while specifying a minimum % number of samples spent between zero crossings. % Finds zero crossings after removing not-moving times, which would % otherwise confuse zero-crossing calls % Specifies whether zero crossing is with velocity going negati...
0581d0a4b3d95b9ac385d2ca20ef069e7abc82a41a85b42e5eb499f1fe180a43
MATLAB
4,683
151
% plotAvgFictracVImg.m % % Function to plot output of moveCondPairData() as FicTrac param v. dF/F. % Plots average across flies and/or individual flies. Plots data only from % moving time points % % INPUTS: % whichImg - which imaging data to plot ('diff', 'sum', 'right', 'left') % whichFictrac - which FicTrac par...
f5eabd6ba181483404c30c8558c9af9d4c0327e617073a75f7626786d184d641
MATLAB
4,684
145
function [obj, overall]=confMatPlot(confMat, opt) %confMatPlot: Display the confusion matrix % % Usage: % confMatPlot(confMat) % confMatPlot(confMat, opt) % % Description: % confMatPlot(confMat) plots the confusion matrix of classification result. % confMatPlot(confMat, opt) labels the class names along the confusi...
89be8c0883a93e5d5aa23d98ea0f27790164e3ea372200778e7779f5133f53b2
MATLAB
4,685
157
function [psd_out] = one_event_shuf_psd(src_spk_vec,stevt,endevt,psdopt) % one_event_shuf_psd.m win_len_msec = psdopt.win_len_msec; psd_out.win_len_msec = win_len_msec; assert(mod((endevt-stevt)*1000,win_len_msec) == 0,... 'this function assumes that mod(duration,win) = 0') src_spk = toCol(src_spk_vec); % histo...
3034e1ba7b1d3c978a8ea267a74cdc88d88a7330054c8c989ca245ac79c4121a
MATLAB
4,686
150
% tickScreen.m % % $Id$ % usage: tickScreen % by: justin gardner % date: 12/10/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: flip screen and update counter - for mgl % function [myscreen task] = tickScreen(myscreen,task) %%%%%%%%%%%%%%%%%%%%%%%%%%% % get back ti...
bcf5dc18fc08dd835f49e58caac39cd672c143697cd37dd949248bc6b6796d9a
MATLAB
4,687
141
%-------------------------------------------- % Function onoffdiff % Input: onewave - boolean matrix of size n_neurons x t_wave x 2 where % onewave(i,t,1)=1 if neuron i is in upstate at time % t and onewave(i,t,2)=1 if column i is in downstate at % time t (note: there ...
86175b07701d4eb9d2add2005b3d8d61a06654ac1b37b1eadfd872ee74d6c9cc
MATLAB
4,689
108
function CaptureFigVid(ViewZ, FileName,OptionZ) % CaptureFigVid(ViewZ, FileName,OptionZ) % Captures a video of the 3D plot in the current axis as it rotates based % on ViewZ and saves it as 'FileName.mpg'. Option can be specified. % % ViewZ: N-rows with 2 columns, each row are the view angles in % deg...
270927ebc3ad86b0036e4ec27d938b19ba1234368df4a617514a66bf23325d1a
MATLAB
4,691
142
function [unwrappedPhase, PhaseLaplacian] = phase_unwrap_laplacian(dataPhase, Params, RefVox, zp, padsize) % [unwrappedPhase, PhaseLaplacian] = phase_unwrap_laplacian(dataPhase, Params, RefVox, zp, padsize) %================================ % HEADER %================================ % % Name: phase_unwrap...
c7a66861a154ed18e862c2fcf19a2ada3226896069a435e557f9ef9bc8733895
MATLAB
4,691
103
%% This script computes 6 parameters for current injection protocol (CC_inj) % ================================================== % Authors: Arash Samiee, Knut Kirmse % last modification: 02/2023 % ================================================== % How to use: % (1) Specify parameters % (2) Run the script % (...
d860e31cdd0b45bd4258c2ccd51cb4248f22b27a0a00371d728e0099c981958e
MATLAB
4,691
79
% matcfs32.m % routines to access cfs files from Matlab 6.x, 7.x % code switching originally by Mario Ringach % by JG Colebatch v.1 Nov 2005 read only % 12 Feb 2009 finished write routines. % other mods required due to Matlab using double as standard % see CFS Filing System guide from CED Ltd www.ced.co.uk % 1....
a77c655596bd4670cb3773ce9e944c17a161372f07ebbf24eb85ab4135d7cf03
MATLAB
4,693
111
function vars = PLOT_AlignedTraces(app, vars) %% Align channels vars = alignChans_APP(vars, vars.chosenShiftVal); veltau = .01; %% load data loadAnalysisInfo_APP; %% Prep Video vid.pos_data_upsampled_aligned = cumtrapz(vid.vel_data_upsampled_aligned)./mag1.samplerate; vid.pos_data_upsampled_aligned = vid.pos_data...
07e7aaa83d80000e10433d722e8a21b0bd1f4ac307f44615ed2fc80230ab25ed
MATLAB
4,696
117
%% Paths and Parameters% set values and parameters SUB = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]; MASK = {'HG_LH','TPJ_LH','HG_RH','STS_RH'}; startTR = 30; endTR = 270; nTR = endTR-startTR+1; % parameters to optimize: % define interval lengths interval_length = [10,20,30,40,60,80,120,150,180,210,240]; % load ...
b726f8821eb526861f8425eee2ee7177cbd416abb51967b61b7dbaeb47a81011
MATLAB
4,702
109
function design_mat = fact_des_ttest1(stud_dir, subj_file, MS_file, img_path, cov_names, stat_suff) % _ % Create batch for factorial design one-sample t-test analysis % % stud_dir - study directory in data/analyses are located % subj_file - an XLS file containing subject IDs and covariates % MS_file ...
d2a45a09a281898b7ff27a37d9bfd291ca28e8abab49b5e13a79fd1687e4e8ad
MATLAB
4,703
111
classdef ExternalLink < handle properties filename; path; end methods function obj = ExternalLink(filename, path) obj.filename = filename; obj.path = path; end function data = deref(obj) data = cell(size(obj)); ...
9eb4a9a5bde8a6d22bc03704abb796bf6adb00ee17ac944e5ca6c8b63490a50d
MATLAB
4,704
150
% tickScreen.m % % $Id$ % usage: tickScreen % by: justin gardner % date: 12/10/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: flip screen and update counter - for mgl % function [myscreen task] = tickScreen(myscreen,task) %%%%%%%%%%%%%%%%%%%%%%%%%%% % get back ti...
78929ee25eae140aaa6e0576ecb07f31459e832e4a58a45bfb3f99ec1df265e0
MATLAB
4,708
151
function My_dpca_plot_default(data, time, yspan, explVar, compNum, events, signif, marg) % Modify this function to adjust how components are plotted. % % Parameters are as follows: % data - data matrix, size(data,1)=1 because it's only one component % time - time axis % yspan - y-axis spab % expl...
84a98caab23b5ef85080ea2d261326cbe7ae26ad39e549a713153cb2312cd40d
MATLAB
4,709
123
function res = safetytest(frequency, duration, amplitudes, trials, waitperiod, pairs) %function res = safetytest(frequency, duration, amplitudes, trials, waitperiod, npairs) %SAFETYTEST automatic safety testing for DARPA stimulation tasks % Takes the parameters for the desired safety testing and implements the % ...
6c179245f6d25c379e54683df4649f0b92d05ccd0ae278b81a0f3a4110264d55
MATLAB
4,712
129
% getFictracFromDat.m % % Function to extract FicTrac data from .dat file output by FicTrac instead % of from DAQ output % % INPUTS: % datFilePath - full path to .dat file % daqData - struct of data from experimental DAQ, processed by % preprocessUserDaq() % daqTime - % % OUTPUTS: % fictrac - struct of...
f9d9279bdc74995257cf887d702c72538848a9c17f569419f540ba988afd96c6
MATLAB
4,713
120
% mglMetalCreateTexture.m % % usage: [tex, results] = mglMetalCreateTexture(im, [minMagFilter, mipFilter, addressMode]) % by: justin gardner % date: 09/28/2021 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Private mglMetal function to send texture information % ...
c2a47942db39671de002e455275d923ea131a5db3a7f25b67f498cd20c0843d1
MATLAB
4,714
168
%% Analyze simulation results clear restoredefaultpath filePath = matlab.desktop.editor.getActiveFilename; root0 = fileparts(filePath); addpath(genpath(fullfile(root0,'lib'))); root = fullfile(root0,'data'); %% Karger model fitting load(fullfile(root,'simulation_results.mat')); tex_fit = zeros(3,3); K0_fit = zeros(3...
5ac8285f3fdefeba81d0d6403a3e0804a5ff6da57fdc0280b888db4224f98e44
MATLAB
4,715
169
function [] = Fig07_AveTimeCourse_OptStim_Song % Code for plotting the time courses of pulse and sine song in Fig. 7c. % GT = 'pIP10_Chr'; GT = 'dPR1_Chr'; % GT = 'TN1_Chr'; % GT = 'pMP2_Chr'; switch GT case 'pIP10_Chr' Target = [3,4]; case 'dPR1_Chr' Target = [7,8]; case 'TN1_Chr' ...
551f84ff66f1f9f24a66dd43e2ea485f5a972c4f5150065faa8d125895d971f5
MATLAB
4,718
97
function text = curlConfigText(cfg, micID, source, zipPath, connectTimeout, maxTime, nullDevice) % Text of a curl -K config file that uploads the zip, as postZip does in-process % % function text = webupload.curlConfigText(cfg, micID, source, zipPath, ... % conn...
227c3c09965e53724396445968686614d10d697383193afd6db518c81b165e56
MATLAB
4,719
160
%FIGURE3 %% LOAD DATA base = 'Z:\Potter et al datasets\'; event_frame = 120; %load('Y:\Christian\Processed Data\Event Analysis\standard_ds_onsets.mat') base= '/Volumes/Runyan/Potter et al datasets/' %% GET MEAN ACTIVITY [pyr_mean_activity,som_mean_activity,pv_mean_activity,velo,acc] = get_mean_activity(base,ds_events,e...
6e2fe25b735ea8a1d5cf9cc7b67491846be2e0db590ed6d763b071ed9ec1ea44
MATLAB
4,719
133
%% to restart everything clear variables close all; clc; cond = 'dd'; %% Load necessary code % paths to store the plots in basepath='.../MatlabCode'; cd(basepath); % path where the variables/output are stored savepath = '.../data/processed/EEG'; addpath('.../data/processed/EEG'); % load EEGlab addpath('.../Matlab-...
d0bf2edf4504dea53525738e83ec77be736139e36aededcdd912e03770cb0639
MATLAB
4,722
154
function [trainedClassifier, validationAccuracy,rel_score] = trainClassifier(trainingData, response,class_names,class_type,varargin) % ** varargin relates only to using decay % Returns a trained classifier and its accuracy. This code recreates the % classification model trained in Classification Learner app. Use the...
6afe3e2c24fff7780c18f7180ab7882942d0456b9e93e33b32cda84d6399099e
MATLAB
4,727
111
function [ parsing_status, text ] = loadFile( obj, file_pathname, filename ) % Parse data from json file. % % Syntax: % [ parsing_status, text ] = LOADFILE(obj, file_pathname, filename); % % Input parameters: % * obj - object containg data % * file_pathname % * filename % % Output parameters: % status % ...
f4ce96c1461dc0a3c9d9503c0dbf9abea8823b08ce6a72b89fe9f5b89e2d6559
MATLAB
4,729
103
% mglReadCommandResults: Read a results struct for Mgl Metal commands. % % usage: results = mglReadCommandResults(socketInfo, ackTime, setupTime, commandCount) % by: Benjamin Heasly % date: 01/19/2024 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Read a resu...
4ed676b0fd1f52fdfa6855e0df59415e322bccb6520c817154887bdba723aba1
MATLAB
4,730
131
classdef TwoPhotonSeries < types.core.ImageSeries & types.untyped.GroupClass % TWOPHOTONSERIES Image stack recorded over time from 2-photon microscope. % OPTIONAL PROPERTIES properties field_of_view; % (single) Width, height and depth of image, or imaged area, in meters. imaging_plane; % ImagingPlane pm...
6c1651d1af5f6784372ca4faed2cba2e3b9cdad643c3e7d8540844748059be63
MATLAB
4,731
133
% dsFiltFictrac.m % % Function that downsamples and smooths fictrac data and returns new fwd, % slide, and yaw postion and velocity, x and y position, total speed, and % yaw speed, as well as t and dropInd in fictrac struct % % INPUT: % trialPath - full path to trial folder that contains fictracDat.mat % fictrac ...
9c79d3a5b1233df291761e9e455510658d14fedf40cba9f6f844a77f59072c81
MATLAB
4,734
112
% mglTestSocket.m % % $Id: mglTestSocket.m % usage: mglTestSocket(socketFile='/tmp/test.socket') % by: Benjamin Heasly % date: 03/02/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test socket connectivity, read, write, data integrity. % usage...
c457d7e8f6d8e9164489f87821f3c86db3f896ef02727b3e056ef5dc7eade031
MATLAB
4,735
118
%% Fig. 1 % Run config.m % Process data for each animal [psth, response, visI] = processAnimalData(cell_activity_allday, stim_type_allday, trials, nanimals, nstim_type, win, threshold, ngratings); %% Fig. 1c - Plotting % Define plot limits Lim3 = -0.5; Lim4 = 2; % Initialize containers plot_block1 = cell(1, ngrat...
2015762abfe7424b048e758b6cd18c8c5d9e3f3532ae83c347d2c0fdecc3a58d
MATLAB
4,736
113
%%% demo of the full MIN1PIPE %%% clear warning off gcp; min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [160,160]; list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; num_Exp = length(list_Exp_ID); rate_hz = 20; ...
72614db656f897e2db5d50fb3f20ea489fbb5127f67626edce40b1929c85fab7
MATLAB
4,748
150
%# Compute chebyshev type II filter order and cutoff for the desired response %# characteristics. Rp is the allowable decibels of ripple in the pass %# band. Rs is the minimum attenuation in the stop band. %# %# [n, Wc] = cheb2ord(Wp, Ws, Rp, Rs) %# Low pass (Wp<Ws) or high pass (Wp>Ws) filter design. Wp is the...
7bb8ed1226713d9325a7bdc1a423156b6752a949072dad5f386f708010129b2a
MATLAB
4,751
111
function object_task_correlations_for_4hab_0test(pipe) % Get the t-files that are present for both day 1 and day 2 if pipe.Experiment.getNumSessions() == 1 session = pipe.Experiment.getSession(1); if ~strcmpi(session.getName(), 'hab') error('This object task consecutive trials experi...
aa485f7b7482008545c489b5f3da6345a38637b7ea54eab28fe9e24d4a3e22cf
MATLAB
4,762
98
%% plot task parameters % remy, gus, bernard, and fievel are neurofeedback animals; jaq, roquefort, despereaux, and montague are control (no feedback) animals % (no filterframework required, just task struct) animals = {'remy','gus','bernard','fievel'}; %,'jaq','roquefort','despereaux','montague' animcol = [123 159...
8faa4d64691b3ac46765d470deb888d2277b636715cb9b71f4f8b79958d49843
MATLAB
4,765
112
% DERIVATIVE5 - 5-Tap 1st and 2nd discrete derivatives % % This function computes 1st and 2nd derivatives of an image using the 5-tap % coefficients given by Farid and Simoncelli. The results are significantly % more accurate than MATLAB's GRADIENT function on edges that are at angles % other than vertical or horizont...
2e349d8df5eb611f61b7621d0d66ef218743a1b9b74d4520ff73493c3ef66b54
MATLAB
4,767
149
% logAnalysisStatus.m % % Function that reports on status of manual portions of analysis: selecting % dropped frames for FicTrac, getting filtered FicTrac signal, setting % threshold for ephys spike calls, loading in .trk data, leg step analysis % Outputs as spreadsheet, each row is pData file. % Select pData files t...
febb79c996cdf661da8918d4e0bee42a8e5483bc7832800ac57522f805cab972
MATLAB
4,770
163
%{ Cluster reads by spatial density. Please note that the cluster labels in the published datatable may vary slightly compared to the output of this script, as those labels were assigned using this script on an earlier and slighly less curated version of the datatable. %} %% Load the data data = readtable('Table_S...
27c75b3d708ae691d1341a64632a281304397275b558fd34747b2f36ce40f799
MATLAB
4,776
169
function [S_out] = load_spk_evt_data(Recordings, datadir, inds, rt_good, mt_good) %load_spk_evt_data.m % reflects code contributions from RST, DK, KC t_fields = {'starttime' 'endtime' 'rewardon' 'mvt_onset' ... 'mvt_end' 'return_onset' 'cue_onset' 'return_end' 'rewardoff'}; chan = Recordings.Chan(inds(1)); sort = Re...
0497d6717a3cad30a843caf6a17927d7e1c7802a50839e5b4fb99d6138079364
MATLAB
4,780
150
function embedding_dimensions_all_sessions(Sessions,Area,threshold,Ndir,Nbins,t_from,t_upto,edges_dur_bin,session_N,do_plot,plot_supp) %% embedding_dimensions_all_sessions calculate the number of embedding dimensions for all recordings denoted in Sessions and Area % % INPUTS % % Sessions: cell array containing the...
73d259596a8845ade3cffb03c63c11035a62c8518fe6ae6fb71c8c8a3cc8cb62
MATLAB
4,781
149
function [outcomes] = get_pop_sparseness(ds_events,ex_thresh,time_bin) %% % Gives sparseness based on period of time after % OUTPUT: % Outcomes: % - %% for d=1:12 cur_onsets=ds_events(d).onsets; [rand_resp,pv_resp,som_resp,som_onsets,pv_onsets,ex_onsets,ex_resp,ex_type] = extract_onsets(cur_onsets,ds_ev...
b0023485b45b71f009f363c0c53452f4e7162791832693562b9cdedca7b18b04
MATLAB
4,783
125
%function stsum(x,y,STS,elec,unit,cc); function STS = sts2d(x,y,y2,STS); % updates the STS global struct: .sts[odd/even/shuf,:], array 2x:; .Ns [2,1] % computes STS for shuffled spike times, for odd only - .stsShuf % input: x holds spike frames, y holds the signal % bef_s and aft_s units are s % %sta, the STA fu...
afa1e9e2f315dc06c2584a2c3cc2ea35d5c0295d8e813e9d1cc6e61db602bbc9
MATLAB
4,788
166
%{ For the specified k, collect the dFC FC strength and variability across all states and within states from all participants. Generate averaged 2D matrices from vectorized forms. Output: dFC_strvar.h5 Contains dFC FC strength and variability across all states and within states from all participants and average 2D mat...
ddd13699c0050105085d37d97aff9d9aca1a506744edd75527b521c4d80a63ba
MATLAB
4,790
124
% callSwingStanceFrames_v2.m % % Function to call swing phase and stance phase for each leg on each video % frame. % If the leg and ball move in the same direction, leg is in stance. If the % leg and the ball move in opposite directions, leg is in swing. So, % comparing leg velocity to FicTrac fwdVel, same sign is ...
f2403ab95a47b9fc65b019c5f82ca1d736b58c994a4a1fc56feb5b6931ecc41d
MATLAB
4,790
124
% callSwingStanceFrames_v3.m % % Function to call swing phase and stance phase for each leg on each video % frame. % If the leg and ball move in the same direction, leg is in stance. If the % leg and the ball move in opposite directions, leg is in swing. So, % comparing leg velocity to FicTrac fwdVel, same sign is ...
07a5f79d14877cac2823e42973dd18f2a66c85019d640cd8a99e074161cab4ee
MATLAB
4,796
166
function Dist = sc_pdist2( X, Y, metric ) % Calculates the pairwise distance between sets of vectors. % % Let X be an D-by-M matrix representing m points in D-dimensional space % and Y be an D-by-N matrix representing another set of points in the same % space. This function computes the M-by-N distance matrix Dist wher...
03cc3629dce9179ca88982693da2999778b9b5a37a81e9d36bef2baaf6ac0b99
MATLAB
4,797
138
% extractStepsFromPData.m % % Function that computes leg step parameters from raw leg tracking data % (output of loadFreeWalkTrk2PData()) % User selects one or more pData files through GUI % The pData file must contain the moveNotMove struct (output of % extractMoveNotMoveFromPData() and the legTrack struct % (out...
d927a780c8d4b578b432137ccabceb6a35997c740721538ee42f59d09b8b7dc6
MATLAB
4,798
142
function [D,CI] = compare_correlations(varargin) % Percentile bootstrap to compare correlation coef. % % FORMAT: [D,CI] = compare_correlations(data1,data2,method,type) % % INPUT: data1 data from gp 1 - matrix n1*2 % data2 data from gp 2 - matrix n2*2 % method type of correlation to use 'Pearson' 'Spearma...
e64d3c061ff22e97fb341f31c3e7c484a6a21f61a4f957ceddc9fdd9fd7ace95
MATLAB
4,798
101
function fH = makeSupplFigure9_STRetParams_RegressionSlopes_v_Params( ... allDS,allLMMResults,allLMMResults_model,cmapModels,roisToPlot,cmapROIs,... temporalModel, spatialModel, subjnrs, saveFigs, saveFigDir) %% Function to reproduce supplementary figure 9: % Note that Pearson's correlation values may be slight...
7bff04eac060828f8fdb596710ba67c2cfeff8a07816cdce716e8042c2d770fb
MATLAB
4,800
170
%figS3_FA_diffs_pbase_vary_synthetic.m %% close all; clc; warning('on','all') %% scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_pbase_vary.mat'; sspath = fullfile(datadir,ssfile); %% fprintf('loading %s\n',sspath) load(ssp...
a66516ee2831fcae2204a071d6fca9f3a1dd3cecaccb072f12e054d42dc8ca8b
MATLAB
4,801
115
% preprocessFicTrac.m % % Function for preprocessing raw FicTrac voltage data acquired on the user % DAQ. Takes 0-10V signal of heading, intX, and % intY and returns angular position and velocity for each dimension. For x % and y, also returns position and velocity in distance units (mm). Raw % voltage signal is lo...
8c14c77f3a5d1419988289894cafebb1bc358641ab29114fe98e05560b1d915a
MATLAB
4,806
137
classdef ElectrodeGroup < types.core.NWBContainer & types.untyped.GroupClass % ELECTRODEGROUP A physical grouping of electrodes, e.g. a shank of an array. % OPTIONAL PROPERTIES properties description; % (char) Description of this electrode group. device; % Device location; % (char) Location of electrod...
8e6f405c0af3ba48c242dc91a89812bb17c6d62aef9d9c0b3e53136a222f2417
MATLAB
4,806
133
% measurePipetteResistance.m % % Function to calculate pipette or seal resistance by acquiring voltage % and current data when seal test is on. % Will run for duration set by settings.sealTestDur % Saves actual recordings in a folder in the pwd called preExptTrials % % INPUTS: % settings - struct of ephys setup sett...
517a9e33cf1ae063af0fffcabd450f47c82a74effd1e4d40e92ec86b471c2149
MATLAB
4,808
170
%figS2_HR_diffs_pbase_vary_synthetic.m %% clear all; close all; clc; warning('on','all') %% scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_pbase_vary.mat'; sspath = fullfile(datadir,ssfile); %% fprintf('loading %s\n',ssp...
3e611e403c428409cd0b2d8c96dd596d74e75a2b210eada1ae675d26f85856f5
MATLAB
4,813
129
% evenMultiStepIInj.m % % Current Injection Function. Injects square current steps of user % specified number of amplitudes between max and min user specified % values. Has option to randomize amplitudes or not. User specified step % duration and time between steps. User specified space amplitude. % Returns vector...
5e6b0005ad39c90a16289ebd1a7d14e23764035196b8968490b4e30f58bed333
MATLAB
4,814
119
function plotAutoCorrVarChronic( obj, varargin ) % Plot autocorrelation and autocovariance for chronic LFP recordings. % % Syntax: % PLOTAUTOCORRVAR( obj, ax ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % % Example: % obj.PlotAutoCorrVar(); % PLOTC...
c901c7853f8f10d15bc7bbbefecfe83d637fa429294f2ed8a898eb4231bb15aa
MATLAB
4,814
127
% measureAccessResistance.m % % Function that acquires a trial of voltage clamp data with the seal test % on and uses it to calculate the access resistance, input resistance, % and the holding current. % Saves the recording in the present working directory % % INPUT: % settings - struct of ephys setup settings, fr...
6bce8195a1853cebc4b7fe81f8da30b3e53fb21b62382f98137892bebd14ee3d
MATLAB
4,817
155
% plotOptomotorOptoFicTrac_allFlies.m % % Function that takes outputs from extractOptomotorFicTracOptoCond_fly() % and plots the average optomotor response over time % Plots mean across flies % Has option to plot mean for each fly % Select one duration, one FicTrac parameter, one or more NDs % If more than 1 ND, diffe...
b5f170b412b0c58f7fdca3aedb7a5ee9fc50d6fd8e31b25612a439339f37a753
MATLAB
4,818
164
function [] = ExtDataFig08_AveTimeCourse_OptStim_Song % Code for plotting the time course of and the proportions of pulse and sine song in Extended Data Fig. 8a,d. GT = 'pIP10'; % Extended Data Fig. 8a % GT = 'pMP2'; % Extended Data Fig. 8d switch GT case 'pIP10' CellFlagNonTrans = [1,1,1,1,1,1,1,1,1]; ...
17976595cb5eb9bf38c5bbd7ee829da285332618da0f3881b601f0849f5a59d8
MATLAB
4,821
107
clc, clear close all %% this file is used to generate NAOMi1p data % last update: 9/28/2021. YZ %% add path installNAOMi1p %% load predifined data RUSH_ai148d_config %% RUSH 148d config FOV_sz = 600;% FOV 600, mm nt = 1000; % frames fn = 10; % 10 Hz pavg = 1; %mW per mm2 %% parser vol_params.vol_sz(1) = FOV_sz;...
4a4723c4d6df5235b86d97318eb1465978404e5b95a26f05f0f76e63c071ebf0
MATLAB
4,827
165
% plotSpikerateAutocorr.m % % Function to plot autocorrelation of spike rate (output of % getSpikerateAutocorr_cell()). Plots the autocorrelation itself as well % as the FWHM, across conditions. Plots one line/pt per cell and mean +/- % SEM across cells % Select output files through GUI % % INPUTS: % datDir - fold...
443b4f98f135913ac9a72b1dd06001a00b8e039b9be33b2f4d1b38b16a39bd04
MATLAB
4,829
114
%%% demo of the full MIN1PIPE %%% clear warning off gcp; min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [160,160]; list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; num_Exp = length(list_Exp_ID); rate_hz = 20; ...
b0cf530903cb51045d1ae24b62bb01ca7963ededaf326fda70b6766d9fceed19
MATLAB
4,829
146
function getRobustDKImaps(pathIn,pathScheme,pathMask,folderOut,Basename,bthresh,flagB0,fWMTI) % Fit and get DKI parameter maps using the RobustDKI method % % pathIn: path to dwi (.nii) file % pathScheme: path to protocol (.txt) file (MRtrix style) % pathMask: path to mask (.nii) file % folderOut: output directory ...
43ba058d10c2f08cae7a731568eda8e2ed978feaa66d270bcf7c8cb9064cb682
MATLAB
4,832
185
function [] = ExtDataFig08_AveTimeCourseSongTrans() % Code for plotting calcium signals and song probabilities during song type transitions in Extended Data Fig. 8h,k. GT = 'vPR9NP_SS1'; % Extended Data Fig. 8h % GT = 'vPR9NP_SS3'; % Extended Data Fig. 8k selpath = ['../Data/Summary_',GT,'/']; load([selpath,'Transiti...
15b9289778b2b0e211a99b2a8fdf208788b48748e4f9b94bacfa4a1c286f33e0
MATLAB
4,833
122
function f = showInfoWindow(msg,wtitle) % % SHOWINFOWINDOW creates a small dialog window which displays a user-defined message. It % is quite like MATLAB's msgbox but without an OK button. Although msgbox could be used % for the simple display of a message that informs the user about a process being % performed ...
dc0445a52db18490446e8d8ed1a6d2a31d65b0596d9eb22df2bf002dded51361
MATLAB
4,836
137
% MANC_DN_projAnalysis.m % % Quick script to read in MANC_legDNs.csv and classify leg neuromere % projecting DNs synThresh = 0; filePath = '/Users/hyang/Dropbox (Personal)/Wilson Lab/EM reconstruction/VNC/MANC_legDNs.csv'; outFilePath = '/Users/hyang/Dropbox (Personal)/Wilson Lab/EM reconstruction/VNC/MANC_legDNs_ca...
1f12a552d10f4bb6587871d824e63936736c25a39f9127a5d70f2313d11cce30
MATLAB
4,838
128
% spacedMultiRampVInj.m % % Voltage Injection Function for visual panels. % Delivers linear voltage ramp(s) between user specified values for user % specified duration(s). Ramps are separated by constant voltage for user % specified duration. Multiple ramps of different parameters are possible. % Order is randomiz...
19a370473e7215b42be2a1a319bd62b9a6d33e88b37b85aed556816f7a5728d6
MATLAB
4,839
152
% plotOptoFicTracChangePos_allFlies.m % % Function that plots effect of opto stim on FicTrac position % parameters. Specifically, for each fly, plots the average across trials % of the difference in cumulative position/angle between a start time % point and an end time point relative to the opto stim start. For % ...
348514572e2eb09bb4ccb2a93808583af8f266dc7b23b755993735a35e83e933
MATLAB
4,844
126
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This code makes Figures S2B and S2C, which show histograms of occupancy. close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER; OUTPUT_FOLDER = CHENGS_TASK_2C_FIGUR...
fbf141b69c3963b2c2e420159b35ff8692c2d5991e4ea89aaacc80f52418da83
MATLAB
4,845
180
function [rate_mch_events,rate_tdt_events,rate_ex_events,durations]= supplemental_report_events (ds_events,ex_thresh,ex_type) %% UNPACK STRUCTURE mchw=[]; mchws=[]; mchwe=[]; mchp=[]; mcho=[]; tdtw=[]; tdtws=[]; tdtwe=[]; tdtp=[]; tdto=[]; exw=[]; exws=[]; exwe=[]; exp=[]; exo=[]; n_mch_events=[]; n_tdt_events...
8d987440b92328acb47de6bc61f715b0d3d065c9c7aff1ebcdcbd54c442f9981
MATLAB
4,848
137
% This script computes tissue mesh intersections with the YZ plane % (saggital plane) located at X=0 or elsewhere, displays and saves the % result % % Copyright SNM 2012-2018 % The Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General % Hospital & ECE Dept., Worcester Polytechnic ...
b4f1b026a19cee9cad92fa93f81aae996f9ced4a475456818bb888695ae23a46
MATLAB
4,849
115
%%% demo of the full MIN1PIPE %%% clear warning off gcp; min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [50,50]; list_Exp_ID = { 'c25_59_228','c27_12_326','c28_83_210',... 'c25_163_267','c27_114_176','c28_161_149',... 'c25_123_348','c27_122_121','c28_163_...
f1bc01d41beb5c5c5e1ecacbeb344547945f89dbd06ff1c24e19787835ea38d0
MATLAB
4,850
137
% This script computes tissue mesh intersections with the YZ plane % (saggital plane) located at X=0 or elsewhere, displays and saves the % result % % Copyright SNM 2012-2018 % The Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General % Hospital & ECE Dept., Worcester Polytechnic ...
2bf0283301036d7d88ca6865c92c5783eb2d1cde176cc0f1f7bb1e30b4f63ad2
MATLAB
4,851
137
% This script computes tissue mesh intersections with the YZ plane % (saggital plane) located at X=0 or elsewhere, displays and saves the % result % % Copyright SNM 2012-2018 % The Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General % Hospital & ECE Dept., Worcester Polytechnic ...
5c22f5718e5fdb9e07d1fc552941b38163ca073fdc3ce17f2ec24da5a8393790
MATLAB
4,851
86
function mltp_compute_bfo_90_ac_per_cell(obj, session) % Allow the function to run so that other functions do not break, % but give a warning. if session.getNumTrialsToUse() < 2 warning('This function requires the session to have more than 1 trial.'); end % We have to use the shrunk dat...
ae77bb756f10701282d78d0557ad047baee8eb0a3629fa60468cf675f6a9362c
MATLAB
4,851
139
function decoding_movement_duration_all_sessions(Sessions,Areas,threshold,Ndir,Nbins) %% decoding_movement_duration_all_sessions predicts the duration of the neural trajectories of each recordings based on their relative speed to a reference trajectory % % INPUTS % % Sessions: cell array containing the names of th...
2b08735f97d1afc93d702c11c27e8f0203c347038dc8ed4aa2f34e41abea24c1
MATLAB
4,852
124
function [] = concatParfilesUniqueRuns(projectDir, subjnr, sesNr) % script to concatenate unique runs in pilot 3. % subjnr = 6; %9; % sesNr = 1; % projectDir = '/oak/stanford/groups/kalanit/biac2/kgs/projects/spatiotemporal/'; % projectDir = '/share/kalanit/biac2/kgs/projects/simseqPRF/'; cd(fullfile(projec...
cac71bcbaea5d993b8bafffcf61566fc64fd84f92b73d88970a4cac322815006
MATLAB
4,852
116
classdef NCNPERCEPT_FILE < handle % Object with properties and methods to analyse PerceptPC json file at NCN lab % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andreia M. Oliveira, Eduardo Carvalho, Beatriz Barros, Carolina Soares, Manuel Ferreira-Pinto, Rui Vaz, Pau...
afccf940703c4895677f856370b9006a2207335a4cf9102a56195f984f9cf512
MATLAB
4,853
157
function [] = ExtDataFig10_Connectivity_Proportions() % Code for plotting the input/output cell types in Extended Data Fig. 10c,e. %% parameters pIP10 = [13417,13038]; % pIP10 (L, R) pMP2 = [11977,11987]; dPR1 = [10267,10300]; % dPR1 TN1A = [15521,16465,15148,12883,16207,... 16113,14581,14810,15387,17640,... 1...
ba662c09ace84cad0a6b79d80369207613aa266e5678ef11d6ede6b9148dfe91
MATLAB
4,853
144
function [phase_local, background, mask_eval] = VSHARP2D_k(GREPhaseSE, BrainMask, radiusArray, SMV_thres, Params, handles) % [phase_local, background, mask_eval] = VSHARP2D_k(GREPhaseSE, BrainMask, radiusArray, SMV_thres, Params, handles) % Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu ...