sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f59f14660cd367f4eeb201812cb04b2e2026e5f606b363d3efc68107c4fe44c7
MATLAB
3,402
109
% cfsWrite.m % an example of writing a cfs file % using INT2 format % must have cfs32.dll in system directory % calls matcfs32.dll % note: must choose yScale with care % (not very obvious in this example) % unless data is already in required format % 21.02.09: version 1 JGC % 24.02.09: capitalis...
4f4a210bf50d62615f52cc19af2da6ecf9365e299ab87c9f393f8072ac17a988
MATLAB
3,407
102
%Calculate F-observed and the empirical F-distribution for a one-way %between subjects ANOVA % %EXAMPLE USAGE % >> [F_obs, F_dist, df_effect, df_res] = perm_crANOVA(data, [16, 16], 1e4) % %REQUIRED INPUTS % data - An electrode x time points x conditions x subjects array of ERP % data. A...
c29b38cb639e4e1f63f59672f0dfca370aa0c1ff1468cb23b89c1b64084ca306
MATLAB
3,407
104
% extractFictracTrialsOpto.m % % Helper function for computeAvgFictracOpto_1Fly() that takes in one % trial's worth of data for one FicTrac parameter and divides it into % reps based on the opto stimulation % Output appends trials into cell array given as input % % INPUTS: % reps - cell array of size # NDs x # dur...
d918e915aba5e6e162fee3374abd3811a9b926422cb030e96ba055ab9279e7aa
MATLAB
3,409
70
function W0 = null_model_und_sign(W,ITER) %NULL_MODEL_UND_SIGN Random graphs with preserved weight, degree and % strength distributions % % W0 = null_model_und_sign(W,ITER); % % This function randomizes an undirected network with positive and % negative weights, while preserving the deg...
1170cb0e223c28bbdc2dd65b394f0da6449bf2daf8d64799bc96543e4e34e29e
MATLAB
3,411
82
function success = find_centerlines(folder_name) % gets the centerlines given tracks and their associated individual worm % images addpath(genpath(pwd)) parameters = load_parameters(folder_name); %load experiment parameters ImageSize = 2*round(parameters.TrackingWormBoxHalfSize * parameters.CameraPixel...
1fde44a4ff3cc7431793794e421b268213064eec5e0eeaac1c39f9d6fbe3d94f
MATLAB
3,412
121
function status = besa_save2Swf(file_path, file_name, data_matrix, ... time_samples, source_labels, data_scale_factor, time_scale_factor) % BESA_SAVE2SWF writes a data matrix into ASCII-source waveform file format % % Parameters: % [file_path] % Full path to the folder where the file should be saved....
fa34eb8473b5a9b36fc0c2850f38c0559d36d46e844f5d0265b48c3dfa13a31e
MATLAB
3,413
108
function data_rcs=shortchannel_regression(cfg, datain); % SHORTCHANNEL_REGRESSION % shortchannelregression performs reference channel subtraction for fNIRS % data. It is an adaptation from ft_nirs_referencechannelsubstraction % (http://www.fieldtriptoolbox.org/reference/ft_nirs_referencechannelsubtraction/) % % Use as...
9edb67c13f2c4c843765be403d745db3905f414133eaeb6dad32855224461120
MATLAB
3,416
83
function [wEB,hprsML,logEv,postHess] = findEBestimate_GLM(w0,hprs0,mstruct) % [wEB,hprsML,logEv,postHess] = findEBestimate_GLM(w0,hprs0,mstruct) % % Find empirical Bayes estimate for GLM regression weights (Poisson or % logistic). Maximizes marginal likelihood (computed using Laplace % approximation) for hyperparameter...
ee1d993be1c400d893a6c38362972fc9a6ce40243494905b716a0581153f5b21
MATLAB
3,416
74
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [sq] = mkSqRatemaps(ratemaps) v = homography_solve([20 0 0 20; 0 0 30 30], [20 0 0 20; 0 0 20 20]); % transform x_edges = 0:1:20; y_edges = 0:1:20; kern = ratemaps.cfg.smoothingKernel; for a = 1:length(ratemaps.data) s...
3985027549717678b5537cbf29983168e0b6faad72f94823f6a7684ecea04ac5
MATLAB
3,418
116
% plotRaw2ChImgFicTracData.m % % Function to plot raw traces of imaging data (dF/F) for all ROIs and % FicTrac data (yaw angular velocity and forward velocity), each in its % own separate subplot % % INPUTS: % frameTimes - frame times of imaging data % bksSignal - background subtracted fluorescence signal for a...
4b138c5a8a8bf7d6cbb3b63938513cc0f22673aefafbf40d5d86652e83b69d58
MATLAB
3,419
111
function [ama] = loadama(filename); % LOADAMA read an inverted A-matrix and associated geometry information % from an ama file that was written by Tom Oostendorp's DIPOLI % % Use as % [ama] = loadama(filename) % % See also LOADTRI, LOADMAT % Copyright (C) 2005, Robert Oostenveld % % This file is part of FieldTrip, ...
6b998780c2b0baa7596470ffe9284af6c31bdcde4b4367d607081d49900639d9
MATLAB
3,419
85
function mltp_compute_bfo_90_ac(obj, session) % We have to use the shrunk data if the shape is a rectangle if strcmpi(obj.getArena().shape, 'rectangle') outputFolder = fullfile(session.getAnalysisDirectory(), obj.Config.placemaps.outputFolderShrunk); else outputFolder = fullfile(session.getA...
932ef52bcdcb52f919a36925dfa55789caccdc897fd1b0ef8833c7cd183efead
MATLAB
3,419
101
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [v_max, vind_max, rotationsDegUsed ] = ml_alg_bfo(rotationsDeg, maps1, maps2, disjointMaps, MIN_DIFFERENCE_FOR_MAX_CORRELATION) numRotations = length(rotationsDeg); rotations90 = floor(rotationsDeg ./ 90); rotati...
3ef4dad8038a26f023e257eaeba8ae4e37182dd7865c8d1e4acf89e7ae517d7a
MATLAB
3,421
137
%fig_S12_ISI_histograms.m %% clear all; close all; clc; warning('on','all') %% addpath if not added yet % assumes script run within local directory scriptdirs = {pwd; '..\..\plot'; '..\..\helper_functions'; '..\..\analyze' }; addpath(scriptdirs{:}) %% datadir = pwd; datafile = 'fig9_fig10_unit_ex.mat'; datapath =...
80927a0fb5c9d1129747f57436ea5e53a21bffec409589a7a93fd3d9c091cd6f
MATLAB
3,421
104
% VL_DEMO_HOG Demo: HOG features % Author: Andrea Vedaldi % AUTORIGHTS prefix = fullfile(vl_root,'figures','demo') ; randn('state',0) ; rand('state',0) ; figure(1) ; clf ; % -------------------------------------------------------------------- % Load a figure %...
cc89dd8d16d033a161820880e7e986300b70d232596b4214595cff7f730d7536
MATLAB
3,427
87
function [r,p,ot] = buttonResponses(iTrial,p,s,i,ot,r,stimOnset) % collects response within time window %remove all unwanted responses from queue KbQueueFlush(p.keyboardIDSubject); timeWindowEndT = stimOnset + p.maxStimDuration + p.respDurMax; %-- initialize data vecs to missing value r.button(iTrial) = 99...
6b15e862b1bb729bd525ff0dc02c6b9b08db6754eea226a1775c38a25fb1c3b7
MATLAB
3,430
106
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...
c55d6a53d10d785fffbf1c2bd6224509c804bae459f9d43c64285dced85629e2
MATLAB
3,434
46
function status = fillSystemInformation( obj, data ) % Fill system information % % Syntax: % status = FILLSYSTEMINFORMATION( obj, data ); % % Input parameters: % * data - data from json file(s) % % % Example: % status = FILLSYSTEMINFORMATION( obj, data ); % % Available at: https://github.com/NCN-Lab/DBScope % Fo...
7ece48b11e07b85c906659e8abe3c4b03e7173fe13dd9c44ee8aa7e0d50b285f
MATLAB
3,437
95
function hsvColorHistogram = hsvHistogram(image) % input: image to be quantized in hsv color space into 8x2x2 equal bins % output: 1x32 vector indicating the features extracted from hsv color % space [rows, cols, numOfBands] = size(image); % totalPixelsOfImage = rows*cols*numOfBands; image = rgb2hsv(image); % split i...
34479d198e6dc4693fed78927149693027a1ce25aecb7047058724210363bdcc
MATLAB
3,438
59
function boundary_index = pbgnessSeed( input_im, spnum, superpixels, pb_im) %% background seeds % L = imlab(:,:,1); % A = imlab(:,:,2); % B = imlab(:,:,3); [row,col,~] = size(input_im); row_thes = 0.1*row; col_thes = 0.1*col; pos_mat=zeros(spnum,2); % color_mat=zeros(spnum,3); pb_weight = zeros(spnum, 1);...
441b3682496b3b416e1f3c863f9de70dbfb13f7c563db13286688257214f5a74
MATLAB
3,438
100
% uThreshSelectROIs.m % % Function for the user to select the ROIs and background threshold for a % single time series. Calculates raw signal (mean pixel intensity) in each % ROI and performs background subtraction. % ROI selection by pixels with mean pixel intensity relative to rest of % image above threshold and ...
c6a98f72de2ad7e78f4cc7599f2c741db8f5568ab2a6106ce75fe3d2ba910583
MATLAB
3,438
97
classdef IZeroClampSeries < types.core.CurrentClampSeries & types.untyped.GroupClass % IZEROCLAMPSERIES Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series beca...
e7bfd51638c4289e503983e261e3102af3aaf7d306dc5578ddc0606f842e4fe3
MATLAB
3,438
75
% get the optimal rectangles for bounding boxes that can perfectly enclose % sliding window and corresponding dense sift bins % assume that the outlier of bbs can be entirely obtained function [roi, grids, pts_ds] = getDetectionRegion(I_pred, bb_I, patchSize, nStride, alignment) % superpixel segmentation % imseg...
3aa10ef8869f7f989c693dbdde3d7b57724066afd1b531f49978a4bfd0c87dbd
MATLAB
3,441
106
% [results] = read_fig3_table(table_dir, sheet_name) % read figure 3 data from .xlsx file. % returns a struct with data, specifically % results.means = means; % results.sems = sems; % results.x = x; % results.pos_true = pos_true; % results.neg_true = neg_true; % % Mackay et al. 2024 (DOI:10.1038/s41467-0...
710e866d555bcc7183a8e56be39bcfdb02a150c8bbf77c82e4312c08bf92e7c2
MATLAB
3,442
118
function testOpenMEEGeeg % TEST testOpenMEEGeeg % Test the computation of an EEG leadfield with OpenMEEG addpath(cd) % Make sure current folder is in the path %% Set the position of the probe dipole pos = [0 0 70]; %% Set the radius and conductivities of each of the compartments % 4 Layers r = [85 88 92 100]; c = ...
2abdad4f1f07b80107448894d0eb81397c34d35df554e5a0361f0fbb5cece13b
MATLAB
3,444
122
%% LOAD load('ds_events.mat') %% [outcomes] = get_pop_sparseness(ds_events,2) %% GET LIST OF BETA WEIGHTS FOR EACH NEURON starts=-99:1:100; bin=30; ends=zeros(1,length(starts))+bin; timepoints=[starts;ends]; t=100; type='onsets'; param(1).type=type;param(1).stat='avg';param(1).extype='ratio';param(1).exthresh= 2; b...
888dd85ab16dc80a807339c5c1661c82cc1df1d26b616811ec88921cb54ec3c8
MATLAB
3,445
103
% mglInstallSound: Install an .aiff file for playing with mglPlaySound % % $Id$ % usage: soundNum = mglInstallSound(soundName,<samplesPerSecond=8192>) % by: justin gardner % date: 02/08/07 % copyright: (c) 2007 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Installs an aiff...
fe3424bf376a4472d0954521d780ab780871471804006c451d1157d44c4a9313
MATLAB
3,445
78
function output_calibration = core_tracker_fit_arena(output_calibration_file_name, ... working_background_file_name, ... input_calibration, ... options) ...
1a9841e18f60ae43712bd2b14db984d788f3bd7242a484ba12fa9052e1f4fb0f
MATLAB
3,447
146
% FIGURE 1 %% LOAD DATA 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 %% GET INFO ABOUT WAVELENGTHS iters=length(fixed_outcomes...
e657b412f76cb405d5038238d91c1a0eeb309b00762c71fad8005030f7cd7549
MATLAB
3,449
96
function response = slack_incoming(url, varargin) %% response = slack_incoming(url, payload) % url : [char] Webhook URL (you have to get Webhook URL from Slack) % payload : [char, struct] payload must be JSON style string or struct % # payload is a case when varagin is a single argument % varargin :...
049e6d44132a2869c737386a445d3de0cad716247ce3a880ec98fba0c9e69929
MATLAB
3,450
79
% function write_fig2_results_to_xlsx(results_cell, file_name, sheet_name) % writes the data necessary to plot figure 2 to .xlsx % % Inputs: % results_cell: Cell array containing the data to be written. % file_name (str): Name including path of the .xlsx document. % sheet_name (str): Name of the wor...
cfec76d25713d7fcd6ade0d6421e102d36c9c658c5df18e74a560759530124a4
MATLAB
3,451
102
% initalizeVisualPanels.m % % Code that takes in all parameters for initalizing visual panels and calls % the appropriate PControl commands. % % INPUTS: % panelParams - struct containing all parameter values for initalizing % visual panels appropriately. Fields are: % panelMode - [X,Y] representing close...
3aeb5bd8d79041543c5fb5130461c175390cd1448054121ef369b777b2b1be01
MATLAB
3,453
118
function loc = getStimLocDeg(projectDir, subjnr, useStimFlag, forcedGridLoc, hemi, relativeSize, offset) % Define pRF XY centers that fall within stimulus squares if ~exist('useStimFlag','var') || isempty(useStimFlag) useStimFlag = true; forcedGridLoc = []; end if ~exist('relativeSize','var') || isempty(relat...
b4b27b5f15cba79e64172b39cfd35d7fe9244fc6b481e613eee5785d6b5d4d5d
MATLAB
3,453
67
function DecayHalfTime = ExponentialFit_DecayHalfTime(fit_timevect,object_2fit,expfit_type,StartPoint) % DATA ANALYSIS PIPELINE FOR FIBER PHOTOMETRY EXPERIMENT % Name: ExponentialFit_DecayHalfTime % Feb 2023 - Marie Labouesse, marie.labouesse@gmail.com % Exponential Fit a function to get its DecayHalfTime ...
fa991cd738484d5ca7d9286a008b6c7325dc62de511fb081664a66cf5083bfe8
MATLAB
3,454
108
function [chi_res, chi_SA] = delta2chi_SAR(deltaB, D, chi_res0, maskErode, thresh_SAR, chi_ap) % function [chi_res, chi_SA] = delta2chi_SAR(deltaB, D, chi_res0, maskErode, thresh_SAR, chi_ap) % QSM with streaking artifact removal (SAR) % Input: % deltaB: relative field shift % D: convolution kernel % chi_res0: i...
41b6355970b07b4225059e7e9f40083e2208334b79d95771ed9e5b59ff5b95ac
MATLAB
3,459
63
% Compare the spikes times of a list of mda files to a list of txt files filenames = [ %"Z:\1_Maxwell_Gagnon\hannahProjectData\smrFiles\20170810_JC6_ephys_cell2\20170810_JC6_ephys_cell2_MS.smr", %"Z:\1_Maxwell_Gagnon\hannahProjectData\smrFiles\20170810_JC6_ephys_cell3\20170810_JC6_ephys_cell3_MS.smr", %"Z:...
9629e61ca09723a5b7a76a71117cfc3d64ccd26b1355e9e5e63a025c84c8e591
MATLAB
3,459
94
% preprocessUserDaq.m % % Function to take data saved in userDaqDat.mat, the output of run2PExpt % for any experiment type, and convert it to a more useable form for later % analyses % % INPUTS: % exptCond - experimental condition string % flyData - information about this fly % inputParams - experiment-specific...
1673f75b92e305e34c3774f1f3eb5fb8d69a9ac52bcf234bb7bd339bba0e1dbf
MATLAB
3,460
99
function simseq_init(sessionDir,clip, keep, runBase, rawFileDir) % simseq_init(sessionDir, clip, keep, runBase, rawFileDir) % % Function to initialize workflow for mrVista % % Inputs: % sessionDir : (str) base folder of session, where mrSESSION.mat % will be created % clip : (i...
979024e09153e6f8093c2e3b04d2e49ff45d822ba6a786ac24bb73d1ed7cb59c
MATLAB
3,461
103
% mglCheckOS % % usage: mglCheckOS(majorVersion,minorVersion) % by: justin gardner % date: 05/13/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Checks os version and returns t/f if equal or better to % arguments. Will also set mglGetParams to have the...
fd23bd33077995dbcafde10026456a24360cf7e5e60298cbd3ca17c6b346c80c
MATLAB
3,461
81
%----FUNCTION: % extract statistical color histogram using integral histogram(RGB, HSV, LAB, Opponent color space) function [colorArr_c, colorArr_s] = sp_colorHist_grid_cs(chns, grid_x, grid_y, patch_size, surrWidth) nPatch = numel(grid_x); [imh, imw, ~] = size(chns.rgb); colorArr_c.RGBHist = zeros(nPatch, chn...
f9d370f91f857fdb580f8d665f6cbeb36c1fb0ccda2b6cc85882a0f5ea9c33e2
MATLAB
3,463
98
function Net = setESN(Options) % The recurrent neural network (RNN) we are setting is r-based rather than v-base % referring to the notation introduce in (Miller & Fumarola, NC 2012). % Although these two dynamics have been proven to be equivalent (Miller & % Fumarola, NC 2012), the rate (r-)based is the one int...
a005ae9836a68ee871f726a057973bf31724e6f881616de60de246c969f0e6aa
MATLAB
3,465
97
%function stsum(x,y,STS,elec,unit,cc); function STS = stsum(x,y,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 funct...
3da1172b4fb80226ed94b6aed3b1013a81da5412019c88888cb59ea09055f559
MATLAB
3,466
117
close all clear all %% create figure 4D %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load results file = 'Multim_FI.mat'; % mod = 1 load(file) Vi_mean = squeeze(mean(mean(Vi_kfold))); labK =...
3323583310e0d653150349ed557ed79cfb66f2da7030e01e3f087c2439a85e3d
MATLAB
3,468
84
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [F, success] = ml_alg_compute_best_aligned_map_table_v2(T, comparisonMethod, REFLECT_ONE_CONTEXT) F = []; success = true; wb = []; % Get unique animalName, sessionName, cellName combinations R = get_...
62e45d1bf8ee8f56c8b56e536f78abf6b4d916df718723a684643aed591c6719
MATLAB
3,469
95
% plot_convolved(results, which_panel, plot_info, curr_ax) % % this function plots the main figures from summary source data saved in % .xlsx format, rather than raw data % it is a combination of elements of perm_multcompare_gm_publ.m and % plot_signals.m, and was put together in response to final requests to % combine...
656a27d8460f2affc4b9751a4351da1a7d9fa3fe1db2215b3f8101fe554f2120
MATLAB
3,469
106
% Supplement to touch decoding paper, Maallo et al, 2023 (submission year) % read response mat files for each subject and perform multi-class SVM classification clc clear close all %% load data files in matlab format % load 'SUBJ_responses' mat file % contains info table and % con't: stimresponses responsefolder = p...
6d449dab645043ba66d5f7a7fab6c2f292397dd6b3972904166cc65595747eb5
MATLAB
3,469
96
function core_tracker_job_consolidate(output_track_file_name, ... output_segmentation_file_name, ... per_chamber_track_file_name_from_chamber_index, ... per_chamber_segmentation_file_name_from_chamber_index...
e8c2eff6f120b500e64181abdbab316325c4587fb020c93ca027eb6b1f89b739
MATLAB
3,471
104
% This is a mesh processor script: it computes basis triangle parameters % and necessary potential integrals, and constructs a combined mesh of a % multi-object structure (for example, a head or a whole body) % % Copyright SNM/WAW 2017-2020 %clear all %#ok<CLALL> [~,name,~]=fileparts(pwd); L = length(name)+1; i...
86ff6b63c57f2bdca1ebb42bd8c0b1b22ee5145dbfa6ddb0e4e2d8e6369f0852
MATLAB
3,472
67
function Get_WPLI(ComputeParams,PLX_Path,filename,SaveFileDir) %% Compute and get WPLI and cohrence for given plx file %% Input % Compute Params for the whole codes. % ComputeParams.Method = 0;% 0: wpli 1:wpli_basied % ComputeParams.wpli_ParaLength = 1; typically % Comput...
fc8b6d7715b3bb0678892bb522f8fe7a9f48f7cd56d64fdaf70c615abbe413a7
MATLAB
3,474
78
%%% 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 = '\\preprocessed'; %%Specify the path of chronux tool...
ef47dfb66e4fe90f64eef2d9e8a367145e1cf645a3d89b931d10a3f8a6fe038e
MATLAB
3,477
125
% This code takes an individual TIFF stack and outputs a series of CSV files, each representing individual slices. % It can handle up to 4 channels as long and by default name them as red, green, blue, and white (in that order) slices = 25; width = 1012; height = 424; redT = 0; %T is for the threshold of that channel ...
f7e1710458d05ee14e609b3e120a0e4bcdd1e748427c9f6b42923114da49cdec
MATLAB
3,477
155
function [epochs] = fiff_read_epochs(fname) % % [epochs] = fiff_read_epochs(fname,setno) % % Read eochs from file % % % Author : Martin Luessi, MGH Martinos Center % License : BSD 3-clause global FIFF; if isempty(FIFF) FIFF = fiff_define_constants(); end me='MNE:fiff_read_epochs'; % % Open the file % fprin...
b10f769ebcf4bf8ca0f77039937bdba838d2ff47f26e337ed435b37e2d428d2e
MATLAB
3,482
119
% plotLRrunCorr.m % % Function for looking at correlation in activity between left and right % cells in calcium imaging. % Prompts user to select pData file through GUI and outputs graph showing % two dF/F traces, FicTrac yaw and forward velocities, and running % correlation. Also shows overall correlation b/w two c...
1ed00744a27ded6610998b1cdff90021e9a661ecd72cfd065e67819375556195
MATLAB
3,483
110
function R=latmio_und_connected(R, ITER) %LATMIO_UND_CONNECTED Lattice with preserved degree distribution % % L = latmio_und_connected(A,ITER); % % This function "latticizes" an undirected network, while preserving the % degree distribution. The function does not preserve the strength % distribution in we...
1f9c47b794ed6be80c96be57ca5389e8b3d8c313f9fc59c25f17a31b11d3f01a
MATLAB
3,486
71
% Final Regression Script clear all clc %cd('M:\Matt Chilvers\Documents\PhD\Project3_WhiteMatterLesion\Scripts\Plots\ScatterPlots\FinalRegressionAnalysis') cd('/Users/dukelowlab/Library/CloudStorage/OneDrive-UniversityofCalgary/PhD_Projects/Project3_WhiteMatterLesion/Scripts/Plots/ScatterPlots/FinalRegressionAnalys...
4d91d54353dbca1c1626f1e03ea9eef7c6f66d7ffb975d75233100ebc8e0bcd1
MATLAB
3,486
94
% preprocessOpto.m % % Function for processing raw voltage signals indicating when the % optogenetic stimulation was active (feedback signal from shutter in % front of mercury lamp; high = open). Extracts start and end times of % opto stim. Also, logical for stim on or not. Saves parameters of opto % stim that wer...
c3c8530b953fd0c2cb1d1957c6d4f442b62024e7285e90526ee07fc649db750e
MATLAB
3,489
83
function fH = makeFigure4_SuppressionLevelsAcrossVisualAreas(ds,fLMM,lmmResults, ... roisToPlot, cmapROIs, useSTRetParams, saveFigs, saveFigDir) % Function to reproduce main manuscript figure 4: % panel a: All 9 ROIs SEQ vs SIM amplitude voxel scatter plot for small & short stimulus condition % panel b: Su...
ced1dc07098dfc863b3aac8d772f151331cf19d3f314452377ee1ce97f738d9a
MATLAB
3,492
112
function simseq_2gray(sessionDir) % simseq_2gray(sessionDir); % % Function to transforms the time series from the inplane to volume anatomy % and averages the time series % % Inputs % sessionDir : (str) path to subject's VistaSoft session % % Written by EK 2021, adapted from D Finzi toonotopy code %% Load initial...
917055a71e976e71d5696b01297c79fa06c81762ebe158db754c52594387956c
MATLAB
3,493
107
function val = ft_getopt(opt, key, default, emptymeaningful) % FT_GETOPT gets the value of a specified option from a configuration structure % or from a cell-array with key-value pairs. % % Use as % val = ft_getopt(s, key, default, emptymeaningful) % where the input values are % s = structure or cell...
ac5574ba4b5e22d61a8f4f2049f99a6d844d4c539c93400ad9ca96fee7eb40d9
MATLAB
3,493
86
function normcorre_registration(parentDir, fileName, varargin) %=================================================================================================== % % Uses the NoRMCorre algorithm to apply a rigid motion correction to pre-processed imaging data. It % must be saved as a .mat file containing the var...
efe8729d634d538c391780e073efe95d7ca7b92731d74fef0f7352a1c142e44d
MATLAB
3,494
68
function PlotBEAM(MIEEGData,label,Fs,LowFreq,HighFreq) channel = 1:30; trigger = find(MIEEGData(:,33)==2); left_MI = zeros(2000,30); left_MI_cell = cell(20,1); right_MI = zeros(2000,30); right_MI_cell = cell(20,1); k1 = 1; k2 = 1; for i = 1:length(trigger) bp_data = BandpassFilter(MIEEGData(trigger(i)-8...
9ac758b13afc45b6df9a0016337e7274adc3252104ba2f21a2f03a0cb4346bd3
MATLAB
3,495
72
function [Spikes,nose,Fs]=getSpikesEM(File, passNo); %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 i...
ffbf7c8228a913a7aff944787e40de16ca423513fa7eed65642468cb6d90d57c
MATLAB
3,495
106
function [TChannel]= SONChannelInfo(fid,chan) % SONCHANNELINFO reads the SON file channel header for a channel % Output follows the CED disk header structure but a FileName field % is added to tag the returned structure with its source file. % % % INFO=SONCHANNELINFO(FID, CHAN) % where FID is the matlab file han...
b4a4a594621049f08f006975b1f332a0c967fb5673dd98d9364fcec3f08a07c1
MATLAB
3,496
117
function [nst] = read_neuralynx_nst(filename, begrecord, endrecord) % READ_NEURALYNX_NST reads a single stereotrode file % % Use as % [nst] = read_neuralynx_nst(filename) % [nst] = read_neuralynx_nst(filename, begrecord, endrecord) % Copyright (C) 2005, Robert Oostenveld % % This file is part of FieldTrip, see ht...
7826e4e7bbe43932d63fc309c0be7f55f41598844d08ff5a40acd9255337e1c5
MATLAB
3,498
97
% oneStepOptoWCtrl.m % % Optogenetic Stimulation Function. Opens up shutter in front of mercury % lamp for duration specified by user on X% of repeats. Other (100-X)% of % repeats, shutter doesn't open. Which repeat shutter opens is random. % Specify duration before and after steps when shutter is not open. % Return...
f282d45e2eb6a8e0e2f8d9de3241a85ad2972ea31a8edae8a8fd674c9bbc785d
MATLAB
3,498
117
function [ntt] = read_neuralynx_ntt(filename, begrecord, endrecord) % READ_NEURALYNX_NTT reads a single tetrode file % % Use as % [ntt] = read_neuralynx_ntt(filename) % [ntt] = read_neuralynx_ntt(filename, begrecord, endrecord) % Copyright (C) 2005, Robert Oostenveld % % This file is part of FieldTrip, see http:/...
a0d60f49d2ced61ed0809932065c60827676ba29724f03742116baaa33779c32
MATLAB
3,499
104
% getResidualSpikeRate_fly.m % % Function for calculating residual spike rate. Takes in input from % getCorrelationEphysContParam_cond_fly() and generates residual spike % rate. Uses behVals and ephysVals. Takes 1st column of behVals as % variable to get mean curve and subtract from this to get residuals. % Remaini...
065754b419a031ad7a8428ac78cf7a5bc756a16f76a747cb55d12df783075fcd
MATLAB
3,500
126
function [B,tspred,tsorig,corr_pred_obs,MSE,local_error] = fcn_fit_model(sc,ts) %fcn_fit_model reweight fiber tracts using functional data % % [B,tspred,corr_pred_obs,MSE, ocal_error] = fcn_fit_model(sc,ts) % uses a matrix of interregional coupling (sc) to constrain regression % model of brain activity. The ac...
5900783a40281aaf27d277e34bb0f9a570a747bc81195a3160ed9e9694850eef
MATLAB
3,500
106
% plotScatterPCAStepParams.m % % Function to plot scatterplot of output of pcaCompStepParams() % Plots each turn bout set 1 PC1 vs set 2 PC1. % Select output file of pcaCompStepParams() through GUI % % INPUTS: % datDir - path to folder containing pcaCompStepParams() output files % plotType - string for type of plot...
a05342b8e262a331ab92c12405fabadf7389238417da80bbde1fc3404cea2546
MATLAB
3,502
73
function h = mk_doub_exp_ker(t_on, t_off, A, dt, varargin) % h = mk_doub_exp_ker(t_on, t_off, A, dt) % % Function to create a double-exponential kernel. The kernel is defined as % % h(t) = A*(1-exp(-t/t_on))*exp(-t/t_off) % % The function is evaluated at increments of dt from t=0 to t=t_max defined % as the time wher...
2c696049dbea669da47c04a5c08b3a0a6f32114b5f7f4543fa45219f0e0ad012
MATLAB
3,504
75
function scan_img = single_scan(neur_vol, psf_sz, psf2, varargin) % scan_img = scan_volume(neur_vol, psf, varargin) % % Scan a 3D volume with a given point-spread function. This function takes % in a neural volume (as generated by "simulate_neural_vol_v*.m"), a % point-spread function, and a number of other optional s...
e0c8b51b93016de8de093323a3590bf4aa4fcbcc3a84066836c2d972e69170c8
MATLAB
3,507
145
function [fspec, fstem, fmt] = MRIfspec(fstring,checkdisk) % [fspec fstem fmt] = MRIfspec(fstring,<checkdisk>) % % Determine the file specification (fspec), stem (fstem), and format % (fmt) from the given file string. % % A specification is the name of a file as it could exist on disk. The % specification has the form ...
62b243aba782408f9648144e547ffab1772159e21eafcfe83ff5d018bc88a5ec
MATLAB
3,509
114
% plotNormAEPPEP_allFlies_v2.m % % Function that takes output files from saveAEPPEPbyCond_fly() and % generates a plot of the AEP and PEP for each leg, normalized to the AEP % of the unmanipulated condition. Plots mean +/- SEM for each fly. % Uses line to connect AEP and PEP for each fly % Subplots for each leg (lef...
859abb1d74f94b36013c9ab30f07f5223497e72f5b1c8baa9a877becf4fb90a1
MATLAB
3,512
92
function [filt] = ft_preproc_dftfilter_Opt(dat, Fs, Fl) % FT_PREPROC_DFTFILTER applies a notch filter to the data to remove the 50Hz % or 60Hz line noise components. This is done by fitting a sine and cosine % at the specified frequency to the data and subsequently subtracting the % estimated components. The longer th...
77d2983f2828ee7dcae6f60854305485990909f54a55497c69edbb7c92d3d7a1
MATLAB
3,514
117
function plot_accuracy(output,bin,starts,param,shuffle_yn) %% UNPACK VARIABLES sp_accuracy=output.sp_accuracy; spn_accuracy=output.spn_accuracy; sp_err=std(sp_accuracy)/sqrt(length(sp_accuracy)); spn_err=std(spn_accuracy)/sqrt(length(spn_accuracy)); pn_accuracy=output.pn_accuracy; sn_accuracy=output.sn_accuracy; ...
e3ef0bf359a1b2f3e4fa998d572badf09dc19b026d634b426b532f0f50ecd54a
MATLAB
3,514
112
classdef MLSession < MLSessionInterface % MLSession Implementation for a session % An implementation for an experiment session properties (SetAccess=private, GetAccess = protected) Config SessionRecord Name Date Trials SessionDirectory ...
e692f40444059b5819e842f69cca7c092c477f5be70c01c8cbc03178e332b800
MATLAB
3,515
91
function [spikes, markers, all_strings] = get_all_data_from_level_h5(filename,str) % The function extracts the spikes and the markers from a .h5 dataset %% authors: Francesco E. Vaccari %% date: 22nd February 2024 % % INPUT: % filename = a string that identify the h5 file from which extract data % str...
799ec0af2ee62c4e8c2924b4ca47873f346eed78e9ff07bf2b1e0a4b125781e4
MATLAB
3,516
122
function [fhdr,chdr,ename,cnames,fcom,ftext] = read_egis_header(filename) % READ_EGIS_HEADER reads the header information from an EGI EGIS format file % % Use as % [fhdr chdr] = read_egia_header(filename) % with % fhdr - the file header information % chdr - the cell header information % ename ...
92869780da95946f4f39e49d0f658fac4027e85498e6b65c569388f8b5291666
MATLAB
3,517
120
function [median_total_error,std_error,estimated_duration]=decoding_movement_duration(score,idx_dir,idx_duration,ref_bin,Ndim,Nbins,do_plot) %% decoding_movement_duration predicts the duration of trajectories %% corresponding to the same movement direction than the sample trajectory % % INPUTS % % score: Projection of ...
fa8560348ca8f96dc0c124e5c9dc171541e004c13de9fa179513458bff5e5e5e
MATLAB
3,518
92
function [psdPeaks, intpsd, gammaP, betaP, meanLevel, envLevel, osci] = record(r, allTime) % RECORD give property of the parameter setting % psdPeaksSheet = zeros(Delta_e_steps, Delta_i_steps, 16, 6); % XX peaks in psd, e.g. -1-NaN, 5 peaks, 12 peaks % intpsdSheet = zeros(Delta_e_steps, Delta_i_steps, 16, 6); % integr...
642af73c18e9a415e5133461216002b3d8241bd8ff0a1521aacd2d3317d28885
MATLAB
3,520
93
function seqMaster = generateSequence(locations, dt, durations, ... nrSeqRepetitions, conditionOrder, totalTrialsPerBlock, ... hemifield) % Stimulus order: % Simultaneous trial order is one frame of 6 = all stim simultaneous, % rest of frames are 1 = blank count, 1x4 s...
30571b6c8fc4dc89a259a5f8ff4a4fe0c88b394cb7f3b67db16e19923ceef1f5
MATLAB
3,523
86
classdef ExternalResources < types.hdmf_common.Container & types.untyped.GroupClass % EXTERNALRESOURCES A set of four tables for tracking external resource references in a file. NOTE: this data type is in beta testing and is subject to change in a later version. % REQUIRED PROPERTIES properties entities; % REQUIR...
6a207f7db97d870bf372c916cb3227df0026661cba045f7b2da178cd2aa9d1c3
MATLAB
3,523
106
% mglPostEvent.m % % $Id: mglOpen.m 385 2009-01-03 20:34:37Z justin $ % usage: mglPostEvent(command,<time>,<char/keyCode>) % by: justin gardner % date: 01/10/09 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: This is a mac specific command that is used ...
b8ebdd5c71d80b93eb5fdf76a22e9c12fdf3cd6a3c19a5a29dd8ff68ec10c9fc
MATLAB
3,523
106
function [chi_res, flag, relres, iter] = delta2chi_NDI(deltaB, kernel, DPWeight, maskErode, NDIParams) % [chi_res, flag, relres, iter] = delta2chi_NDI(deltaB, kernel, DPWeight, maskErode, NDIParams) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Quantitative Susceptibil...
05830e2727cab56df747bdab93c9f1db2dcd1367c7a79a33a21f6d4bd0194358
MATLAB
3,524
83
classdef RECORDINGMODE_CHRONIC < RECORDINGMODE_COMMONMETHODS % Object with properties and methods to analyse chronic fields from PerceptPC json data at NCN lab % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andreia M. Oliveira, Eduardo Carvalho, Beatriz Barros, Carol...
e41f5edc4ec5e95a3467bc47df274f0b7047f74196a1a6d1c145650150d40952
MATLAB
3,525
106
% eyeCalibrationASL.m % % $Id: eyeCalibDisp.m 486 2009-02-16 00:05:54Z dep $ % usage: eyeCalibDisp() % by: justin gardner % date: 12/10/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: eye calibration - mgl version % stimuli should be defined in visual a...
dac55137737dd501cc8fb8ab1856ef16aef94a750f277f78ad5806c1808af36e
MATLAB
3,531
131
% plotSpikesPhaseDelays.m % % Function to plot amplitude of modulation of spike timing by phase, across % temporal offsets % Fits 1 period sine curve to values for each delay, plots amplitude (2*a) % equation: a*sin(x+c) + d % Data from getSpikesStepPhase_cell() % % INPUTS: % datDir - directory with output files %...
f2e2d21015fcf6e0baaa174e7722e9bc2023a1df5634ec4693989cfc638f7aa1
MATLAB
3,531
106
% This is a mesh processor script: it computes basis triangle parameters % and necessary potential integrals, and constructs a combined mesh of a % multi-object structure (for example, a head or a whole body) % % Copyright SNM/WAW 2017-2020 %clear all %#ok<CLALL> [~,name,~]=fileparts(pwd); L = length(name)+1; ...
147023dd94f91f6968d983b48e1ceeb14a8b3e83503095f3901ad1526655b846
MATLAB
3,532
85
% blockRandomization.m % % usage: blockRandomization() % by: justin gardner % date: 01/22/07 % purpose: function that decides order of parameters, % it needs to set block.parameter with relevant % parameters and what they will be set to. % e.g. block will end up...
3cff4cb37d68d84dbfc090ee4a3e639658a0f434cb9e35891776ad16fcb3684d
MATLAB
3,532
103
% mglTestTexture: an automated and/or interactive test for rendering. % % usage: mglTestTexture(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test rendering a smoothly varying texture. % usage: % ...
54919c930b1e126342d220c1bcb6e2f896666d93da775961a0bbf947735cea10
MATLAB
3,534
120
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
a753bf805c2494be4237f7f191156951c56687b234ae4c93e878ad31e8a0b6b3
MATLAB
3,537
84
function [micID, sampleID] = readRecipe(recipePath) % Read the microscope ID and the sample ID from a recipe file % % function [micID, sampleID] = webupload.readRecipe(recipePath) % % Purpose % The microscope ID is the value of ID directly under the top-level SYSTEM key and the % sample ID i...
5ad1e2feb19ed058ea84ee0bc11b51bca5b122babd685b8efe96140090e6a9df
MATLAB
3,538
111
clear cd ./opto_sponlick % C1S2:light; control=dir('C*.mat'); inhibit=dir('I*.mat'); active=dir('A*.mat'); k=1; for j=1:length(control) load(control(j).name) light=C1S2; lickp.control(j,1)=0;lickp.control(j,2)=0;lickp.control(j,3)=0; for i=1:20 t=light(i); lick1=find(I...
39037f09ff0ec0ef6caad08998a4f7fcd6568cf1d497382cd1188aa374f5976e
MATLAB
3,539
70
function subject_power_2014_motion_parse(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count) % FD parsing Nipype wrapper pulling in list of motion files % All variables (skips, TR, CurrentDirectory) set within Nipype % Iterates over range of values from 0.1 to maximum of 0.5 FD threshold % Outputs to .m...
bf01458048f40002dbcb5bae96b38328c22d6f7b3edde5c55272c31565625f1a
MATLAB
3,541
93
% calculate the mean and variance of arbitery windows as well as its surroundings of an image using % integral image computation function [avg_c, var_c, avg_s, var_s] = calcMeanandVariance_cs(I, gridx, gridy, patchSize, surrWidth, varFlag) [imh, imw, imc] = size(I); % coordinates of center pixels for computing re...
e7dfefc7767f0ac182859365262903f0cbf38286897c126ee9e4cb32dd712c37
MATLAB
3,541
152
%% GET mDECONV FOR EACH DATASET all_mSOM=cell(1,6); all_mPV=cell(1,6); all_mPYR=cell(1,6); for ds=1:6 curdeconv=all_deconv{ds}; curct=all_cell_types{ds}; cursom=all_deconv{ds}(curct==1,:); curpv=all_deconv{ds}(curct==2,:); curpyr=all_deconv{ds}(curct==0,:); all_mSOM{ds}=mean(cursom,1); ...
50eeabaceb7ddd3ad67d8b22387d6ceb0af43287b535e6530ed2867939a89d5a
MATLAB
3,545
94
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This loads celias tetrode data into a form that can be used by the % population vector code function [T] = load_celia_data_structure_as_table_v2(data) %data = load(dataFilename); %data = data.ratemaps; animalNames = ex...
03acc9cebf5aeff21eb83a3e3601bb38f4d1aec3736f5519f21a1f4d421557da
MATLAB
3,546
99
% stepParam2Vector.m % % Function that takes in legSteps struct and returns a vector of values for % a single field, during either stance or swing, at a specified times. % Holds the parameter value for the entire duration of the step (swing + % stance). Since steps are defined max-min-max position (forward walking, ...
614c2fa6cd387501a65a61843bf5e3f53b05c2407542cf16c31ae15444c240fd
MATLAB
3,546
133
close all clear all clc sessionsToUse = [2]; project = ml_util_json_read('project_config.json'); expRich = dir(fullfile(project.dataFeatureRichFolder, '**', 'experiment_description.json')); miceRich = initMice(expRich, project.analysisFeatureRichFolder); plot_mice_groups(miceRich, sessionsToUse) expPoor = dir(fullf...
d62fd0f4277dfdd0a2db92469054a6da50422b90a9e38eb45ba6baa9dbd8f6bc
MATLAB
3,548
71
% 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';...