sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5fa52a37fb76cd4971d1409d6bcbf4f2d5b42a89767704073b0c911c8528a2e8
MATLAB
4,136
87
function [] = Fig03_Bidir_TN1dsx_Normalized() % Code for plotting the mean change in ΔF/F after song-type transitions relative to ΔF/F before the transitions in Fig. 3e,g. %% parameters T = 1370; % T Thre_Trans = 6; Thre_SongType = 0.05; Thre_Pre = 0.1; %% Song-type preference index (dPR1, TN1SG) load(['../Data/Summa...
767f57968137b704d93a9be1896479d3750a7e96859ad406c90eb4ab30f272cf
MATLAB
4,136
155
% f_GetBniSignals.m function [str_SignalsStr s_SigNum s_Scale s_SRate v_IniTime] = ... f_GetiSignalHeader( ... p_strBniName, ps_IsBinType) if nargin < 1 return; end if ~exist('ps_IsBinType', 'var') || isempty(ps_IsBinType) ps_IsBinType = 0; end if ~p...
9806f7ec8c6a3f8b677a2e154860090ee0bc8972e196c20a1d648926c99a0409
MATLAB
4,140
153
%SF3 load('Y:\Christian\Processed Data\Event Analysis\standard_ds_onsets.mat') %% MAKE FIGURES B,C,D [rate_mch_events,rate_tdt_events,rate_ex_events,durations]= supplemental_report_events (ds_events,2,'ratio'); %% FREQUENCY STATS %%-- Frequency stats mt=signrank(rate_mch_events,rate_tdt_events); me=signrank(rate_mc...
075ff8043f4388c2deca1ba99c48cbcb80c266e389bd5c76db1dc9f65b9b5b57
MATLAB
4,146
75
% not used in paper folder_name = uigetdir cd(folder_name) %open the directory of image sequence allFiles = dir(); %get all the tif files fps = 14; pirouetteCount = 0; tracksByVoltage = struct('maxVoltage', {}, 'LEDVoltages', {}, 'reversalCounts', {}, 'frameCounts', {}); for file_index = 1:length(allFiles) if allF...
c28c0a1e399819e57cab9c1797833a8a763349068a29abf7c4734d7d3680ea82
MATLAB
4,146
135
function [T_count, list,text_counts,text_missing] = scout_bids_for_gui_env(root_path,varargin) %% [T_count, list,text_counts,text_missing] = scout_bids_for_gui_env(root_path,varargin) % Oscar Miranda-Dominguez % First line of code: Aug 31, 2020 % % Use this function to extract a list of potential subjects with eno...
00b79598dbc2ab28babb85abe4d3e7219600bcddb163f736fac2deaebf43c66a
MATLAB
4,147
104
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This makes the paper's Figure 4B, which are the cumulative popvector % curves for across and stability for days 1,2 and 3. % The figure was post-processed to match the style of the paper. close all clear clc % Paths run('../load_f...
64e6e43cac8f8f33a5ad5967f4629a0575d66bf9923a102979b17a281326c3b8
MATLAB
4,147
115
%% Author: Jiri van Bergen and Xu Li % Affiliation: Radiology @ JHU - Kirby Center % Contact via xuli@mri.jhu.edu % Updated 2019-07-09 X.L. % Updated 2021-06-16 X.L., improved memory efficiency % Updated 2021-06-24 X.L., cluster version % Updated 2024-06-07 X.L., for cluster array %% Start processing of mult...
98c3e2c9015fef1d91d7c06c5d3eb41104da675929739fc7ef7e8333c223c31b
MATLAB
4,147
122
function [pntr, trir] = refine(pnt, tri, method, varargin) % REFINE a 3D surface that is described by a triangulation % % Use as % [pnt, tri] = refine(pnt, tri) % [pnt, tri] = refine(pnt, tri, 'banks', selection) % [pnt, tri] = refine(pnt, tri, 'updown', numtri) % % If no method is specified, the default is to r...
31e818393b052cdbf087c6103c8a9d4ec467ceadd8f7b55afc5e974ec94558a5
MATLAB
4,148
144
% % % make figure on formin, % % threshold 1.15 % % clear all %% excelname='Fig1D_1H FMNL1 precedes Arp3'; experiment='Fmn_arp_c1'; channel1 = readmatrix(excelname,'Sheet','Channel1'); timeinterval=readmatrix(excelname,'Sheet','time interval'); script_BatchProcess_IPI p2p_allconditions{3}=p2p_all_as_matrix; intensi...
7430ae122ab31a3dfbd6c81023a396037f1fad23f56e473a67dbe20e30bc58e4
MATLAB
4,149
124
% this script create 2-d slices for 3d scatter % 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z) clear; clc; close all; rootFolder = "figure_40_diff/"; % ON-ON data = readFilename(rootFolder+"asAllCriteria/*_*_*_*.png",'%f_%f_%f_%f'); data( all(~data,2), : ) = []; diff = 10; idx = data(:,4) < diff & data(:,4) >...
cc6b08cc0e962bc4f0404ebca57caca3133479f03342e6e2a11d79ec71508270
MATLAB
4,150
92
function ms = men_msGenerateVideoObj(dataFolder, scopeFilenamePrefix, scopeFilenameSuffix, timestampFilenameSuffix, timestampFilename, settingsAndNotesFilename, MAXFRAMESPERFILE) %MSGENERATEMS Summary of this function goes here % Detailed explanation goes here ms.dataFolder = dataFolder; % Added by GE to keep tr...
19247e911c97abdeeed2a274eb3558e522534690a4fc2ef0f1bdcc0b25a62b5a
MATLAB
4,151
108
function STS = rmap(spikes,y,y2,STS); % updates the STS global struct: STS.sts[], response map % input: % x, spike frames, % y, variable binned along x-axis % y2, variable binned along y-axis % %% ?REPLACE WITH?: (see trajPlot - works fine there!!) % STS = function Rmap2(uspikes,X,Y,STS) % Smap = zeros(yNbi...
a73ae93bd40cd97186ee43b85dde4adc81aa366a5aeec9b90813a7ea5635b287
MATLAB
4,152
102
function [Ci Q]=modularity_und(A) %MODULARITY_UND Optimal community structure and modularity % % Ci = modularity_und(W); % [Ci Q] = modularity_und(W); % % The optimal community structure is a subdivision of the network into % nonoverlapping groups of nodes in a way that maximizes the number of % within-gr...
6ad10e6fcb59c84f0dafa384f43381fe6ac86f4cc878053f31fd9a18a28c229d
MATLAB
4,153
122
gcp; addpath(genpath('.')) addpath(genpath(fullfile('..','ANE'))) %% % 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; % frame rate of each video th_IoU_split = 0.5; thj_incla...
478bbbdb41541fc21091a4c7e47af843fd52a4feafe8c23ba02a2a82201f598f
MATLAB
4,154
131
% Radial_Sym_Transform - Loy and Zelinski's fast radial feature detector % % An implementation of Loy and Zelinski's fast radial feature detector % % Usage: S = fastradial(im, radii, alpha); % % Arguments: % im - image to be analysed (after using imread for example:im=imread('lenna.jpg');) % ra...
c52fd3883b4384678eee7a32808ed1538c6dcb2004de6499be2415ff5e20452f
MATLAB
4,156
108
classdef SpatialSeries < types.core.TimeSeries & types.untyped.GroupClass % SPATIALSERIES Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has...
e210320f718d2997dbaf1f8d7781ad3d698f78b29994dbd7a07949c0720345ec
MATLAB
4,156
82
function write_nifti2_hdr(filename, hdr) % WRITE_NIFTI2_HDR % % Use as % write_nifti2_hdr(filename, hdr) % where % filename = string % hdr = structure with nifti-2 header information % % See also READ_NIFTI_HDR, READ_CIFTI, WRITE_CIFTI % Copyright (C) 2013, Robert Oostenveld % % This file is part of Fi...
c591b59d688821fd009b0ddbc3e5eb0f7377ae6505b4c37082c9ac6696a86e73
MATLAB
4,157
141
function A=blockModelSampler(W,S,k) % blockModelSampler Sample adjacency matrix for degree-corrected block-model % % Syntax %__________________________________________________________________________ % % A=blockModelSampler(W,S,k) % % % Description %____________________________________________________________________...
70d08e2fae54e9f8fc486865ded4c601d3f760feaeb5d401135002a5d901b876
MATLAB
4,161
84
function fH = plotLMMregressionSlopes_v_pRFsemisat_stRetParams(allLMMResults, ... params, roisToPlot, cmapROIs, saveFigs, saveFigDir) % Function to plot LMM regression slopes against DN-ST pRF semi-saturation % constant (Supplementary figure 9 in the paper: % Title: Rethinking simultaneous suppression in visual ...
fdebfefb878ea81b47bdbf081d3f1b6124b96d9d441a8e68b49412c6f2044aca
MATLAB
4,162
117
%runsta %run STA on units of one session % check consistency between all movies of that session %add: % b. Check consistency across movies % i. elecunit (all spikes from each elec) % ii. bundleunit (all spikes from all elec) clear all; globals; initglobals; DEBUG=1; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN...
c43d59f68f5eb6dd61700eb0e35232822f1c8124be035453c7f9731a10bc3092
MATLAB
4,163
86
function sigline_v2(xs,lbl,ymax) %%% 2024 NOTE: this is a slightly modified version of the 'sigline' %%% function originally authored by bethel osuagwu: % (https://uk.mathworks.com/matlabcentral/fileexchange/68314-statistical-significance-line) % Copyright (c) 2018, bethel osuagwu % All rights reserved. % % ...
9ee925c3098d84e5fba93e57e86fa8d85eae41e4e7cb6e2d10d6c52d8891e575
MATLAB
4,164
131
function [outcomes] = get_pop_sparseness_before(ds_events,ex_thresh,time_bin,before) %% % 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_resp,ex_type] = extract_onsets(cur_onsets,d...
1b5e7925b717aa5181e9b47c40ec792215da03d3a83f9fc18abe55ea72092247
MATLAB
4,166
161
function obj=matPlot(a, opt); % matPlot: Display a matrix in a figure window % % Usage: % matPlot(mat, opt); % % Example: % % === Example 1 % opt=matPlot('defaultOpt'); % opt.matName='Magic matrix of size 10'; % figure; matPlot(magic(8), opt); % % === Example 2 % opt=matPlot('defaultOpt'); % opt.matName='Random...
a515fdb14f2738af1bc3d210e1f1af4cd4a7665b4a66d8218f41da6cada292c7
MATLAB
4,170
127
% written by Marge Maallo, 15/11/2021 % CSAN, LiU % read response mat files for each subject and perform SVM classification % return confusion matrix % edited by Marge Maallo, 19/11/2021 % read in scaled timeseries % edited by Marge Maallo, 23/11/2021 % do 10 repeats so we can get an estimate eg SEM % edited by M...
03fedd44dc2a4016319817d4e2bb2e4ce4d25ca5996df1fa00d6a83e3d2f9034
MATLAB
4,171
156
% % Plot the spectrum over time. % % PARAMETERS % $TYPE "full" or "split" % $NETWORK % $DECOMPOSITION % % INPUT % dat/decomposition_time.$TYPE.$DECOMPOSITION.$NETWORK.mat % dat/decomposition_time_runtime.$TYPE.$DECOMPOSITION.$NETWORK % dat/stepsi.$NETWORK (full only) % dat/steps.$NETWORK.mat (split only) % % OUTP...
d7c8287ba46aab48874ae2ab3e039844a5e2387037ee0dd9a21578497f58ee56
MATLAB
4,171
158
function [dat] = read_nexstim_nxe(filename, begsample, endsample, chanindx) % READ_NEXSTIM_NXE reads specified samples from a NXE continous datafile % % Use as % [hdr] = read_nexstim_nxe(filename) % where % filename name of the datafile, including the .bdf extension % This returns a header structure with t...
d7a0d85758192d085118bc59fd0179076ad854fbf297aa243107537eceed51e8
MATLAB
4,177
143
% plotNormAEPPEP_allFlies.m % % Function that takes output files from saveAEPPEPbyCond_fly() and % generates a plot of the AEP or PEP for each leg, normalized to the % unmanipulated condition. Plots mean +/- SEM for each fly. Subplots for % each leg (left legs on left, front legs on top) % Select output files throu...
ecc38b8a265400d4d9dd37e54133fa33187a45df329fc4fd527b68c96cdfbbf2
MATLAB
4,177
124
%% Needs to be Manually Edited Every Time! pID = 'MG112'; data_dir = ['C:\Britni\Data\' pID]; cd(data_dir) filename = 'network_raw'; subj_dir = [data_dir '\' filename]; %% Initialization and Data Porting (BCD) % If something goes wrong, you're probably in the wrong folder mkdir(subj_dir) files = {'01...
baac60b6908fde9041a4b32896dc0f6dab7a3744e482c7d2198838ab2159b15e
MATLAB
4,178
75
% not used in paper %folder_name = uigetdir cd(folder_name) %open the directory of image sequence allFiles = dir(); %get all the tif files fps = 14; pirouetteCount = 0; tracksByVoltage = struct('maxVoltage', {}, 'LEDVoltages', {}, 'reversalCounts', {}, 'frameCounts', {}); for file_index = 1:length(allFiles) if al...
cdded100ec2147b8f4f2ca1c08aad2d4110c07b72f9df8437c2b589189602250
MATLAB
4,180
136
%Benjamini Hochberg correction clear all clc load('M:\Matt Chilvers\Documents\PhD\Project3_WhiteMatterLesion\Scripts\Plots\ScatterPlots\FinalRegressionAnalysis\Final\lm_data.mat') %load('/Users/dukelowlab/Library/CloudStorage/OneDrive-UniversityofCalgary/PhD_Projects/Project3_WhiteMatterLesion/Scripts/Plots/Scatt...
654ba5036f89a97cfec0b62d8549b25c86d89261b4124c66edc43625c199b357
MATLAB
4,183
121
%Test FclustGND 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 %Load a GND for testing FMUT_dir = fileparts(fileparts(which('C_FclustGNDTest'))); load(fullfile(FMUT_dir, 'testing', 'da...
f0d1982cb7005c93db27c29dd67c736cbef231181d8b1b51fe0205502e2fba8e
MATLAB
4,184
88
% recoverStimData.m % % usage: recoverStimData() % by: justin gardner % date: 04/29/08 % purpose: Run this function if you accidently stopped your % stimulus program while it was running (or the program % crashed) and you are at the debugger prompt K>>). This % will spit out some lines of...
864428d7c3fd50af7ad9d339141879e748afa6744c13e650e017d4ebb81ee302
MATLAB
4,191
113
function [select] = parameterselection(param, data) % PARAMETERSELECTION selects the parameters that are present as a volume in the data % add that have a dimension that is compatible with the specified dimensions of the % volume, i.e. either as a vector or as a 3D volume. % % Use as % [select] = parameterselection(...
e2529f28fd39457056e011cc344abb81b6dc9a01cfaaa7167840037bda4229b1
MATLAB
4,194
115
function result = DNmodel(param, prfResponse, useGPU) % Function to predict neural response to time course using the Divisive % Normalization (DN) model % % result = DNmodel(param, stim, t) % % INPUTS ----------------------------------------------------------------- % params : (struct) should contain the follow...
5abce39580e1a2d412dc954fc9dabf22ee71392b40613bd3804e5f501807c0e7
MATLAB
4,196
102
%clear PSTHarr tookthese function [PSTHarrNew,markFP,markFPfr]=FPpsth(camtime,timeFP_RS,timeFP_frames,dfofCorr,evTime,J,K,p,q,S,Norm) %J=500; %pre %K=500; %post %p=299; %start baseline J-p %q=50; %end baseline J-q %S=K; %skip this many after last event for i = 1:length(evTime); FPx(i) = find(timeFP_RS>camtime(...
c67615f568c2caa295feb6f9ce2ba565047cf904118e5cb6dab4363f5098ede2
MATLAB
4,196
120
function plotScalogram( obj, varargin ) % PLOTSCALOGRAM Continuous 1-D wavelet transform using Morlet wavelet % Use LFP online streaming recordings % % Syntax: % PLOTSCALOGRAM( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optional) ax Axis where to ...
89a4065b5792a3404c7c7dbe43a96d331b9cbad144fb8dbfbd9d446e56cedf35
MATLAB
4,197
111
function fH = plotPRFModelCVRSQ_violinPlot(ds,resampledCVR2,maxNC,roisToPlot,saveFigs, saveFigDir) % Function to generate Violin plots with cross-validated variance explained % (R^2) for each pRF model, % Set colors cmapModels = getColormapPRFModels(0); modelNames = {'LSS','CSS','CST'}; fH = figure; clf; set(gcf,'Pos...
f6bd2e8877544c47b9559cee2c17e6cff7bd9e8f45bf238d28497227a55a3bfc
MATLAB
4,197
125
% computeDFF_trial.m % % Function that converts background-subtracted fluorescence signal into % dF/F (for 1 channel data) or dR/R (for 2 channel data) for user selected % trial folder. Saves processed data in pData file in same folder. % Note: assumes that every imaging frame should be used for the baseline % calcu...
0854881f4811da2925c9779bbaff891dd1a697cac9b4c5f5c7d29685601cb00c
MATLAB
4,201
103
function [Ci Q]=modularity_dir(A) %MODULARITY_DIR Optimal community structure and modularity % % Ci = modularity_dir(W); % [Ci Q] = modularity_dir(W); % % The optimal community structure is a subdivision of the network into % nonoverlapping groups of nodes in a way that maximizes the number of % within-gr...
eb335156d43b2a9f803f6e215ab4b606a1ad35b360a91768977f1ccb9225e561
MATLAB
4,201
101
% function results_cell = read_fig2_results_from_xlsx(fname, sheetName) % reads the data from the specified Excel file and worksheet. % % Inputs: % fname (str): Name including path of the .xlsx document. % sheet_name (str): Name of the worksheet within fname. % % Outputs: % results_cell: Cell arra...
9c00f4d6ab1300e018c5372ea41879b9d5ca2b11b042cf1903c868ff68a37d20
MATLAB
4,202
121
function plotSignalAndStimulation( obj, varargin ) % PLOTSIGNALANDSTIMULATION Computes and plot standard spectrogram % Use with LFP online streaming recordings % % Syntax: % PLOTSIGNALANDSTIMULATION( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optiona...
e57f4c285d98ea66f37e0157ec249a1f4b29dbb18bd46226d976fef00776d6d7
MATLAB
4,207
114
function [pyr_mean_activity,mch_mean_activity,tdt_mean_activity,velo,acc] = get_mean_activity(base,ds_events,event_frame,ex_thresh) conditions={"SOM","PV","Mixed"}; for d = 1:length(ds_events) %-- load files for each dataset cur_onsets=ds_events(d).onsets; load([base ds_events(d).tag 'activity.mat']) ...
a28ecf110034ee22852b02de896c119ba26b5e34867913e516d968246347897f
MATLAB
4,209
105
function dfof=debleachBDH(time,sig,wavelen,savename,debleach_flag,numExp,startfit,endfit,baseline_method,manualbase)%,numExp startfit,endfit,baseline_method) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% exptname=strsplit(savename,'\'); exptname=exptname{1...
5655befa5c8229d3815eb1090371802d312ea3d48e8f65579f4a93aac1f71ec2
MATLAB
4,210
124
function [A,W] = fcn_match_length_degree_distribution(A,Dist,nbins,nswap) % [A,W] = fcn_match_length_degree_distribution(A,Dist,nbins,nswap) takes a % weighted, symmetric connectivity matrix, A, and Euclidean/fiber length % matrix, Dist, and generates a randomized network with: % 1) exactly the same degree sequence...
578ce8b54d20937e998ce346d3bb84f5f528c26ef6ae350b715e80410b4a3d74
MATLAB
4,210
117
function recovery_test(fig2) % this function test if later touches are less discriminable from the noise % (Fig 2) ff=dir('*.mat*'); nunits=33; AUC_1_correct=nan(1,nunits); AUC_later_correct=nan(1,nunits); AUC_12_correct=nan(1,nunits); AUC_later2_correct=nan(1,nunits); AUC_1_incorrect=nan(1,nunits); AUC_later_incorr...
053c26fef96d4bb4b42292b19a0fc9d83392f4ebcda56a7e4b8dfccf5454148e
MATLAB
4,218
131
function [out,sucessfulRead,rawOut]=readMetaData2Stitchit(fname,verbose) % Read acquisition meta data into a MATLAB structure % % function [out,sucessfulRead]=readMetaData2Stitchit(fname,verbose) % % Purpose % Read meta-data from a tiled acquisition parameter file and returns % mosaic meta data as a structure that Stit...
20bd98f1e7b8343cb3bbdfebe645f6c38690233492cad1601a0d29f6cff9f7ac
MATLAB
4,224
122
function [eeg] = read_ns_eeg(filename, epoch) % READ_NS_EEG read a NeuroScan 3.x or 4.x EEG File % % [eeg] = read_ns_eeg(filename, epoch) % % filename input Neuroscan .eeg file (version 3.x) % epoch which epoch to read (default is all) % % The output data structure eeg has the fields: % eeg.data(..) ...
9bf41b60897843327d8217f7b09890114783eb77c135cb96aad7199607646763
MATLAB
4,225
63
function dend_params = check_dend_params(dend_params) % dend_params = check_dend_params(dend_params) % % This function checks the elements of the struct dend_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - dend_params - Struct cont...
3e3e60ea8a3d60c46a06b7f770f9869b92919d4645b2e4c76c8042d75d85a085
MATLAB
4,228
165
function my_net_progress_disp(opts, exp_info, imdb, net_config) if mod(exp_info.train.ref.current_epoch, opts.fig_plot_step)~=0 return end if ~isfield(exp_info.train.ref.tmp_cache, 'epoch_eva_fig') f1=figure; exp_info.train.ref.tmp_cache.epoch_eva_fig=f1; % set(f1,'Visible', 'off');...
9144679909c9e0e122199f4a192a000b6311ba5c10bfca7c0e1b6a2d0dd75cde
MATLAB
4,229
122
% Starburst Algorithm % % This source code is part of the starburst algorithm. % Starburst algorithm is free; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later vers...
2a02bcea93af6d52c05489d5e692085b3bc67be4c725d626c23da4db81a785dd
MATLAB
4,231
123
function [C, C_raw, results_deconv, cc] = HALS_temporal(Y, A, C, maxIter, deconv_options) %% run HALS by fixating all spatial components % input: % Y: d*T, fluorescence data % A: d*K, spatial components % C: K*T, temporal components % maxIter: maximum iteration number % deconv_options: struct variable,...
83f74b100606db946385c4f946ddf3e64c7ea6f0011d320a5662c90844e5cc05
MATLAB
4,232
127
function [V] = ft_write_mri(filename, dat, varargin) % FT_WRITE_MRI exports volumetric data such as anatomical and functional % MRI to a file. % % Use as % V = ft_write_mri(filename, dat, ...) % % The specified filename can already contain the filename extention, % but that is not required since it will be added aut...
e4715f2c9a8f140c0a0d2fc314aae1b3e9acaec8fc4f8cbfb8e75b9e70ac8637
MATLAB
4,235
128
% plotMeanKernels.m % % Function to plot all kernels, where those relating the same variables in % the same direction are plotted on the same subplot. I.e. the yaw % velocity forward kernel for left, right, sum, and diff. Also shows % variance explained and number of flies in figure legend. Produces 1 % plot, with...
b73ca6b8446d5ed880341cac9af10d84adce1d9672a6507b71d17412a7cb4d37
MATLAB
4,237
133
function[data,h]=SONGetTextMarkerChannel(fid, chan, varargin) % SONGETTEXTMARKERCHANNEL reads a marker channel from a SON file. % % [data{, h}]=SONGETMARKER(FID, CHAN) % FID is the MATLAB file handle and CHAN is the channel number (1 to Max) % DATA is a structure containing: % DATA.TIMINGS: a length n vector with the...
fd48a413b877bfc36614e0435a77a189e407464a370a800337c100b8792d8058
MATLAB
4,237
108
function [nonLinearResponse, params] = applyNonlinearity(prfResponse,params) % Wrapper function to apply different types of nonlinearities depending on % the model type. % % INPUT % prfResponse : (double) matrix or array with dimensions time by % voxels [by channels] % params : (...
1219ace7ae75a5683f4cfa4083409b59004c354d3f1dcddb53578f602da9140c
MATLAB
4,238
113
% initUserDAQ.m % % Function to initialize user DAQ (i.e. DAQ that coordinates experiment and % collects appropriate voltage signals) % Sets up channels and DAQ and channel settings. Does not set up any % experiment-specific output streams. % % INPUT: % settings - struct from twoPhotonSettings() containing all DAQ ...
5be6172ac7eff0e8246ec6bc61c272c6e7924510e3ce3e5188f3002aabdbd049
MATLAB
4,242
119
function [globalmatrix, localmatrix] = getSMGMatrix(probe,outputtype) %GETSMGMATRIX Summary of this function goes here % Given a characterized probe, this function outputs a % [nGroups+2]x[1+nModule] matrix for use updating firmware of master % board of fNIRS modules. Two rows are added to the number of groups, ...
9e98f6fd7e881c5e0f161472b7e501f91998f51e1d2dfaac5ec5c86fe929ba16
MATLAB
4,243
189
% Author: Guosheng Lin (guosheng.lin@gmail.com) % This is an example of resume training with lower learning rate. function demo_refinenet_train_reduce_learning_rate() rng('shuffle'); addpath('./my_utils'); dir_matConvNet='../libs/matconvnet/matlab'; run(fullfile(dir_matConvNet, 'vl_setupnn.m')); run_config=[]; ...
f83d7c91a18b409086351ba8c7396f34bb115edd68d2b9ed6595d0a986558358
MATLAB
4,243
102
function [to_eval,eval_i,j]=tag2eval(tag_contents,to_eval,eval_i,j,tags) %TAG2EVAL Extacts statements for evaluation by XML2MAT % %Syntax: [to_eval,eval_i,j]=tag2eval(tag_contents,to_eval,j) % %Description: % Autorecursive function that parses tag_contents structure % generated within XML2MAT (see %RECOVER STRUCTURE w...
1b04609f9459c297da7f4b71778555045ee0c1616c04fb00970a75bb847e04af
MATLAB
4,248
126
function [MAT,VARNAME,tag_contents]=xml2mat(XML) %XML2MAT converts XML string into matlab structure variable %Syntax: [MAT,VARNAME,tag_contents]=xml2mat(XML) %Description % XML is an XML formated string using rules compliant with % the proceedure implemented in MAT2XML. % It can also be a file name with MbML t...
5a8c946915acf95a703b527e7a2434fe80f65a7d2bb3b2723f02f9127dc8077b
MATLAB
4,250
92
function [N E] = rentian_scaling(A,XYZ,n) %RENTIAN_SCALING Physical Rentian scaling % % [N E] = rentian_scaling(A,XYZ,n) % % Physical Rentian scaling (or more simply Rentian scaling) is a property % of systems that are cost-efficiently embedded into physical space. It is % what is called a "topo-physical" property...
ebdfd8e52b638b486861e9475a3e6d9ca8078500146629fbf18904c647b4bb33
MATLAB
4,250
93
classdef RECORDINGMODE_STREAMING < RECORDINGMODE_COMMONMETHODS % Object with properties and methods to analyse streaming 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, C...
7b45cce8dc6ec3bef8401812c0338889283678c334c65b253c00c7d9387826e5
MATLAB
4,253
110
classdef TimeIntervals < types.hdmf_common.DynamicTable & types.untyped.GroupClass % TIMEINTERVALS A container for aggregating epoch data and the TimeSeries that each epoch applies to. % REQUIRED PROPERTIES properties start_time; % REQUIRED (VectorData) Start time of epoch, in seconds. stop_time; % REQUIRED (...
435ab276349101b6f18aa35e1350660e0be399d26a2143cc6763651ac3552250
MATLAB
4,255
120
% plotScatterPCAStepParamsInterp.m % % Function to plot scatterplot of output of savePCAinterpStepParam() % Plots each step param set 1 PC1 vs set 2 PC1, with option to color by % another step parameter or body parameter % Select output file of savePCAinterpStepParam() through GUI % % INPUTS: % datDir - path to fold...
ffb8b34e771951bba011b41cbcdd4e94ee04257f08fa7772949d8ccf12157a7c
MATLAB
4,256
84
function [resampStruct,spikes,fluor] = generateNextTimePoint(spike_opts, cal_params, n_locs, mod_vals, resampStruct) % S = generateTimeTraces(spike_opts, S_times) % % Generate time traces for a number of simulated neurons. Each neuron fires % with as am independent Poisson process with a given rate. The firing % rat...
ab84eaa6b4e3793be99199af3d88e090eb3e25b31750019e762e9fdb145b8ea7
MATLAB
4,257
136
function [trax_X,trax_Y,track_data, track_set] = TrackFinderv2(X,Y,cords,FR, speed) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here remove_blanks = ~cellfun('isempty',cords(:,:)); cords = cords(remove_blanks); for i = 1:length(cords) big(i) = length(cords{i}); end win...
12856968e4fc56ec6e7b9850bb3c0917b4f11d95469e66195a56b0c6531363c5
MATLAB
4,258
147
function r=embedding_dimensions_upper_bound(Session,Area,Ndir,Nbins,threshold,t_from,t_upto,edges_dur_bin) %% embedding_dimensions_upper_bound computes the upper bound of the coefficient of determination % between the trajectories within the same bin direction and duration from % Session and Area % This function al...
8db415c03df3bb108059108ef29b791a90af1f127db8d641d9152e866f21988d
MATLAB
4,261
117
classdef MLArenaRectangle < MLArena properties x_length_cm; y_length_cm; end % properties methods function obj = MLArenaRectangle(referencePointsVideo, x_length_cm, y_length_cm) % Validate the inputs if ~all(size(referencePointsVideo) == [2, 4]) ...
dadb4e763eef04f0051278efbf2d5975780975a81f39db9b6d66039a043d4f60
MATLAB
4,265
129
function outexpdirs = PrepareSimTrx4JAABA(trxfiles,expdir0,varargin) if ~iscell(trxfiles), trxfiles = {trxfiles}; end [rootoutdir,dataloc_params,analysis_protocol,settingsdir,is_temporally_aligned,forcecompute,nooverwrite] = ... myparse(varargin,'rootoutdir','',... 'dataloc_params',[],... 'analysis_protocol',...
253f4ebbd5fbd53f38fb2ad3f3b622ed7d957e6262fbdb538f15fc9ceed99e7f
MATLAB
4,267
130
function out = summarize_coherency_table(fn) if nargin < 1 fn = uigetfile('output/*_table.csv'); end fprintf('Performing summary of %s output\n', fn); outputFolder = 'output'; if ~isfolder(outputFolder) mkdir(outputFolder) end filename = 'coherency_summary.csv'; fid = fopen(fullfile(outputFolder, filename), ...
6f7f4faf35b2689d95ad5e19b74891443ba2f5de67635886105cca6b6a8e1c43
MATLAB
4,267
102
function [calciumEvents] = ml_cai_neuron_calcium_events(neuron, timestamps_ms, spike_timestamps_ms, MAX_SPIKE_SEPARATION_MS) %SPIKE_THRESHOLD = 0; %MAX_SPIKE_SEPARATION_MS = 100; % % Only use spikes whose values exceed the given threshold % si = find(neuron.spikes > SPIKE_THRESHOLD); % % % Ti...
5c7491dc39c0b3e788e67991c43f69b5752b6f3bbc9fa226a061271863c6a97d
MATLAB
4,269
117
function varargout = attributes(varargin) % XMLTREE/ATTRIBUTES Method (handle attributes of an element node) % FORMAT varargout = attributes(varargin) % % tree - XMLTree object % method - 'set','get','add','del' or 'length' % uid - the UID of an element node % n - indice of the attribute % key - stri...
9fa90bd87da91e4911ce4337338602171a98de7cbf515c39b746c35699e1a582
MATLAB
4,270
101
function [segMat_405_Control, segMat_472_GCaMP, segMat_Diff] = segMatrix(params) %% Import & organize data % Choose Which mouse to load from if params.mouse == 1 load('Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Experiment 2\drive-download-20180713T210854Z-001\Raymond_071318_LFP_M1\Recording_1\MATLAB V...
c84be9bdac304bd1c4cc894746898ee7c1691659cb211f0884e4f8b48a620e49
MATLAB
4,270
134
function real_neuron_select % post process: semi-auto false positive removal % Jinghao Lu, 10/02/2017 %% initialization %% %%% select processed file %%% [file_name, path_name] = uigetfile('*.mat'); file_id = file_name(1: end - 4); %%% load files %%% load([path_name, file_name]) roi =...
86ccaa00833c7462d4999c6fc8f90686c393beaca7c35788559c20f02b0a93f4
MATLAB
4,271
121
% computeLegFictracOpto_1Fly.m % % Function that extracts the individual leg traces and FicTrac, in response % to optogenetic stimulation of different durations and intensities (ND % filters) for a single fly. % User selects all pData for that fly through the file selection GUI % Saves the data as a struct in path sp...
d697a23bb756371c1678a044c0170ffa6ba65b30702d2301d26a32653450503f
MATLAB
4,271
175
% Function File: [fit S] = chebexp (x, y, n, Tn) % % Returns the least-squares unconstrained fit of n exponential % components with constant offset to XY data using the Chebyshev % algorithm [1]. The interval in the x dimension must be constant. % % This function is effective in finding a solut...
ea2edac75e7274d7b13aa58c897b852134fa13e1b6ed4ec6ac984a911c67571a
MATLAB
4,271
137
function [trax_X,trax_Y,track_data, track_set] = TrackFinderv2(X,Y,cords,FR, speed) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here remove_blanks = ~cellfun('isempty',cords(:,:)); cords = cords(remove_blanks); for i = 1:length(cords) big(i) = length(cords{i}); end win...
3a2ad56b09940f9e4c0ee4cd909d2267337667cf2d06b82130ff22df9ec0d825
MATLAB
4,273
117
function [status] = ml_cai_miniscope_recording_status( trialFolder ) fnSettings = fullfile(trialFolder, 'settings_and_notes.dat'); fnTimestamp = fullfile(trialFolder, 'timestamp.dat'); status = []; status.settingsAndNotes.exists = isfile(fnSettings); status.timestamp.exists = isfile(fnTimestamp);...
5df9a0213455df057de8937adf79c7b162fa5f55ad0acd7a5eb9d71a26c03ab3
MATLAB
4,273
143
function plot_func(T,delta,l,num_columns,t_j,t_total,dt,npp,N,num_VTA,R_it,R_kt,T_pt,T_dt,W_ji,Title,t_stim,dopa,dopa_plot) %info num_VTA = npp; new_rate = zeros(2*num_columns,numel(t_j)); new_rate_ele = 0; new_rate2 = zeros(2*num_columns,numel(t_j)); new_rate_ele2 = 0; pop_vect = 0:npp:N; set(0,'DefaultAxesColorOrder'...
ca0e959ae791a5b831850671cf3f2fac1969d3e1083e1bae55f32568fac12664
MATLAB
4,273
84
%% Description %{ This script computes burst occurrence rates for the beta (20-30 Hz) and gamma (60-92 Hz) bands and tests whether burst rates of a mouse (in a solitary condition) change in response to threats instigated by a spider robot. %} %% Configure Library Path UTIL_DIR = genpath('/Users/scho/Cho2024_MouseEsca...
b0354cbc49a920465580876f0025558e17d4e3e3b65df48d4d972896a9f6815e
MATLAB
4,276
101
% check EEG-fMRI for individuals % SI Table 16 % % 2023-10-13 Jonathan Wirsich [confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_conf_tle(); for atl=1:1 %load connectomes [allgroup_mean_fMRI, allgroup_mean_EEG, allsub_fMRI, allsub_EEG, groups, ... group_...
0148ee6f2d6f0901479055a827fe1b89c5694f017de57ad025354717ac1e10c2
MATLAB
4,277
142
function results = vl_test_svmtrain(varargin) % VL_TEST_SVMTRAIN vl_test_init ; end function s = setup() randn('state',0) ; Np = 10 ; Nn = 10 ; xp = diag([1 3])*randn(2, Np) ; xn = diag([1 3])*randn(2, Nn) ; xp(1,:) = xp(1,:) + 2 + 1 ; xn(1,:) = xn(1,:) - 2 + 1 ; s.x = [xp xn] ; s.y = [ones(1,Np) ...
0fc1741ab06602c436a961e11d754ab2eaa8487813aa8323b0568826885a36dc
MATLAB
4,278
98
function [boxes blobIndIm blobBoxes hierarchy priority] = VideoFrame2HierarchicalGrouping(colourIm, flowIm, segmentIm, sigma, k, minSize, colourType, functionHandles) % function [boxes blobIndIm blobBoxes hierarchy] = Image2HierarchicalGrouping % (im, sigma, k, minSize, colourType, functi...
bf8e8b421d03383dbeba78fa60722aca27611781208ec5a8bbcc825638bbebc5
MATLAB
4,285
139
addpath(genpath([getenv('AUTOTOP_DIR') '/tools'])); clear; subs = ls('datasets/HCP1200_testSet/ManualGroundTruth'); subs = strsplit(subs)'; subs(end) = []; comp = {'manual_lbl' 'labelmap-postProcess' 'subfields-BigBrain'}; task = {'Task101_hcp1200_T1w' 'Task102_hcp1200_T2w' 'Task103_hcp1200_T1T2w' 'Task104_hcp1200_b1...
8df2ef4c933b311f34145fab77b0d696593f8304b3bab754081fbaff1b299111
MATLAB
4,290
113
function [evt,evm] = markpointproc(CIF,CIFMAX,MKF,TIMEMAX,NUMMAX,MARKDIM,HISTLEN) % MARKPOINTPROC % [T,M] = MARKPOINTPROC(CIF,CIFMAX,MKF,TIMEMAX,NUMEVMAX,MARKDIM,HISTLEN) % generates a marked point process using the conditional intensity % function CIF and mark generating function MKF. Events are generated % until...
0dec99edbe31786229f5d6f7277ead6a68302b567a35a2ec4bd15e82dbaa5e61
MATLAB
4,292
101
% init global values %clear STA STAshuf STS; %SearchSubFolders = 0; % if 1, search files in all subfolders SearchSubFolders = 1; % (ehud jan 1 2019, for new data) if 1, search files in all subfolders Nboot = 100; basecolors='rgbmcky'; bef_s = 0.05; aft_s = 0.05;%s. STA pars yBins = [-90:20:90]; STS_FUNC='sta'...
4c83cf1bad38e1a6b0c1c0f0df44b6de4b79cde7252ad12077eb873af87f6714
MATLAB
4,292
92
% Calculate spatial contribution to gloab EEG-fMRI correlation and local EEG-fMRI correlation % Figure 3 and SI Table 7, 8 and 15 % % 2022-08-22 Jonathan Wirsich % 2023-08-16 Bug fix (only push selected subgroups for permutation) - jwirsich % 2023-10-13 Add Interhemispheric subnetwork [confs, confs_label, groups, eeg_c...
07c579ee64ec8dba2d0977668803e1bee71356639589c9cdfebe9f802e4734a7
MATLAB
4,296
121
%% LCMV Source Reconstruction example script.[Helped provided by Marius Krösche] clearvars; clc; % path settings ft_path = '/home/rasfay01/fieldtrip-20230503'; %fieltrip path addpath(ft_path); ft_defaults; subject_path = '/data/raw/hirsch/RestHoldMove_anon/sub-0cGdk9/ses-PeriOp/'; % example for only one subject and on...
9925114175ac5d113b87667bc727b219e9791bc1b801214e8b33b5509b193b6c
MATLAB
4,297
109
function [event] = read_shm_event(filename, varargin); % READ_SHM_EVENT reads the events in real-time from shared memory % this is a helper function for READ_EVENT % Copyright (C) 2007, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation and detail...
bd3a4d557da0352fff7e5422dd29bf4ae9ed7c573474fd9b14c18b2fb720105a
MATLAB
4,299
135
function salopt = saliencyPropagation(im_d, imsegs, inimap,... alpha, gamma, sigma, mask, maskmap, imgplane) %% get segments info nseg = imsegs.nseg; adjcMatrix = imsegs.adjmat; pixelList = imsegs.pixelList; %% get features an annotated labels fgWeight = zeros(nseg, 1); mskweight = zeros(nseg, 1); for i = 1 : nseg...
ff779ae144fcdcf8c361dce2ed9ad5d40139181b8315302a468114d2abdefd17
MATLAB
4,300
113
% This script assigns coil position, dIdt (for % electric field), I0 (for magnetic field), and displays the resulting % head-coil geometry. It may be be executed several times to adjust the % coil position % % Copyright SNM/WAW 2017-2020 showfig = 0; addpath('../../../../FMM3D/matlab'); %% Defi...
fb131a741e65abff30a1bf72bca9951882fd942d8a9527d1d3a3a928f0c89251
MATLAB
4,302
109
function UMparam = DefaultParametersUnitMatch(UMparam) % Checks if all required parameters are there, and will fill in default % parameters if not wherever possible %% Check if path information is given % Kilosortversion? if any(strfind(UMparam.KSDir{1},'KS4'))||any(strfind(UMparam.KSDir{1},'kilosort4')) UMparam.Ki...
6f4683799e31ec12c1531ba4dbff4cacf5ba9ee63b47375a302fd79e946e708c
MATLAB
4,304
92
function dspec=dspecBuild_lab(dspec,includeInModel,numNeuron) durationH=200; durationP=200; durationI=460; durationO=460; durationL=360; durationR=360; durationG=2000; durationM=1500; if ismember('H',includeInModel) bs = basisFactory.makeNonlinearRaisedCosMine(10, dspec.expt.binSize, [0 durationH], 1); dspe...
3ab08898938ac4225bd178e27263c7b14d549cac73f6d466669ac0d023f80e98
MATLAB
4,306
97
% run amapOFshow clear all; runMode = 'batch'; 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 = {'tuning'}; %...
86df47e38fcb4650049acf47eec71174cae9072405b46a7e21c0ad3c8d1aaf9e
MATLAB
4,306
123
function [varargout] = ndgrid(varargin) % NDGRID Generation of arrays for N-D functions and interpolation. % [X1,X2,X3,...] = NDGRID(x1,x2,x3,...) transforms the domain % specified by vectors x1,x2,x3, etc. into arrays X1,X2,X3, etc. that % can be used for the evaluation of functions of N variables and N-D % interpola...
deabb1d44f8693a05dd6ffd78c72490642f6aac3d5caff37aaece21ffb86323b
MATLAB
4,318
144
function [] = ExtDataFig04_TuningCurve_OptStim_Song_HighMagSine % Code for plotting the tuning curves of pulse and sine songs induced by optogenetics in Extended Data Fig. 4b–d. GT = 'pIP10_Chr'; % Extended Data Fig. 4c % GT = 'w_LChr'; % Extended Data Fig. 4d % GT = 'pIP10L_Chr'; % Extended Data Fig. 4b % GT = 'pIP10...
6c2dc511acc6578cbd1d77473c1915ed1b63fd8722ca9572282befc761a991dd
MATLAB
4,320
138
% ---------------------------------------------------------------- % Load Dataset % ---------------------------------------------------------------- unzip datasetImages.zip data = load('vehicleDatasetGroundTruth.mat'); vehicleDataset = data.vehicleDataset; rng(0) shuffledIndices = randperm(height(vehicleDataset)); id...
aa7e5873b67cb122dec3ec2044cbe70e8275d8bce78c3162ca639598d2ac9686
MATLAB
4,320
163
% % Plot the evolution of a network statistic over time. % % PARAMETERS % $type "full" or "split" % $network % $statistic % $disable_runtime "1" to not generate the runtime plots % (runtime data is not generated for % spectral statistics) % % INPUT % dat/statistic_time.$type.$statistic.$network % dat/sta...
6bfebf7e0615874f432516d2ea671ef567c36d3c9a30e6c1ef50610856bed95a
MATLAB
4,321
129
function [spike] = read_neurosim_spikes(filename,headerOnly) % READ_NEUROSIM_SPIKES reads the "spikes" file that is written by Jan % van der Eerden's NeuroSim software. The output is represented in a % structure that is consistent with the FieldTrip spike representation. % % OUTPUT % spike: A fieldtrip raw spike stru...
b05eaabb26fae665cca0e2995d25502d5c2edf89665f294f93cf6d67fa97968c
MATLAB
4,322
134
addpath(genpath('gifti-master')); f = fopen('datasets/testSet.txt'); subs = fscanf(f,'%c'); fclose(f); subs = strsplit(subs); subs(end) = []; shp = [254 126]; DTIsubs = []; n=0; for s = 1:length(subs) for LR = 'LR' n=n+1; midthick{n} = ['datasets/HCP1200/results/sub-' subs{s} '/surf_T2w/sub-' su...