sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
841a15066a05413e72b56093fcfef44aa91a11c86b992415dc09610e41503907
MATLAB
5,068
161
function [TimeSpan, NuArr, Net] = RNNDynamicsDisc(Net, TimeSpan, NuExt, dt) % Parameter processing. if exist('NuExt','var') % External input. if ~isempty(NuExt) if size(Net.CParam.JExt,2) ~= size(NuExt,1) %JExt viene definito direttamente nel test error('Num. of rows in NuExt does not match the column...
77767efba28053d91bce044878d06581e35d82d1bd6473523da71e7c09b89838
MATLAB
5,069
136
% PrepareFlyTracker4FixErrors(intrxfile,inflytrackerfile,inbgfile,incalibfile,inannfile,outtrxfile,outcalibfile) % intrxfile = '/groups/branson/home/bransonk/behavioranalysis/code/SSRNN/SSRNN/Data/bowl/GMR_71G01_AE_01_TrpA_Rig1Plate15BowlA_20120316T144027/movie_JAABA/trx.mat'; % inflytrackerfile = '/groups/branson/home...
12d94e9216f05507ebca779740b3a2ef4ccb8b3a529ebb15449cd8049d99499a
MATLAB
5,071
106
%% s_runAllModelFits.m % Main script to fit predict time series to measured time series. % % Some notes about this script: % * previous version of this function is: % simseq_fitTemporalModelPredictiosToDataWithPreproc('stimFileName',stimFileName, ...) % * We remove 10 TRs at the start of each predicted run's time serie...
6d3ff8beb5471a6093347d5d2993b8daeff9e2d80c15652811b9c84de7b04582
MATLAB
5,073
144
% dir_sub_save = 'CNMFE/cv_save_20221221'; % dir_sub_save = 'min1pipe/cv_save_20230111'; addpath(genpath('.')) gcp; %% % name of the videos 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; % fram...
353a1464a0cf8e99898f85bde12bbf21231d354c0adfeb66560f144da7671654
MATLAB
5,075
149
function cmap=fireprint(n,varargin) %FIREPRINT Colormap that increases linearly in lightness (with colors) % % Colormap that increases linearly in lightness (such as a pure black to white % map) but incorporates additional colors that help to emphasize the % transitions and hence enhance the perception of the dat...
a6dbb4211b0be9b1a751d1f53f29e5db2bf9167c40e2e1c0c8e76203abaf6a1b
MATLAB
5,076
164
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_stability_bfo90_table(StabilityBFO90, DaysToSessions, STABILITY_THRESHOLD_CRITERIA) % Makes a figure with 4 subplots each with a BFO 90 SessionsEarly = DaysToSessions(ismember(DaysToSessions.dayNum...
a5ce954e4080887b1b5d5dec6c60b1e1cdc3cca9165d93a01967aad10acd5d2a
MATLAB
5,078
187
function [dat] = read_combined_ds(dirname, hdr, begsample, endsample, chanindx) % READ_COMBINED_DS reads electrophysiological data from a collection % of files that are located in one directory, where each of the files % should contain one channel and should have the same sampling frequency % and number of samples as ...
a8113d820d8acecd2018d31b2c9a575405e3fb32b8a7744ddaf7d93794a5ad73
MATLAB
5,078
198
function [nt_per_trial,inter_time_touch,length_touch]=touch_variability_behaviour(Data,selected_trials,do_plot) %% touch_variability_behaviour calculates the most important touch parameters for the selected trials in Data % INPUTS % Data: data structure containing the behavioural and neural data % % selected_trials: bi...
4f80b8d1260ff1114a3f4a0568916520897116638fba6d7904ce8a1c1c54285a
MATLAB
5,079
150
function [F,G] = tdp(S,p,UC,A) % TDP time-domain parameters % extracts EEG features very fast (low computational efforts) % This is function was motivated by the Hjorth and Barlow % parameters. % % [F,G] = TDP(...) % % [...] = tdp(S,p,0) % calculates the log-power of the first p-t...
c42057210fd94c2fff0c38a99861a6b936e48f9a132903b88f627cd441d32832
MATLAB
5,079
140
% legImg.m % % Experimental Function % For simultaneous acquisition of leg tracking and 2P imaging data % % INPUTS: % settings - struct of settings from twoPhotonSettings() % flyData - fly metadata from getFlyMetadata() % exptDuration - duration of experiment, in seconds % % OUTPUTS: % exptReturn - returns 1 up...
adf14b144bed467c6ea1085c1f030a6e01c2c7893c134dd233f8182e721f08a7
MATLAB
5,080
137
function writeJAABA_core(moviefilename, trk, feat, calib, outdir, ... save_JAABA_trk_mat_file, save_JAABA_perframe_features, save_JAABA_movie_link_or_copy) % create the output directory if ~exist(outdir,'dir'), [success1,msg1] = mkdir(outdir); if ~success1, disp(msg1...
17f3f4249a379905f46977a09cbe262455e39da805a996eb5dcc556b7fb19de4
MATLAB
5,083
109
%% s_runAllModelPredictions % Main script to predict time series for entire run, based on pRF % parameters from a separate retinotopy experiment. % % Written by Eline R Kupers, Stanford U 2021 projectDir = simseqRootPath; verbose = false; % Print figures with predictions or not. veThresh = 0.1; % Variance explain...
cfe053a03267de25338e522b6c23ec2834a34157556a5f1daebdeafbd4144429
MATLAB
5,085
132
function [ah_bi, ah_uni ] = pairwise_corr_plot(X, VarName, varargin) % This function visualizes pairwise correlations among multiple variables % using 3D histogram and also plots univariate histograms. All of the axes % limits and color scales are synchronized across the subplots. The layout % of the subplots is design...
f6d010fdbf43d879af2df5a5937956f712a0ccb749e8afd2189d07fb9b4e31d0
MATLAB
5,089
147
%%%%%%%% edit these values %%%%%%%% frequencies = [ 1 ... ]; delays = [ 50 ... 100 ... 150 ... 250 ... 500 ... 1000]; intertrialinterval = 5; % in seconds numtrials = 5; stimamplitude = 6000; %in uA stimchans1 = [9 10...
e821df34ad775745b1a4223cd1a994010285842cd33eabead2d47ff77e70d52a
MATLAB
5,090
178
classdef parfor_progressbar < handle % PARFOR_PROGRESSBAR Progress bar suitable for multi-process computation. % % H = parfor_progressbar(N, 'message', 'property',value, ...) % creates a graphical progress bar with N iterations before completion. % A temporary file in tempdir is used to communicate among threads...
495d89c18b1d0312bb85846fc8381869fd20cd9d587e8a1a94d565b5a250c498
MATLAB
5,091
162
function [TimeSpan, NuArr, Net] = LinearDynamicsDisc(Net, TimeSpan, NuExt, dt) % Parameter processing. if exist('NuExt','var') % External input. if ~isempty(NuExt) if size(Net.CParam.JExt,2) ~= size(NuExt,1) %JExt viene definito direttamente nel test error('Num. of rows in NuExt does not match the co...
241b41760ae4d3a6706abaf9a25bcc89a1ed14149cfb6360309d63d75a7aa06d
MATLAB
5,094
120
function latestfile = getlatestfile(directory,type, filetype, partname) %% This function returns the latest file or folder from the directory passsed as input argument % Inputs: % DIRECTORY is the *FULL* path of a folder (required!!) % TYPE is a string that is either 'file' or 'folder' (required if additional arg...
decbd1e25e5887ace59975ac592d41ab1dd13c27e4d0d83f8b30620fd0018d53
MATLAB
5,096
182
% plotCondAEPPEP_allFlies.m % % Function that takes output files from saveLegStepParamCond_indpt() and % generates 2 plots: AEP and PEP % Either plots mean +/- std dev for each fly or across all flies. % Can select more than 1 output file, will plot on same graph % Select output files through GUI % % INPUTS: % datDi...
5807e64b301c609406d264d2d8d22b2cc0cdac6d0ceb6a1c50496043e59876ce
MATLAB
5,097
136
function S = netcdf(File,varargin) % Function to read NetCDF files % S = netcdf(File) % Input Arguments % File = NetCDF file to read % Optional Input Arguments: % 'Var',Var - Read data for VarArray(Var), default [1:length(S.VarArray)] % 'Rec',Rec - Read data for Record(Rec), default [1:S.NumRecs] % Output Argum...
6bc09ad05e2036c091d43f25834a9aba84bdb713b77de49cc85a534bd6233aae
MATLAB
5,097
142
% "Wire coil creator" tool for the entire coil. Models the outer surface % of coil windings by multiple wire segments. The output is saved in the % binary file coil.mat and includes: % Pwire{:, 3} - set of nodes for all wires % Ewire{:, 2} - set of edges/segments for all wires (current flows from the fir...
7e54abcce894fbf4d3dfd91856d0dabc6030f41c34ddda4aca76f1d61a5af3f0
MATLAB
5,100
111
histodone=0; histoflag = 0; Depth2Area = []; AllenCCFPath = fullfile(GithubDir,'allenCCF'); if ~exist(fullfile(SaveDir,MiceOpt{midx},thisdate,thisprobe)) mkdir(fullfile(SaveDir,MiceOpt{midx},thisdate,thisprobe)) end tmphistfile = dir(fullfile(SaveDir,MiceOpt{midx},thisdate,thisprobe,'*HistoEphysAlignment.mat')); if...
eea26a6e076abc37702749df6fd48ad001253271defb9d9346b43ae3c988f4eb
MATLAB
5,102
156
%%%%%%%% edit these values %%%%%%%% frequencies = [ 10 ... 20 ... 40 ... 80 ... 100 ... 160 ... 200 ]; delays = [ 150 ... 250 ... 500 ... 1000]; intert...
2731e53052f3d715b2f94f0e4d81b44ea060da31cc52184ae0e46c6cd7b6385d
MATLAB
5,107
165
%stochastic Lorenz system simulation % for paper "Inferring stochastic dynamics of complex systems", T.-T. Gao, % B. Barzel, and G. Yan % equation from paper 'Learning stochastic dynamical systems with neural % networks mimicking the euler-maruyama scheme' % and 'Dynamics and transitions of the coupled Lorenz system' ...
dee6a3529f00c080047b3e0d5e8a89f994162d2623cfcbf3aacb8daa8a442b6c
MATLAB
5,111
135
function varargout = save(tree, filename) % XMLTREE/SAVE Save an XML tree in an XML file % FORMAT varargout = save(tree,filename) % % tree - XMLTree % filename - XML output filename % varargout - XML string %__________________________________________________________________________ % % Convert an XML tree into a ...
3bd535d71985707d47e8db12e45eac32cceb483f2a5b4380846a31910817f68d
MATLAB
5,113
136
function salimg_opt = saliencyDetection(sourceim, model, net, descPara) if ischar(sourceim), I_org = imread( sourceim ); else I_org = sourceim; end % [ hsum, wsum, I] = ImageCrop( I ); [imh_org, imw_org, c] = size(I_org); if c ~= 3 % error('only rgb image is accepted'); I_org = cat(3, I_org, I_...
a71df1ad1242fc295d2d9cca7498899770f031b07c52ed52c47fff81c94096e3
MATLAB
5,114
169
function h=vl_plotsiftdescriptor(d,f,varargin) % VL_PLOTSIFTDESCRIPTOR Plot SIFT descriptor % VL_PLOTSIFTDESCRIPTOR(D) plots the SIFT descriptor D. If D is a % matrix, it plots one descriptor per column. D has the same format % used by VL_SIFT(). % % VL_PLOTSIFTDESCRIPTOR(D,F) plots the SIFT descriptors warpe...
cf67291ee108786ce70a9e037ce01469fa7cdc46ccf74c7757e3aaf797c2b148
MATLAB
5,115
141
function [SD] = exportOptodes(probe, ExportLocation) %EXPORTOPTODES Exports optodes of a probe into a SD file structure % Creates an SD file structure for use in AtlasViewer. Add fixed springs % between all optodes within modules to maintain the module shape when % the probe is registered to the scalp. Add loose ...
a66314a7fc571a2aeea6e2076aee9fb90f2816c58caf26c21ff580e3552cd21c
MATLAB
5,122
121
function rez = preprocessDataSub(ops) % this function takes an ops struct, which contains all the Kilosort2 settings and file paths % and creates a new binary file of preprocessed data, logging new variables into rez. % The following steps are applied: % 1) conversion to float32; % 2) common median subtraction; % 3) ba...
cae8cb52c7ec1c7f7fda855456a20c39fb1b4f368e63c72bb7e046f388ed051f
MATLAB
5,123
122
clear; markerbuffer(10, 1) = CEDMarker(); tmarkerbuffer(10, 1) = CEDTextMark(); rmarkerbuffer(10, 1) = CEDRealMark(); wmarkerbuffer(10, 1) = CEDWaveMark(); string = '1729 = 1 cubed plus 12 cubed = 10 cubed plus 9 cubed'; floats = rand(25, 6, 'single'); t = (2*pi)*(1:1200)/(30); t = int16(15000*(sin(t))); shorts = re...
fcbea87725e5e93ba7ad632f6d3bc3c21ef62f822ae8ae63c0d02918743c193a
MATLAB
5,123
174
%figS5_HRFA_7Hz_highFR_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_highFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% fprintf('loading %s\n',sspath)...
8e300a60e12773b1ad698330eddfd453e0f4484c662fc9628ca53a25d8296125
MATLAB
5,126
180
function gui_l (x, y) % % This file is needed by FASTICAG % The load dialog for loading new data % and new initial guess. % @(#)$Id: gui_l.m 8776 2013-11-14 09:04:48Z roboos $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf_FastICA...
e2e4017d6df69b1cadd55680176f28fdb6996d893aaecec3bfda6cd0de7c1ad1
MATLAB
5,128
174
%figS6_HRFA_32Hz_highFR_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_highFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% fprintf('loading %s\n',sspath...
f9a3926cc7ca4244e3495b1620abf8687200eb2d8ac7bea29da79e8f3cbe4576
MATLAB
5,130
149
function [A,S]=hierarchicalBenchmark(n,p,varargin) % hierarchicalBenchmark Hierarchical community strucuture benchmark % % Syntax %__________________________________________________________________________ % % [A,S]=hierarchicalBenchmark(n,p) % % [A,S]=hierarchicalBenchmark(__,Name,Value) % % % Description %_______...
733a45865ef46a0f9f60b0c632d484b14c82141aeaa40c3315c0d5cb1191312b
MATLAB
5,137
218
function layer_gen_info=gen_network_pool_block(refine_config, dag_net, layer_gen_info, layer_name_prefix) if ~refine_config.use_chained_pool return; end % original implmentation: % layer_gen_info=do_gen_block(refine_config, dag_net, layer_gen_info, layer_name_prefix); % improved version: ...
694ccc580a78b118cf0a2043c6e6f733e8905e341b68058476ccfced1edef6d1
MATLAB
5,138
215
function [DATA,msg] = aedes_readswiftsgl(filename,varargin) % AEDES_READSWIFTSGL - Read SWIFT reconstruction (*.sgl) files % % % Synopsis: % [DATA,msg]=aedes_readswiftsgl(filename,varargin) % % Description: % The function reads SWIFT reconstruction SGL files. If not % specified, [256 256 256] data...
55f9ee245654e059dcb13852c68a5ff6f6c5721752ba2d7c82e9388f4ceccfe0
MATLAB
5,139
141
% plotCondBinnedSpikerateFicTrac.m % % Function that plots spike rate vs. a FicTrac variable (yaw, forward, or % lateral velocity), conditioned on bins of another FicTrac variable % Pools over pData files, selected through GUI % Only on moving bouts % Wrapper for genCondBinnedSpikeRateFictracPlot() % % INPUTS: % tDe...
7711c3e9d9433d4d55d332b7f67891b4cb63ba9d48656af5825327d994012878
MATLAB
5,139
101
function [sp,F] = genNextCalciumDynamics(S, cal_params, sp) % [CB,C,F] = calcium_dynamics(S, cal_params) % % Function to simulate the underlying calcium dynamics with either a % single-occupancy or quad-occupancy model of protein <=> Ca2+ % interactions. The inputs to this model are: % - S - A Kx(nt) array ...
8e2e75a130c018a84a690ae66670fa63ed28173d4f4b26a36cc49c2996b1b119
MATLAB
5,144
187
function [] = ExtDataFig09_TuningCurve_OptStim_Song % Code for plotting the tuning curves in Extended Data Fig. 9b,c. % GT = 'w_Chr'; GT = 'pIP10_Chr'; % GT = 'dPR1_Chr'; % GT = 'TN1_Chr'; % GT = 'pMP2_Chr'; switch GT case 'w_Chr' Target = [1,2]; case 'pIP10_Chr' Target = [3,4]; case 'pIP1...
f11100a3abca83d2805d892034d76e1309ae28b2372ec7bf3939677d8a21b839
MATLAB
5,146
121
% run amapOFshow clear all; runMode = 'batch'; close all; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; GDEBUGNEW.on = 0; GDEBUGNEW.fig = 33; if GDEBUGNEW.on, figure(GDEBUGNEW.fig); clf; end; COMPUTE.sta = 0; % what to compute in amap DATA_TYPE = 'OF'; DATA_TYPE = 'EM'; PLOT_TYPE = {'...
fc4488c49c970961b24380b09b680e8622322b2ecec43e2e4dc0edab42768b21
MATLAB
5,148
163
% saveStepParamMultiCorr.m % % Function that takes output from saveBallLegStepParamCond_bouts() or % saveLegStepParamCond_bouts() and gets R2 from multiple linear regression % between specified leg step parameters. For all specified variables, % calculate regression where each one is independent variable being % pr...
4c04c0ef2d53642dc74b4139319429777d9b171f12fd56dbf7cad0b21c5b6539
MATLAB
5,149
169
function [h_marker,txtcoord]=clusterhull(mode,coord,partition,color) %function [h_marker,txtcoord]=clusterhull(mode,coord,partition,[color]) % %PURPOSE % %To draw a cluster visualization where the objects (represented by %points) belonging to the same cluster are presented by "cluster hulls", %polygons where the edge o...
ed09652409af0ca3cca7b6109956ac39c297a67b61f3330d65b32735999326c9
MATLAB
5,150
175
%figS11_HRFA_12Hz_primary_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_stdFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% fprintf('loading %s\n',sspa...
2bfd9b48ce8625e46fbe45b2bd638b2b42e0345f4834562a73f948531eafa759
MATLAB
5,157
106
function [experiment] = mltp_create_session_folders( obj, recordingsParentFolder, analysisParentFolder, experimentDescriptionFilename ) VERBOSE = obj.isVerbose(); if VERBOSE fprintf('Creating the analysis folder structure (if it does not exist).\n'); end ...
ef8331f9628a75ad923e2f6caba5ff06131988198d50b2312595697b57d40f5c
MATLAB
5,157
137
classdef CurrentClampSeries < types.core.PatchClampSeries & types.untyped.GroupClass % CURRENTCLAMPSERIES Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. % OPTIONAL PROPERTIES properties ...
874203b6319dcac6686c5726ed5af405db3f20393c76aa58b4cb4f92c04725ac
MATLAB
5,158
75
function [Ex, Ey, Ez] = bemf5_volume_field_electric_grad(Points, c, P, t, Center, Area, normals, R) % Computes electric field for an array Points anywhere in space (line, % surface, volume). This field is due to surface charges at triangular % facets only. Includes accurate neighbor triangle integrals for % ...
d5c23b2b8319a269a6d61c0f0aad0af930997fa77720d9ae3a88fbf2efaa1b65
MATLAB
5,160
178
function [] = ExtDataFig08_OptStim_TuningCurve_Song % Code for plotting the tuning curves of pulse and sine songs induced by optogenetics in Extended Data Fig. 8c,f. GT = 'pIP10'; Target = 'pIP10_NR'; % Extended Data Fig. 8c % GT = 'pMP2'; Target = 'pMP2_NR'; % Extended Data Fig. 8f switch Target case 'pIP10_NR' ...
417fdde53ebd7aa67633e71db694aa92cf14ab7db929eec4d85ba1cc939f7d49
MATLAB
5,162
189
function [] = Fig06_AveTimeCourseSongTrans_pIP10() % Code for plotting calcium signals and song probabilities during song type transitions in Fig. 6d. Target = 'pIP10_NR'; selpath = ['../Data/Summary_pIP10/']; load([selpath,'Transitions']) %% switch Target case 'pIP10_NR' Ylim_1 = [.1 .45]; Yhori...
322dba84ce6b44f0f2b44e845aa22421e27e9c8d44ebe0f6a7af761d4f77ba1c
MATLAB
5,164
170
function [ydata,errors] = tsne_p_sparse(P, parameters, no_dims, relTol) %TSNE_P Performs symmetric t-SNE on affinity matrix P % % [ydata,errors] = tsne_p(P, labels, no_dims, relTol) % % The function performs symmetric t-SNE on pairwise similarity matrix P % to create a low-dimensional map of no_dims dimensions (defau...
b0fac9eb78211c50a32663d015a25dac33de5f1c23ec8fa68c135dffd3367e28
MATLAB
5,165
152
% mglFigureText.m % % usage: textImage = mglFigureText(textString) % by: Benjamin heasly % date: 12/15/2023 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Render the given textString to an image. % usage: textImage = mglFigureText(textString) % % ...
cd7b04a546bfe31fbe7d6a47a88eb75988b350853ba6b609b19e6ee905f0c80b
MATLAB
5,165
150
function [phase_local, background, mask_eval] = VSHARP_k(GREPhaseSE, BrainMask, radiusArray, SMV_thres, Params, handles) % [phase_local, background, mask_eval] = VSHARP_k(GREPhaseSE, BrainMask, radiusArray, SMV_thres, Params, handles) % Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % ...
d0d2e0735ca1d225dc9f63633d8e7a1321475d2cfd3beec16495f6859e4a8232
MATLAB
5,168
90
function mltp_compute_bfo_180_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 % 180 degrees can be done for ...
e66e26986751118f231afff5df52403628a34bf6bfe8c3f37446f3db0580db73
MATLAB
5,170
182
%store_delta_matrices_nhp_data.m % repeats the autocorrelation step only % taking advantage of the option to save out % the input delta matrices %% clear all; close all; clc; warning('on','all') %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../helpe...
6ef430f31132641e9de776e3eabb5f1af3f045599badce383c51541f8d8da7a0
MATLAB
5,173
142
% legFictracImg.m % % Experimental Function % For simultaneous acquisition of leg tracking, FicTrac, and 2P imaging % data % % INPUTS: % settings - struct of settings from twoPhotonSettings() % flyData - fly metadata from getFlyMetadata() % exptDuration - duration of experiment, in seconds % % OUTPUTS: % exptR...
d03e9d5dea50e47fd1d1a2c9d590d161313a38db7ec0d89f31e7085cddc7035f
MATLAB
5,174
186
clear all close all % Fig 8E, Spectrin elements detachment off % setting up the initial configuration P.y0 = 180; P.x0 = sqrt(P.y0^2 - (P.y0/2)^2); P.max_y0 = 17*P.y0/2; P.max_x0 = P.x0*15; [r_s,T_s,edges_s,edge_type] = create_mesh(P); P.actin = 1:size(r_s,1); aux = find(r_s(:,1) == min(r_s(:,1)) & r_s(:,2) <= ma...
3234151e9d11034cb1738a5a308e91112b31b32082af2bfb135dcb149dcf9e81
MATLAB
5,175
99
function mltp_compute_singleunit_placemap_data(obj, session) % This will work for any shape. fl = dir(fullfile(session.getAnalysisDirectory(), '*_singleunit.mat')); for iFile = 1:length(fl) singleUnitFilename = fullfile(session.getAnalysisDirectory(), fl(iFile).name); data = load(single...
172ec13b7eec3ae8e455badeb8a2946ed24ceddd88c602c93898065a182c4c30
MATLAB
5,177
178
function y = no_mean_median(x,dim,flag) %MEDIAN Median value. % For vectors, MEDIAN(x) is the median value of the elements in x. % For matrices, MEDIAN(X) is a row vector containing the median value % of each column. For N-D arrays, MEDIAN(X) is the median value of the % elements along the first non-singleton ...
acc12fd33ff087366b648826f167b8ed78703032f4c5b28514c49db3ba8c85b3
MATLAB
5,177
143
classdef DecompositionSeries < types.core.TimeSeries & types.untyped.GroupClass % DECOMPOSITIONSERIES Spectral analysis of a time series, e.g. of an LFP or a speech signal. % REQUIRED PROPERTIES properties bands; % REQUIRED (DynamicTable) Table for describing the bands that this series was generated from. There s...
6a956b903e25ed8aaaaedc75758659da94180077a675c62008cf16a343ed5be4
MATLAB
5,178
139
function [p,s,i,ot,r] = doubleFlash_trial(iTrial,p,s,i,ot,r) % presents flashes and beeps (double flash paradigm) or visemes and % phonemes (McGurk) %-- fixation Screen('DrawTexture', s.window, s.fixCross,[],s.fixCrossRect); [~,fixOnset,~,~,~]= Screen(s.window, 'Flip'); ot.onsetFix(iTrial,1) = fixOnset; ...
78003e911260a0923894f94123067ece14382bb25e145a6b781d9ac360047413
MATLAB
5,178
181
function [prs,fval,H] = fminNewton(fptr,prs,opts) % [prs,fval,H] = fminNewton(fptr,prs,opts) % % Simple mplementation of Newton's method for minimizing a function % % Inputs: % fptr - function handle for loss function % prs - initial value of parameters % opts - struct with fields: 'tolX', 'tolFun', 'maxIter', '...
1e4c143f21e66c43c0cc511085c2261672dccd0ad6e0f40b159f2995047e5cb1
MATLAB
5,184
130
function [Neural_info,Mov_params]=neural_data_per_duration_normalised(Session,Area,sigma_filter,t_from,t_upto,duration_range) %% neural_data_per_duration_normalised selects the neural activity and the movement parameters for all movements within the duration range. % All neural trajectories are temporally scaled to the...
70efdb67d8c895d71e537aa00b2e119b4e4ca5af0e0fea242b658fe6adf469d3
MATLAB
5,184
167
% plot2LegStepParamBinBodyParam.m % % Function to plot two leg step parameters against each other, while % binning by a third parameter. Operates on output of % saveLegStepParamCond_indpt(). % Assumes saveLegStepParamCond_indpt() output file has values across the % range of the bodytraj parameter (i.e. don't use fil...
54394af66241ca107a300f6376a25542e5a4d3741b9cdc49696f4091e0878c5f
MATLAB
5,189
141
function imdb = setupVoc(datasetDir, varargin) % SETUPVOC Setup PASCAL VOC data % IMDB = SETUPVOC(DATASETDIR, 'EDITION', '2007') setups the % PASCAL VOC 2007 data. This is similar to SETUPGENERIC(), but adapted % to the peculiarities of this dataset. In particular, the % difficult image flag and the fact tha...
e8c14b82a3c72fa2e45f563a3f1191891ac8312ccc19761c6f8149741f88ce9b
MATLAB
5,191
105
function [fluor_smoothed, Noise_trace, smoothing_param] = smoothing_UFARSA(opt,fluor_preSmoothing) % [fluor_smoothed, Noise_trace, smoothing_param] = smoothing_UFARSA(opt,fluor_preSmoothing) % % this function performs a high-frequency noise reduction of the fluroescence trace, based on % the SMOOTHN method. Follo...
a338cb94c6b577472a18dc3e6e9628592e7045256574d5422feb33a55e5c30df
MATLAB
5,195
150
%Test FmaxGND function % %AUTHOR: Eric Fields %VERSION DATE: 12 June 2020 global test_xls_output; if isempty(test_xls_output) test_xls_output = true; end %Load a GND for testing FMUT_dir = fileparts(fileparts(which('B_FmaxGNDTest'))); load(fullfile(FMUT_dir, 'testing', 'data', 'EmProb_13subs_Test.GND'...
303470997f40cee994eaaa2a76254835cd512fe4925a6a4660f710897da687ec
MATLAB
5,196
171
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_stability_bfo90_table_percell(analysisSettings, analysisResults, DaysToSessions, STABILITY_THRESHOLD_CRITERIA) [T] = compute_stability_table(analysisSettings, analysisResults) % Makes a figure...
3157cda1cc99c033aee0605d88744507f4ca30451edcb2cdcaff9084f4fdd187
MATLAB
5,197
145
%# usage: b = fb_fir1(n, w [, type] [, window] [, noscale]) %# %# Produce an order n FIR filter with the given frequency cutoff, %# returning the n+1 filter coefficients in b. %# %# n: order of the filter (1 less than the length of the filter) %# w: band edges %# strictly increasing vector in range [0, 1] %# ...
366c6add12b4cfd9fa01ba53ae54d4f59077700ddeb778255f869a11d539656b
MATLAB
5,202
183
function my_net_backward(net_info, work_info_batch, data_info, net_run_config) gpu_mode=net_run_config.use_gpu; if gpu_mode if ~net_info.ref.net_on_gpu my_move_net(net_info, 'gpu') ; end data_info.ref.output_info_layers{end}=... move_output_info_gpu(data_info.ref...
c372db5640059520c2f41e13ce5dbe71c6d57c134b7114b93ae32d94191638ba
MATLAB
5,203
126
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [analysisInput] = analysis_load_marc_calcium_input_data(analysisSettings, dataFullFilename) % Load the main rectangular placemap data if isempty(dataFullFilename) [dataFilename, dataPath] = uigetfile(); ...
cecd58d1c326710ddfef0038c354e68951c18f77dae89b6f08f3aeefc52cc3ed
MATLAB
5,205
144
% For added_refined_masks % dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4'); % dir_SUNS_sub = fullfile('SUNS_FISSA_SF25','4816[1]th3'); % dir_SUNS_sub = fullfile('SUNS_TUnCaT_noSF','4816[1]th2'); % dir_SUNS_sub = fullfile('SUNS_FISSA_noSF','4816[1]th2'); addpath(genpath('.')) gcp; %% % name of the videos list...
5acea26520b145b14d5e4c78562c600b7d435230f5e8cc78e90b6b7f2df01ae5
MATLAB
5,207
179
function datout = spike22dat(filename, chans) %% Converts Spike File to continuous data structure % % Input: % filename % (chans) - which channels to import % % Output: % datout - dat object with fields: % 'data' - column vector of numeric data (row) % 'chanlabels' - string labels for each channel % ...
22a20ba3ce2f646386b86832506d3f5b5340c85d32d18f29002f414ab35e4bb3
MATLAB
5,208
118
%%% 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_...
36c542a38cb4f07109631bc3dd765c7fad8a5d4d00cfe16f6d94b51a3da97491
MATLAB
5,211
179
% f_findHFOxSLL.m [As a part of HFO Detection Project] % Written by: % Miguel G. Navarrete Mejia % Electrical Engineering MS candidate % UNIVERSIDAD DE LOS ANDES % Colombia, 2012 % mnavarretem@gmail.com function m_HFOEvents = f_findHFOxSLL(pstr_SignalPath,ps_SignalIdx,st_HFOData,... ...
53e16d773418a4e308cdd76367131cdc42d2ce9c0709b29bbceb933c2e8cd9e3
MATLAB
5,218
182
function [] = ExtDataFig08_Example_TimeCourseRaw_vPR9NP_SS3() % Code for plotting the example time courses of delta F/F in Extended Data Fig. 8j. GT = 'vPR9NP_SS3'; switch GT case 'vPR9NP_SS3' Target_FileID = 10; Target_ROI = 1; Target_Trial = 5; Target_WithinTrialID = 4; T...
847fd8c011c58607fa239f6c1af461752d8536a646fbceb8f7226792132bb796
MATLAB
5,218
152
clear close all clc % Credit: Esfahlani et al. (2022). % functions come from: % • Brain connectivity toolbox (https://sites.google.com/site/bctnet/) % • Caio Seguin's github (https://github.com/caioseguin/connectomics/) % • Custom code written for this paper specifically % if you use this script, please cite:...
b4a0980a9785b1bf77b9319c84566c202145f22519b2e495e72655acb67a26ff
MATLAB
5,219
141
function template = fillClass(name, namespace, processed, classprops, inherited) %name is the name of the scheme %namespace is the namespace context for this class %% PROCESSING class = processed(1); allProperties = keys(classprops); required = {}; optional = {}; readonly = {}; def...
507d68acdc0d44713b83767aae8f5db5daca081e6b7a429b7f2740273391e721
MATLAB
5,224
171
% eyeCalibDisp.m % % $Id$ % usage: myscreen = eyeCalibDisp(myscreen,<dispText>) % by: justin gardner % date: 12/10/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: run eye calibration routine, dispText is optional argument that % will display the passed ...
963d0892ee8b79f05229420a9d4b2e38a4515624f319ef69cc4a552ec7ca1e03
MATLAB
5,224
148
% findFlyNotMovingBody.m % % Function that takes in fly's smoothed translational speed and smoothed % angular speend, thresholds on those speeds, and a minimum bout length % to extract when the fly is moving or not moving. % Fly is not moving when speed below both thresholds % Merges bouts that are too short and ass...
d2d5954c41415e08f70bc5416b6cd4b0ccb25e43b5dd7576ce1f7ec4d8728e53
MATLAB
5,228
153
function mltp_compute_best_match_rotation_rect(obj, session) if strcmpi(obj.getArena().shape, 'square') [bfo_dist, angleCorrelations, angleCounts] = compute_best_match_rotation(obj, session, 'square'); elseif strcmpi(obj.getArena().shape, 'rectangle') [bfo_dist, angleCorrelations, angleCounts]...
6cf83351381658de0bac7b2b78634f14fed3f693e02e164b4f52dcb13415b8a4
MATLAB
5,229
153
function d = getdict % Dictionary of NIFTI stuff % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: getdict.m 8776 2013-11-14 09:04:48Z roboos $ persistent dict; if ~isempty(dict), d = dict; return; end; % Datatype t...
885eb6f72084ae2ef2010acd5ae6eb6b3acf0b182a2796cb23eaaadb145dbcce
MATLAB
5,236
169
function cnn_epoch_evaluate(work_info, opts, imdb, net_config, work_info_epoch) if ~work_info.ref.run_eva return; end if opts.use_dummy_gt return; end eva_param=opts.eva_param; class_info=eva_param.class_info; eva_result_epoch=work_info_epoch.ref.eva_result; valid_task_flags=work_info_epoch.ref.valid_ta...
9134ca2b6ee9a46d34cb31de3b0231e932cd85013a09ea8bf0f7ad0dfc5ed1b9
MATLAB
5,243
122
%Reduce data to the simplest design that can calculate an equivalent %effect. For example, for a 3 x 2 design, the main effects can be %calculated by averaging across the other factor and then conducting a %one-way ANOVA. Similarly, the interaction effect an be calculated by %subtracting across the factor with two ...
4345cfb852aae31b1c34d4fe6f25b9ceb2287184bcef3fc6a9363a06148309d7
MATLAB
5,246
155
close all; clear all;clc % dbstop if error % dbstop at 45 in AP_Statistic Fidx{1}=dir('DATA_C*.mat'); Fidx{2}=dir('DATA_T*.mat'); GroupName={'C','T'}; % % WantState=2;%1/2£º·ÖÎöwith/without holding״̬ϵÄÊý¾Ý NumbWant=1; BinWidth=50; BinL=0:BinWidth:900-BinWidth; BinR=BinL+BinWidth; Bin=[BinL(:),Bi...
54c0ea2e392ad065cee27ab0a90b56118622a97d508abb5be6352eaa7717fa4e
MATLAB
5,246
182
function [] = ExtDataFig08_Example_TimeCourseRaw_vPR9NP_SS1() % Code for plotting the example time courses of delta F/F in Extended Data Fig. 8g. GT = 'vPR9NP_SS1'; % 3-3-5, 3-4-1, 3-5-2; 6-1-5 switch GT case 'vPR9NP_SS1' Target_FileID = 3; Target_ROI = 1; Target_Trial = 5; Target_...
388a4cd27f86f055799ce131701fa2c1e896ffc8bad8608176eb458fe4a5b0f1
MATLAB
5,251
143
classdef IndexSeries < types.core.TimeSeries & types.untyped.GroupClass % INDEXSERIES Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, and the images in the stack to be referenced out-of-order. This can be for the ...
084b4bf63f03ae7b3976922fb10aa00f91394a2247da116224738c5c18af3418
MATLAB
5,260
198
% plotfresp() - Plot a filter's impulse, step, magnitude, and phase response % % Usage: % >> plotfresp(b, a, nfft, fs, causal); % % Inputs: % b - vector numerator coefficients % % Optional inputs: % a - scalar or vector denominator coefficients (IIR support is % experimental!) {default 1} % nf...
90bd64c4ac27aeee15f4f8ab99759a64694c75c078afbe8ba362a2895cc815b6
MATLAB
5,262
194
clear;clc;%close all dbstop if error cd('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M2\Recording_1') savename = 'd\d_100Hz'; savename=strcat(savename,'.mat'); load(savename) samplerate = 101.7253; % mouse 115, recording 1 (only recording) ...
0883bb6d42a5d7135c91911b180edc5e4b585f676ac4c8f4d45971812e3f4bde
MATLAB
5,263
115
function mlgp_compute_bfo_percell_180(obj, session) %fprintf('\tComputing bfo 180 for session %s\n', session.getName()); sessionName = session.getName(); placemapDatabaseFilename = fullfile(session.getAnalysisDirectory(), sprintf('%s_placemaps.mat', session.getName())); if ~isfile(placemapData...
ca34145562c8da0fc6eded2ded52f5a5e388c66e8aee430480ec7aa07f90dfdb
MATLAB
5,263
184
function [] = Fig06_Example_TimeCourseRaw_pMP2NP() % Code for plotting the example time courses of delta F/F for a pMP2 neuron in Fig. 6f. GT = 'pMP2'; switch GT case 'pMP2' Target_FileID = 7; Target_ROI = 6; Target_Trial = 6; Target_WithinTrialID = 3; TargetMic = 2; end F...
5b2fa5de7696ddbaf7d3a99a7913bffda5450afafc54f9146464eeeea0e1af62
MATLAB
5,264
122
%%% demo of the full MIN1PIPE %%% clear warning off gcp; min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder scale_lowBG = 5e3; scale_noise = 1; data_name = sprintf('lowBG=%.0e,poisson=%g',scale_lowBG,scale_noise); patch_dims = [253,316]; rate_hz = 10; % frame rate of each video path_name = fullfile('.....
6a992e5d5e6c34dd29e62fa93ce9b4392e7d1475d27caa4d458dfdea60115c5e
MATLAB
5,266
120
%% population trajectory clear load('stable.mat') for i=1:493 go=[population.goHit.eachDF{i}(46:90,:) population.goMiss.eachDF{i}(46:90,:)];%cue resposne time go=(go-mean(go(1:15,:)))./std(go(1:15,:)); stable.goR(:,i)=mean(go,2,'omitnan'); nogo=[population.nogoCR.eachDF{i}(46:90,:) population.nog...
cf6cda263fcbe5c64578c82b8403861adb4396b76c444732a68c677ce36a091c
MATLAB
5,266
184
function [] = Fig06_Example_TimeCourseRaw_pIP10NP() % Code for plotting the example time courses of delta F/F for pIP10 neurons in Fig. 6c. GT = 'pIP10'; switch GT case 'pIP10' Target_FileID = 5; Target_ROI = 3; Target_Trial = 6; Target_WithinTrialID = 1; TargetMic = 2; end...
0470162d5b80249c47c8aed94423d633a1bac56fbc2f03b84edf14fc81b6c154
MATLAB
5,267
177
function varargout=subsref(obj,subs) % SUBSREF Subscripted reference % An overloaded function... %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: subsref.m 8776 2013-11-14 09:04:48Z roboos $ if isempty(subs), return; end ...
daadb5ef0f8ce9c39c7a999c1d25c49a1c8dc15d4d31cf77ffc370f74195d378
MATLAB
5,273
123
% run amapOFshow clear all; runMode = 'batch'; close all; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; GDEBUGNEW.on = 0; GDEBUGNEW.fig = 33; if GDEBUGNEW.on, figure(GDEBUGNEW.fig); clf; end; COMPUTE.sta = 0; % what to compute in amap DATA_TYPE = 'OF'; DATA_TYPE = 'EM'; PLOT_TYPE = {'...
e103775edc054709f513fa405a78f0d835d3323a3fe28eea587f28a490204c65
MATLAB
5,273
107
function [var,pval,weights,res,Y_pred] = NCP_11_run_CCA(X,Y,cfg,molecular_names_table,dx_title,X_rot_ordered,type) save([cfg.dir.project,'\data\X.mat'],'X') save([cfg.dir.project,'\data\Y.mat'],'Y') % Update cfg with defaults cfg = cfg_defaults(cfg); % Run analysis main(cfg,X_rot_o...
66525bfee1c2905d274e5f600e5c6b82de522545ad23ebde98ef47d4f52f064c
MATLAB
5,276
145
% For added_refined_masks % dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th6'); % dir_SUNS_sub = fullfile('SUNS_FISSA_SF25','4816[1]th3'); % dir_SUNS_sub = fullfile('SUNS_TUnCaT_noSF','4816[1]th2'); % dir_SUNS_sub = fullfile('SUNS_FISSA_noSF','4816[1]th2'); addpath(genpath('.')) gcp; %% % name of the videos list...
7cf04c2ad1f1f00722ca22bd4859b1261bf0cef928b1806341021a81af077a31
MATLAB
5,278
233
% % Plot a hop plot. % % PARAMETERS % $network % % INPUT FILES % dat/hopdistr.$network % % OUTPUT FILES % plot/hopdistr.[abc...].$network.eps % a - Unscaled % b - Logistic distribution % c - Cauchy distribution % d - Hyperbolic secant distribution % e - Normal distribution % f - Weibull distribution % g - E...
cc18936da16178fc11272171cd49cb31272c4a736ec0ce98bb3ff057570c2695
MATLAB
5,278
182
function specific_filtered_movement_regressors(path_mov_reg,TR,filt_option,order,HCP_mat_path,FNL_preproc_version,PMU_dir,functype,restnum) %% This function applies a low pas filter to the motion numbers and save it with a different number %save('/mnt/max/home/andersp/FNLpreproc_v3_workspace.mat') %load('/mnt/max/home...
d43340dbe236c0fea2eca4a17cf3dae33d9be4aa4bc9083c50c78e7df4d380da
MATLAB
5,278
155
function descrs = encodeImage(encoder, im, varargin) % ENCODEIMAGE Apply an encoder to an image % DESCRS = ENCODEIMAGE(ENCODER, IM) applies the ENCODER % to image IM, returning a corresponding code vector PSI. % % IM can be an image, the path to an image, or a cell array of % the same, to operate on multiple ...
3c17f64b80fff2e7e94266db2708abaa22a941c8f7d54528a34ac7fe39d03900
MATLAB
5,279
161
clear close all clc addpath(genpath('J:\Data\Matlab')); %% Load file [spreadsheet,sheetpath] = uigetfile('*.txt','Select a txt file'); % Load the excel spreadsheet cd(sheetpath); t = readtable(spreadsheet); % number of segments, index of seg type(1:soma; 2:axon; 3:dend),x,y,z, dia, parent seg (-1:...
4b67fb92d4c8370c83e11b70ff56b8f8f64060fcee37af56a600e790c3a20c94
MATLAB
5,279
124
function [hdr] = read_biosig_header(filename) % READ_BIOSIG_HEADER reads header from EEG file using the BIOSIG % toolbox and returns it in the FCDC framework standard format % % Use as % [hdr] = read_biosig_header(filename) % % The following data formats are supported: EDF, BKR, CNT, BDF, GDF, % see for full document...