sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
023487959dd51eed44cdadaaf34887b1ff86d1f5f95a129a7f2e7655d8bcf05b
MATLAB
6,949
255
close all clear all clc minDistance = 10; xedges = linspace(-minDistance, minDistance, 100); yedges = linspace(-minDistance, minDistance, 100); DO_ANIMATION = true; HEADING_OFFSET_DEG = 90; % Arena a = [0, 30]; b = [0, 0]; c = [20, 0]; d = [20, 30]; refCanPts = [a(1), b(1), c(1), d(1); a(2), b(2), c(2), d(2)]; poly ...
d0e1f104a04b822f35ee742ab1ac88e3c620c7b307caa5e01e9a8f62f2e9190d
MATLAB
6,966
173
function VOR_DarkRearing(params) %% runVOR Analyze VOR behavioral data directly from Spike2 files (.smr) % % modified from SineFitBNwSlip_GenSD_auto 8/2012 by Hannah Payne: % - automatically import files directly from Spike2 (.smr) to Matlab % - improve readability/maintainability % - Display saccade eliminat...
f4b42abb973ac034310efca3240dac9031d985022196899bb7cfa3dcaaf67f8f
MATLAB
6,968
205
function [HDR]=famosopen(arg1,arg3,arg4,arg5,arg6) % FAMOSOPEN opens FAMOS file % However, it is recommended to use SOPEN instead . % For loading whole data files, use SLOAD. % % see also: SOPEN, SREAD, SSEEK, STELL, SCLOSE, SWRITE, SEOF % HDR=famosopen(HDR); % $Id: famosopen.m 8776 2013-11-14 09:04:48Z roboos $ % C...
434de395e62ea944f2b43be3ad306d9e06371216f241f4a7837577ad28e9b10f
MATLAB
6,970
169
% figureS6(data_dir, read_from_excel) % % INPUTS: % data_dir (str): Path to source data (default: 'source_data'). % % read_from_excel (bool): Flag to read from Excel (true) % or .mat files (false) (default: false). % % Mackay et al. 2024 (DOI:10.1038/s41467-024-52295-5) % License:...
4b1ba74e0dc6f9201ea31b9e966abaded0e2660c97d2390034eed6051fab64dd
MATLAB
6,984
194
function [image_new_crop, mask_new_crop, mask_new_full, select_frames_class, select_weight_calss] = ... find_missing_blockwise_mm(mm, masks, xmin, xmax, ymin, ymax, ... weight, num_avg, avg_area, thj, thj_inclass, th_IoU_split) % T=mm.Format{2}(3); % [Lx,Ly,T] = size(video); [Lx,Ly,N] = size(masks); %% Update i...
05b6c6a7cba7e3e433e7228fb53dc44433b9aaec2214e4aa9732f163cf3b38ff
MATLAB
6,995
209
function aligned_similarity_score_run() [dataPoor, dataRich] = load_feature_data(); sessionStatsPoor = cell(length(dataPoor),1); for iData = 1:length(dataPoor) sessionStatsPoor{iData} = compute_and_plot_corr_stats_per_session(dataPoor(iData)); end maxDays = 0; for iMouse = 1:length(sessionStatsPoor) s = ses...
af7826cd3f4272ee12329c6af0e870080ce88878ecee333ac3ea54682ac7f088
MATLAB
7,000
173
function VOR_DarkRearingGeneralization(params) %% runVOR Analyze VOR behavioral data directly from Spike2 files (.smr) % % modified from SineFitBNwSlip_GenSD_auto 8/2012 by Hannah Payne: % - automatically import files directly from Spike2 (.smr) to Matlab % - improve readability/maintainability % - Display sa...
1895477f55390259fc57435dbd5f1f34b44403c519a5ed29a1a7f388b9ac4728
MATLAB
7,001
171
function [ms] = men_cnmfe_run( cnmfeOptions, alignedScopeFilename ) %% choose data neuron = Sources2D(); nam = neuron.select_data( alignedScopeFilename ); %if nam is [], then select data interactively if cnmfeOptions.with_dendrites % determine the search locations by dilating the current neuro...
3f62919a1e66f158808d46ba77eab86bca9ab8fc084dbc951c44b50038b08361
MATLAB
7,010
228
function [ws warned] = print_once(varargin) % % PRINT_ONCE will print a message for every unique point in the % stacktrace only, e.g. in a for-loop a warning is thrown only once. % % Use as one of the following % print_once(string) % print_once(id, string) % Alternatively, you can use ft_warning using a timeout % ...
51578d459854dc20be1eabbd4fd19bdddbe9b2d48a1824da825a136e23610d81
MATLAB
7,017
231
function out = delta2chi_FANSI_nlL1TV(params) % Nonlinear L1-norm QSM and Total Variation regularization % with spatially variable fidelity and regularization weights. % The L1-norm data fidelity term (PI-QSM) is more robust against phase inconsistencies than % standard L2-norm (FANSI). % This uses ADMM to solve the ...
d836e861f6b7626b6df2f6a0f3f47cc10757227ca2a97c8f65ead20a73ded2c2
MATLAB
7,022
155
function tune = tuningA(Var,uspikes,Fs,elec,unit,latency) % compute Arseny's 1Dtuning. % var is the frames vector of tuning var. % uspike is the frames vector of the unit. here only the binary (Nspikes>0 % or not) is used % Arseny: % I prepared a script (example.m) that calls all the functions needed to gener...
ca98fb075b298ff375a62ad6b3348a4f1de9e7ed95a9b92aef6d6fab705a49b2
MATLAB
7,033
261
function out = delta2chi_nSFCRL1(params) % out = delta2chi_nSFCRL1(params) % delta2chi_nSFCRL1 % Ref: Bao et al, IEEE TMI, 2016 35(9):2040-50 % Chen et al, J Neurosci Res, 2019, 97:467:479 % Milovic, MRM, 2018, 80:814–821 (FANSI) % Milovic, MRM, 2022, 87(1):457-473 (L1-QSM) % FANSI toolbox: https:/...
656120cc884f0fae3f539108ae9f034a64ea21e85271763c6161e2e24e49871a
MATLAB
7,037
126
%% visualize raw data animal = 'despereaux'; %d8_2_t27 %animal = 'roquefort'; %d15_e2_t25 %animal = 'remy'; %d23 e2 t26 %animal = 'bernard'; destdir = '/cumulus/anna/despereaux/filterframework/'; Fs = 1500; fps = 30; day = 8; ep = 2; %tets = [24]; %20 task = loaddatastruct(destdir,animal,'task'); tetinfo = loaddatast...
892b57ae1005955cfb9db94adc5e2d35273f8bd4b86e850d686d6c632a5bf108
MATLAB
7,043
191
%aspikes %plot STA for units, only those whose Mdep has p<0.05 by bootstrap clear all; close all; trackMemory; scrsz = get(0,'ScreenSize'); globals; initglobals; DEBUG=0; PRINT_INFO = 1; LATENCY = 14; PLOT_RAW_SIGNALS=1; % plot raw signals % SessionName = 's:bnehud\data\pom36'; %Thalamus36, Spikes{1,1},{4,1...
9b2f0d14e7d3086b987fc849e92247ddbe9b41b3e1351749f4c0c11fcfb5dc99
MATLAB
7,044
179
%% STEP 1: establish plotting constants N_rows = 4; N_columns = 4; N = N_rows*N_columns; fps = 14; frames_before = 5*fps-1; frames_after = 5*fps; %% STEP 2: allow user to select the filename to save as [filename,pathname] = uiputfile('*.mp4','Save Watershed Region As'); if isequal(filename,0) || isequal(pathname,0) ...
554357c8138960734b9dedf74e7e846d2ec2f79c567d60c79dfff2466456e23b
MATLAB
7,045
192
clear cd ./opto_gocue_withchr2 % C1S2:loop;C1S3:go cue;C1S4:go judge;C1S5:no gocue;C1S6:nogojudge; % C1S7:go Hit;C1S8:go miss;C1S9:no go CR;C1S10:airpuff;OUT1:reward;OUT2:airpuff; % C1S11:light on; % C1S12:light off; control=dir('C*.mat'); inhibit=dir('I*.mat'); active=dir('A*.mat'); for j=1:length(control) ...
136e870c931115a6344d2fbed8425af301977791eaa5a913adf1baebbd03b631
MATLAB
7,053
119
% run amapOFshow clear all; runMode = 'batch'; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=1; PRINT_NAN=0; DATA_TYPE = 'OF'; DATA_TYPE = 'EM'; SAVE_FIGS=0; % whether to save figs as files (in folder dataFigs) PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ; %PL...
c58d67f8103f8116b7c9f1131c40425cc2cce21be9e3fc132bfb5ac697768a8d
MATLAB
7,053
166
clear all; close all; rng(123456789) % load data data = readtable("Grating2AFC_TransProb_behav_history_clean_4fitting.csv"); % specify environments environments = {'Neutral','Repeating','Alternating'}; % add correctResponse integer column data.correctResponse_int(strcmp(data.correctResponse,'Left')) = -1; data.corr...
7c0c61f116946fe2b1b246a5bb45969413b4c39d1e161d72d992411a3166a55d
MATLAB
7,054
195
function [image_new_crop, mask_new_crop, mask_new_full, select_frames_class, ... select_weight_calss, classes, video_sub_sort, mask_update_select, select_frames_sort_full] = ... find_missing_blockwise(video, masks, xmin, xmax, ymin, ymax, ... weight, num_avg, avg_area, thj, thj_inclass, th_IoU_split) % T=mm...
d09922b65912c6523b799a148cefbce0873567486f1e5b19b8dd1d8a7be7a9ad
MATLAB
7,055
266
function [] = Fig04_Example_TimeCourseRaw_frames_nsybD() % Code for plotting example frames in Fig. 4c. GT = 'nsybD'; Target_FileID = 10; Target_Trial = 1; FileID = Target_FileID; Periods = [1170:1173]; % Pre Periods = [Periods;[1189:1192]]; % Pulse 1 Periods = [Periods;[1196:1199]]; % Sine 1 Periods = [Periods;[120...
0f038092561b9c83bbe342eeef8df21109fa6fea6a6ec59a6a131e34b2d0fb31
MATLAB
7,059
195
function checkConfig(DynamicTable, varargin) % CHECKCONFIG Given a DynamicTable object, this functions checks for proper % DynamicTable configuration % % checkConfig(DYNAMICTABLE) runs without error if the DynamicTable is % configured correctly % % checkConfig(DYNAMICTABLE,IGNORELIST) ...
5031654c558cc9466af4287614cc487e732517e7e5b86a0bd2c5f7c05c09e994
MATLAB
7,060
204
function [hdr] = read_ctf_res4(fname) % READ_CTF_RES4 reads the header in RES4 format from a CTF dataset % % Use as % [hdr] = read_ctf_res4(filename) % % See also READ_CTF_MEG4 % "VSM MedTech Ltd. authorizes the release into public domain under the % GPL licence of the Matlab source code files "read_ctf_res4.m" and...
a32cb0abaa72befb1dcc433c5d1d05e1ecf4598acb9962432b4f96de1bb627e3
MATLAB
7,060
166
function [pval_spins, molecular_names, x_weights, Y_pred, correl, molecular_maps_labels_ordered] = NCP_10_CCA_cent_var(name,dx_title,location,type) warning('off','all') cd([location,'\PCA_CCA\',dx_title,'\']) X_rotated = csvread([location,'\PCA_CCA\perm_sphere_10000_DK.csv'])'; X_rot = X_rot...
5b592818fe8b90ebeaa7705f7fb5833c621e45f30598f88638f3986e89899ffc
MATLAB
7,066
228
%run_subsample_and_ROC_stdFR_stdRP.m % assumes run_simulations_stdFR_stdRP.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; '../../analyze'; '../../helper_functions'; }; datadir = pwd; %% addpath(scriptdirs{...
7a7a01dde45561e1c27fa755b274b5860bdbd53f3f74b8fcb4ce8f179f79f47c
MATLAB
7,078
136
function [newTracks] = resolve_problems(folder_name, parameters) % displays a GUI to help user decide how to resolve centerline problems, not used in paper min_track_length = parameters.MinTrackLength; % plotting_index = 1; Tracks = load_single_folder(folder_name); if isempty(Tracks) retur...
c9fea7e6e88e1c5544b5abe243d4cad233bf6ad72d847b078b2401d008fc11a1
MATLAB
7,085
181
function [dap] = read_mpi_dap(filename) % READ_MPI_DAP read the analog channels from a DAP file % and returns the values in microvolt (uV) % % Use as % [dap] = read_mpi_dap(filename) % Copyright (C) 2005-2007, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for th...
d741968c1a0ae048c823dac769482cef5bbc24d4338f885fe8aec0511e468869
MATLAB
7,086
267
%% Code simulating a Perceptron-like shallow network learning to perform % a transitive inference task. Figures resulting from this simulation and % the related analysis provided the material to compose Fig. 3 of % (Di Antonio et al., bioRxiv 2023, DOI: 10.1101/2023.08.03.551859). % % Copyright Maurizio...
5351fbb8e94654d64422f219614fc4333b9e62caeb387425780e559f23186a8e
MATLAB
7,092
171
function design_mat = fact_des_full_fact(stud_dir, subj_file, MS_file, img_paths, var_names, cov_names, stat_suff) % _ % Create batch for factorial design full factorial analysis % % stud_dir - study directory in data/analyses are located % subj_file - an XLS file containing subject IDs and covariates % ...
50ac17df31260aa5b96927d8230a868ce840df946f455ab7c20caa8611c00cf8
MATLAB
7,094
188
function D = IBWread(FN); % IBWread - read Igor wave from IBW file % D = IBWread('Foo.ibw') reads Igor file Foo.ibw into struct D. if exist('fullfilename', 'file'), FFN = fullfilename(FN, cd, '.ibw'); else, FFN = FN; end % read headers [D.binHeader, D.waveHeader, FFN] = readIBWheaders(FN); fid = fopen(FFN,'r'); fid...
9342e1ad18d510af3ed3fb12862e5a255312129436b1ee279d0d09aaef0dc91d
MATLAB
7,104
228
%run_subsample_and_ROC_stdFR_stdRP.m % assumes run_simulations_stdFR_stdRP.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; '../../analyze'; '../../helper_functions'; }; datadir = pwd; %% addpath(scriptdirs{...
dc3546dd5abb38fa885db1904a60ab8d8235e2ff0014865ce6620c8d480f8f57
MATLAB
7,106
226
%run_subsample_and_ROC_stdFR_RPk0nr3.m % assumes run_simulations_stdFR_RPk0nr3.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; '../../analyze'; '../../helper_functions'; }; datadir = pwd; %% addpath(scriptd...
c333a9875007ccc84992c942ccbcbfddf7bbdca2b8ba0b7cd79c52a9beb58f7a
MATLAB
7,110
170
% computeKernels_pData.m % % Function that takes in user-specified pData file, which has been run % through filtering of FicTrac and spike calling for ephys data, and % returns kernels relating spike rate and median-filtered voltage to % FicTrac parameters. % % Note: written 9/16/20 as probably temporary function ju...
b9711155cdf02ab39c3fe49ea46a17d7eef8091170856589a9ade98bb081d5d2
MATLAB
7,112
186
function [event] = read_yokogawa_event(filename, varargin) % READ_YOKOGAWA_EVENT reads event information from continuous, % epoched or averaged MEG data that has been generated by the Yokogawa % MEG system and software and allows those events to be used in % combination with FieldTrip. % % Use as % [event] = read_yo...
9b77b44cb53215ac9a245283109c09f12606d07b7ffedfa004b5390b2e987f5d
MATLAB
7,113
226
%run_subsample_and_ROC_stdFR_RPk0.4nr4.m % assumes run_simulations_stdFR_RPk0.4nr4.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; '../../analyze'; '../../helper_functions'; }; datadir = pwd; %% addpath(scr...
386f00a69407563946edf925535f175b49d1e31c911866aa0e3475f7099d4f32
MATLAB
7,116
225
%run_subsample_and_ROC_stdFR_RPk0.7nr18.m % assumes run_simulations_stdFR_RPk0.7nr18.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; '../../analyze'; '../../helper_functions'; }; datadir = pwd; %% addpath(s...
777cadb8caedbe13799f190f047876f34368a53f3a50dc301b566d689ac04820
MATLAB
7,116
192
function [rawDataParametric, parametrizationParams] = parameterizeDataForGLM(rawData) % Convert covariate data to a parametric format for GLM fitting % % rawData : rawData obtained by running rawDataForGLM % % rawDataParametric : data in parametric form ready for GLM fit % parametrizationParams : parameters use...
cf12e1b366fc2f6b1906a6bc902b532896d2c481cc0c73915ccbeccce0dbd03b
MATLAB
7,120
258
close all clear all clc % mouseImage = imresize(imread('light-grey-mouse-md.png'), [10,10]); % figure % imshow(mouseImage) % % figure % heatmap(mouseImage) % % mouseImage(mouseImage > 220) = nan; %% minDistance = 10; %a = 100; %poly = [0 0; a, 0; a, a; 0, a]; a = [0, 20]; b = [0, 0]; c = [30, 0]; d = [30, 20]; ref...
80789d5157de9963f0c68f5e68b95c212b39dd8b115ad57e3facd00aaf889ba5
MATLAB
7,122
203
function [index_vals,velocity,meanvel,stdvel,badvals] = LSPIV_Parallel_Multi_Box( LineScanTable,numCores,pixel_Size,windowSize,Vessel_Type) % LSPIV with parallel processing enabled. % % For additional information, please see corresponding manuscript: % % 'Line-Scanning Particle Image Velocimetry: an Optical Approa...
5f47da3fa5432635b023208078a0eb9967fed4b391f5d6f00905f08f4577c05c
MATLAB
7,129
207
% findYawVelPeaksFT.m % % Helper function for saveSpikerate_bouts() that takes in % fictracSmo, and moveNotMove and returns times for valid yaw % velocity peaks as well as start/end times for corresponding bouts. % Boolean for whether to extract right or left turns % % Adapted from findCondYawVelPeaks(), which opera...
faa659ddd5366e2964a3a0ae3d96faee25ce069a9b215059fcf20cecb067d932
MATLAB
7,130
210
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [F] = compute_popvectors_across_contexts_unregistered_figure_4B(analysisSettings, BestAligned, BESTALIGNED_STABILITY_THRESHOLD_CRITERIA, OUTPUT_FOLDER) % Add the group labels (day names) to the data SessionsToGroups ...
6b5f29d2a085d3b1ac27d75695b0e159e47d20b2776fc499b538abac74a7e6e2
MATLAB
7,131
206
function runPLS_fmri(ANALYSIS) % runPLS_fmri % % ANALYSIS = 'ELO' or 'A3D' % addpath /Users/mlombardo/Dropbox/matlab/spm12; addpath /Users/mlombardo/Dropbox/matlab/Pls/plsgui; addpath /Users/mlombardo/Dropbox/matlab/Pls/plscmd; rootpath = '/Users/mlombardo/Dropbox/Manuscripts/AUTISMS_3D_MSEL_VABS_Toddlers/Autisms3D_f...
9e0f79490414bcac678609a9f29c6b1a204efb978dce4b393efbd11cc4414261
MATLAB
7,135
177
% figureS5(data_dir, read_from_excel) % % INPUTS: % data_dir (str): Path to source data (default: 'source_data'). % % read_from_excel (bool): Flag to read from Excel (true) % or .mat files (false) (default: false). % % Mackay et al. 2024 (DOI:10.1038/s41467-024-52295-5) % License:...
b3feb43ed368eb60dcc818294d2fc8fbe8e59bde2ef184cff953bf7ea786146a
MATLAB
7,144
154
function [myscreen] = initEyelinkEyeTracker(myscreen, conntype) % initEyeLinkEyeTracker - initializes a the myscreen and tracker for use % % % initEyeLinkEyeTracker.m % % $Id: initEyeLinkEyeTracker.m 203 2007-03-19 15:41:00Z justin $ % usage: myscreen = initEyeLinkEyeTracker(myscreen, [tracker]) % b...
be3c9e826336e817e2bbb210585945914c40dfc65bf94d34e03017d4a53d3e1a
MATLAB
7,147
200
% clear; % close all; % clc; initime = clock; addpath('../funcs'); %% changeable parameter settings % for parfor Delta_e = 0.2; Delta_i = 0.02; % none % changable Iattn = 0.02; time = 4000; disp("Computing -- Delta_e:"+num2str(Delta_e)+", Delta_i:"+num2str(Delta_i)+", Iattn:"+num2str(Iattn)); [r,v,g] = once(Delta_e...
43d77111230ce5860ea42e9c1ad22114694da7dbda0e4277df88d3206f2d1864
MATLAB
7,152
192
% taskTemplateStaircase.m % % $Id: taskTemplateStaircase.m 231 2007-04-20 22:50:46Z justin $ % usage: taskTemplateStaircase % by: justin gardner % date: 01/27/07 % copyright: (c) 2007 Justin Gardner (GPL see mgl/COPYING) % purpose: oriented grating stimulus % function myscreen = taskTempla...
9144fbe43d023656b5051e23703989ada36df1d09abf0773d8cfdd21efe296a9
MATLAB
7,158
202
%-------------------------------------------------------------------------- % make_video.m % Creates a video from the voltage readings of a simulation % Displays voltage of columns in layer 2 on 3D ico surface % and real time evolution of layer average voltage %---------------------------------------------------------...
41ccad7b541c7c9bcc5871aef5b597e35e23c2e27418fc38411476769b15f020
MATLAB
7,159
181
function [nodes,nv] = growMajorVessels(nv,np,vp) % [nodes,nv] = growMajorVessels(nv,np,vp) % % Function to sample vasculature locations and setup nodes and connections of % vasculature (including connections to penetrating vessels) % % - nv - struct for number of vessel parameters % .size - size of ...
696a6fca51ac0301b018900fdb0a434479c00921d3f9168d57c4b7f97fa37c5f
MATLAB
7,160
202
function [dat] = ft_fetch_data(data, varargin) % FT_FETCH_DATA mimics the behaviour of FT_READ_DATA, but for a FieldTrip % raw data structure instead of a file on disk. % % Use as % [dat] = ft_fetch_data(data, ...) % % See also FT_READ_DATA, FT_FETCH_HEADER, FT_FETCH_EVENT % Copyright (C) 2009-2013, Jan-Mathijs Sch...
a7586edc7cd419e727594e0c9a392214cd4466fefb101cea62e65e96cb7bda77
MATLAB
7,171
200
function [assignment,cost] = munkres(costMat) % MUNKRES Munkres (Hungarian) Algorithm for Linear Assignment Problem. % % [ASSIGN,COST] = munkres(COSTMAT) returns the optimal column indices, % ASSIGN assigned to each row and the minimum COST based on the assignment % problem represented by the COSTMAT, where the...
f07161feb4e22e517da9df1074cf8d3d55de072e96ab9b62da72421d35a5d915
MATLAB
7,182
233
% for paper "Inferring stochastic dynamics of complex systems", T.-T. Gao, % B. Barzel, and G. Yan % Equation from paper "Inferring the dynamics of underdamped stochastic % systems" by D. B. Bruckner, et al. clc, clf, clear, close all tic Nnodes = 20; dim = 3; A = ones(Nnodes,Nnodes); for i = 1:Nnodes A(i,i) = ...
c64f463eebe988612254780b298ec5df73f3e824108608ed575266e2e0b9d23f
MATLAB
7,191
275
%% Code simulating a Perceptron-like shallow network learning to perform % a transitive inference task. Figures resulting from this simulation and % the related analysis provided the material to compose Fig. 3 of % (Di Antonio et al., bioRxiv 2023, DOI: 10.1101/2023.08.03.551859). % % Copyright Maurizio...
a3cf6fe5e2496ab85290ec3e629f8c2b615d2c46ebc838510947bee4df5bad95
MATLAB
7,192
275
%% Code simulating a Perceptron-like shallow network learning to perform % a transitive inference task. Figures resulting from this simulation and % the related analysis provided the material to compose Fig. 3 of % (Di Antonio et al., bioRxiv 2023, DOI: 10.1101/2023.08.03.551859). % % Copyright Maurizio...
b817b4f2da1d8a0974fff65b2ad6393450be390d5852982a42ae774e42c42dca
MATLAB
7,192
275
%% Code simulating a Perceptron-like shallow network learning to perform % a transitive inference task. Figures resulting from this simulation and % the related analysis provided the material to compose Fig. 3 of % (Di Antonio et al., bioRxiv 2023, DOI: 10.1101/2023.08.03.551859). % % Copyright Maurizio...
ce11be6b85bcf1e437f5bcbd133231c0e0debb47134f157807b5c45b2b218dfe
MATLAB
7,196
214
function ResTable = aedes_res2table(Res,varargin) % AEDES_RES2TABLE - % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Phys...
d8bf22d5965d435e701c56a4cb3a230c1dd8b66ba57b626ca32d2b2c6251d61a
MATLAB
7,204
228
function myscreen = taskTemplateDualMain % function myscreen = taskTemplateDualMain % % 2007May04 SO % Sample code to show how to run dual tasks % The main task is just two stimuli shown with a variable % delay in between. The subject will discriminate orientation. % The subsidiary task is an RSVP task at fixation % ...
41127dd26ad69c65224a700121ca4337b44612b59c2fa2e6708b85a024401ae6
MATLAB
7,205
135
ListAnimals = 'IMPORTED_EXPERIMENTAL_LIST.XLS'; proc_dir = 'PATH_TO_PROCESSED_DATA_FOLDER'; %%%%This is the directory where your pre-processed data is saved number_probes = 1; for anim = 1:size(ListAnimals,1) exps=[];no_exps=[]; exps = eval(ListAnimals{anim,5}); procExpNam...
e84a226a8c99a99100390accc57bbb1cb58fea8048e005a79a7305e269466986
MATLAB
7,205
177
function grad = yokogawa2grad(hdr) % YOKOGAWA2GRAD converts the position and weights of all coils that % compromise a gradiometer system into a structure that can be used % by FieldTrip. This implementation uses the old "yokogawa" toolbox. % % See also CTF2GRAD, BTI2GRAD, FIF2GRAD, MNE2GRAD, ITAB2GRAD, % FT_READ_SENS,...
01bdc37e4285ec438cc4461b59b3fa38a194a78895df951045e16a5ed8696a10
MATLAB
7,206
234
%run_subsample_and_ROC_stdFR_stdFRP_splines.m % assumes run_simulations_stdFR_stdRP_splines.m % has been run first % see statsF and related structs generated % towards the end of the script for information % about pAUC statistical test results %% clear all; close all; clc; %% add fn paths if not added yet % assumes s...
9b2d3a28aa5c62645a5eb2343abd355636630fcb8169528ed121f21172950a8c
MATLAB
7,208
182
function [m, filename, imaxf, imeanf, pixh, pixw, nf, imx1, imn1] = data_h5(path_name, file_base, file_fmt, folder, Fsi, Fsi_new, ratio, ttype) % Concatinate data pieces from raw 4GB-tif chunks, % new tiff files, % or avi files from UCLA miniscope % parallel or serial version supported % Jinghao Lu 01/16/2016 ...
17cd8efb8991d3e4bb3ec95da3ca2c03d606a71b7b59262ff4b37d6a241005ae
MATLAB
7,210
140
function [r,v,g] = onlyAttn(Delta_e, Delta_i, Iattn, allTime) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potential and synaptic % ...
a70568254dcb3d6794757b7e68eb787b05cac39084a16746e9d538c3b27159a9
MATLAB
7,219
201
% visstimVInj.m % % Trial Type Function % Plays visual stimulus in closed loop, with voltage signal coming from DAQ % itself. Records visual controller output % For testing closed loop % % INPUTS: % settings - struct of ephys setup settings, from ephysSettings() % duration - duration of trial, in seconds % % OUTP...
7d08a0adb70cf3a803351326b0829db097d91b759f2683d78678851b2fc9bb9d
MATLAB
7,222
246
% cshl2022Figures.m % % Quick and dirty script for making ephys figures for DNg13 and DNa02 for % 2022 CSHL Neuronal Circuits poster % %% DNg13 pDataFullPath = '/Users/hyang/Dropbox (HMS)/EphysAnalysis-Helen/pData_2021cshl/200821_fly01_cell01_trial01.mat'; ttl = 'DNg13'; %% DNa02 pDataFullPath = '/Users/hyang/Drop...
c8dee91896914f25695cb9aa8dfe13dfdf0887b47f2a4d3ebe355a5449731c77
MATLAB
7,237
133
function cal_params = fit_NAOMi_calcium(spike_time, t_frame, fmean_norm, t_ephys, varargin) % function out_val = fit_NAOMi_calcium(spike_time, t_frame, fmean_norm, t_ephys, params, {OptType}) % % Function to set up the comparison used for learning the parameters for % the calcium imaging time-trace generation. Specif...
9d02e2f4ec4c3bda2ebf886cafb7117fa470c5a232279b3b017c9c9508268bfa
MATLAB
7,239
142
function [r,v,g] = onlyA_blockL6E_L4E(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potenti...
a266932de0819ade3fa69bc144b197b4c536d703e6f96338b202ab1b99902bf9
MATLAB
7,239
142
function [r,v,g] = onlyA_blockL6E_L4I(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potenti...
809061c6a9f9a3494e266163a000f9b6babb2c2f90afe55e5e10928f56dbbcb4
MATLAB
7,248
190
% findBoutStepIndsBall.m % % Helper function for saveBallLegStepParamCond_bouts() that takes in bout % peak, start, and end times (output of findCondYawVelPeaksFT() helper % function) as well as step index info, and returns aligned steps, as % indices into legStep matrices. % Also, returns whether bout peak is du...
efbb9ca5efeec521ddb88f5ed560ede4048d3847573a4b64627680a8ea4a9817
MATLAB
7,258
177
function simulation_simulate_signals_based_on_axDKI(path_of_script, simulation_voxels_axDKI_table, simulation_parameters) contaminate_signal = simulation_parameters.contaminate_signal; bvalues = simulation_parameters.simulation_bvals/1000; diffusion_gradients ...
9fe632cca353a6d2dc632164eac1fa685e3b06dcdc112bf91f98e00ec1723444
MATLAB
7,265
205
% mglCameraCalibTiming % % $Id$ % usage: taskTemplate % by: justin gardner % date: 10/16/2019 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: program to calibrate the timing of camera frames. Basically the story is that % the Spinnaker library gives a time...
dcdbb5bfbb89b057760dc27354731dc5c68fc44478b6a3d33616f2885a09d142
MATLAB
7,265
245
function [params] = textureAnalysis(im0, Nsc, Nor, Na) % Analyze texture for application of Portilla-Simoncelli model/algorithm. % % [params] = textureAnalysis(im0, Nsc, Nor, Na); % im0: original image % Nsc: number of scales % Nor: number of orientations % Na: spatial neighborhood considered (Na x Na) % % Exa...
92230dc7fb57e1e0585eed04111735789fefe9886c5b81104d161fa92980e61f
MATLAB
7,269
204
% May 5, 2020 % Isabel gave me a dataset with 23 experiments with 5 sessions each. Some % of the sessions had a second trial that was junk (only a few points) so % the following code fixes these records, and it also forces the bits to be % 32. close all clear all clc tstart = tic; % Don't change these projectCfgFile...
71a2dd2a5cd68c533bfeb451be568be0989893910b81435a54d4884af8855bcc
MATLAB
7,271
239
% getLastStimfile.m % % $Id:$ % usage: stimfile = getLastStimfile(myscreen,<verbose=1>,<stimfileNum=-1>,<onlyToday=false>) % by: justin gardner % date: 06/08/11 % purpose: retrieves the latest stimfile from the data directory. This is useful % for when you want to create a stim...
501a6cf2cc125ad99cfa729c517e690acadf5f0a58fb829424d94c082edb2e4a
MATLAB
7,275
142
function [r,v,g] = SandA_blockL6E_L4I(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potenti...
9a7c3223d8ebef278838a8600d49864b318f7a5f3fb5701be23e446f22d225c4
MATLAB
7,275
142
function [r,v,g] = SandA_blockL6E_L4E(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potenti...
84bea622765ef5f43127bf2f5995bfe90ebf98630efa9c4796b1fdaf538d404c
MATLAB
7,276
208
classdef OnePhotonSeries < types.core.ImageSeries & types.untyped.GroupClass % ONEPHOTONSERIES Image stack recorded over time from 1-photon microscope. % OPTIONAL PROPERTIES properties binning; % (uint8) Amount of pixels combined into 'bins'; could be 1, 2, 4, 8, etc. exposure_time; % (single) Exposure time...
d382e5c5b255a92d43d8c194c2164b0b2dd5dd0551ed47400579c523ea5e11b0
MATLAB
7,276
145
function [r,v,g] = onlyA_reduce_L6(Delta_e, Delta_i, Iattn, allTime) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potential and syna...
84cba518beb05e2f6791360864ed746f4b0cb9d4a7451659aa568039d577827b
MATLAB
7,277
180
% This script accurately computes and displays electric fields sampled on % a cross-section (transverse plane) via the FMM method with accurate neighbor integration % % Copyright SNM/WAW 2017-2020 %% Load/prepare data planeABCD = [0 0 1 Z]; % Equation of the plane of the cross-section (Ax + By + Cz...
f957f09d1a0c06b4f588299e3c85a4c210462b386f33b2723713ad751f17c3e3
MATLAB
7,289
154
function [ds, fLMM, fLMM_Model, lmmResults, lmmResults_Model] = ... getDataTableAndLMMResults(projectDir, lmmModelFlag, saveFolderNameDS,subjnrs) % Function to create and run main linear mixed model (LMM) on data and % model mean stimulus block amplitudes. For comparing LMMs to more % conservative models, see s_com...
d801c9e9909d09d0d485082825ffd4cbbd11ae9e53b11176484886869f19ad22
MATLAB
7,294
162
function sse = eval_function_multiple_runs(data,fitting_target,value_init,x) nSims = 16; mouseNames = unique(data.mouseName); simulated_responses = cell(length(mouseNames),nSims); for iSim = 1:nSims % loop over mice for iMouse = 1:length(mouseNames) % subselect data of current mouse ...
a5db4fb056c9c8c7d98e0ff8de25b77d9796a63ade95f08043030cdfb9fcf922
MATLAB
7,301
219
function [variance,mov_distance,mov_duration,max_speed]=striking_subfigure(Session,Area,Ndir,Nbins,t_from,t_upto,edges_dur_bin,do_plot) %% embedding_dimensions performs PCA on the neural data from Session and %% Area binning the movements into Ndir directions and Nbins durations % This function also saves the PCA resul...
de8b8b1226943e65de7eb5ace00a2524e530297c4d83072939cb2a594d1e369f
MATLAB
7,337
146
function [r,v,g] = SandA_reduce_L6(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potential ...
855c9e406f68908f36d5333672706a85cff079afd1f69c11bfa2fd24c9d42e92
MATLAB
7,338
168
function [f, params] = get3DSpatiotemporalpRFs(params) % Description: Function that creates spatiotemporal pRF models % to use as linear filters. % % INPUT: % params : (struct) Params struct should have the following fields: % params.saveDataFlag % params.recomputePredictionsFla...
fcacdbc282d53822f73ae288e38de8b6d43b6f24766a275584ddd34c3fe98be7
MATLAB
7,344
275
% Function File: [N, P, D] = fpeaks (t, y, p, s, L, V) % % Searches the y vector for minima or maxima by searching for % zero crossings in the smoothed first derivative. The local % preceding baseline for each peak is determined and used to % calculate peak amplitides. % % The input parameter 'p...
5a18b81ba42b544bf53c58f197e9c4d52e9718fc717c441a7797dde4c02f04c1
MATLAB
7,357
203
function rezToPhy(rez, savePath) % pull out results from kilosort's rez to either return to workspace or to % save in the appropriate format for the phy GUI to run on. If you provide % a savePath it should be a folder, and you will need to have npy-matlab % available (https://github.com/kwikteam/npy-matlab) % spikeT...
3a343c6cbb29589d56520a4cbf52b65a6cfe8ec8bb91ee70a301cb859c3d891d
MATLAB
7,358
207
%% CREATE_DATAFRAME_FOG % Converts the trial data of all FOG events into a table which can % be read in by R. It contains the fNIRS data averaged over 4 time windows % (baseline, pre, post, and post2) for each channel, trial and participant with % extra info about each trial. % (baseline = [-10 -5]; pre = [-3 0]; post...
89dcc2dbfcf421c056b93129815168ad747453513a71658787da42a8e9f98bc3
MATLAB
7,361
196
function D = IBWread(FN,pos); % IBWread - read Igor wave from IBW file % D = IBWread('Foo.ibw') reads Igor file Foo.ibw into struct D. if nargin == 1 pos=0; end if exist('fullfilename', 'file') FFN = fullfilename(FN, cd, '.ibw'); else FFN = FN; end % read headers [D.binHeader, D.waveHead...
bf223f4c91702e31e73f0d37666738e30d8b2f69b1a55ebe85a0ef78f4681c80
MATLAB
7,361
171
function out = dfa_RWsimulation(index, excludeperiods, rippleskons, trials, varargin) % For each ep: % 1. Concatenate all time spent at the wait well; create pool of rips and triggers % 2. For each rip trial, identify the trigger size and duration % 3. Identify a matching sized rip in the wait pool and pull a chunk...
c463a1fd9e213c695c76f097b2898e4057e85519cd92d639dfebc193c524b2e6
MATLAB
7,361
332
function [done,msg] = aedes_saveres(DATA,ROI,filename,varargin) % AEDES_SAVERES - Save Aedes results (statistics and ROIs) % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen ...
cd6d7b44855948c60a337c1494717f2cf936f7b88ae9bfad153536d2c39c22cf
MATLAB
7,367
180
<<<<<<< HEAD function [result_f, enrolltime, errMessage] = goEnroll(general) % reset some indexes errMessage = ''; enrolltime = 0; enrolltime_n = 0; result_f = []; bolSkip = false; files = getFileList(general.PATH_IMAGE); % if no files, exit if (length(files) == 0) errMessage = 'No valid images found! Check conf...
d60bee3084dbdce9586cc417e9bd883af2a66bd7b76706b253bd1d8d403e064f
MATLAB
7,378
140
function [r,v,g] = onceLateral(Delta_e, Delta_i, Iattn, allTime, lateral) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potential...
97a24d501204604a0c0817c81e9ae5285e094259410e70adbfa177ef89ad8569
MATLAB
7,380
238
%% Load Data Porder = 3; namestr = 'modes13'; addpath([cd,'/helper_scripts/']) EG = ExperimentGroup(namestr,-5:-1,[cd,'/data/']); %% Analyze Each Experiment for Modes Time = cumsum(EG.loadBest().LearnTimes)/10^6; maxnum = length(EG.VIT); Evals = nan(Porder+1,length(Time),maxnum); Tvals = nan(1,leng...
dec7fafc5e2d9da2a437c21f5d9f5097bf3b705f2e8bb56131a34b2c3b59393f
MATLAB
7,386
200
% Main script for Segmentation Analysis of HRTEM images % Run this script to run the automated nanoparticle transmission electron % micrograph analyzer (ANTEMA) % Copyright (C) 2022 University of Duisburg-Essen, % Nina Gumbiowski % % This program is free software: you can redistri...
776f805dcc88cec72e3b2332bcf8430e729e761ac015df3ef200f80e2286506c
MATLAB
7,390
146
%% Neurofeedback: variance in tracked position while at center ports % control and manipulation cohorts animals = {'jaq','roquefort','despereaux','montague','remy','gus','bernard','fievel'}; epochfilter{1} = ['isequal($cond_phase,''plateau'') & isequal($environment,''goal'') ']; %cond rats epochfilter{2} = ['$ripth...
0174d978af20e3e1358c013a56e594368b9e8edcf210c790de605d9b6f8cb81a
MATLAB
7,394
221
function [po,pin] = spm_prep2sn(p) % Convert the output from spm_preproc into an sn.mat % FORMAT [po,pin] = spm_prep2sn(p) % p - the results of spm_preproc % po - the output in a form that can be used by % spm_write_sn. % pin - the inverse transform in a form that can be % used by spm_write_sn. %________...
58d246c56065495832e21f4ae3cd4df8d71719b2c65604d7891d55b2eb324c4e
MATLAB
7,402
142
function [r,v,g] = once(Delta_e, Delta_i, Iattn, allTime, stimIn) %ONCE run the simulation once including five conditions % INPUT arguments includes parameters of the column model % OUTPUT arguments are the results of computation, including the time % courses of firing rate, average membrane potential and syn...
cb5c159984d4aa22b19c099c9d17d67536b267db5a6d47e33c97a43519b3e673
MATLAB
7,404
124
% run amapOFshow clear all; runMode = 'batch'; globals; initglobals; PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; DATA_TYPE = 'OF'; %DATA_TYPE = 'EM'; PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ; %PLOT_TYPE = {'map'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'t...
4c95080eeaff9f9b8cc67e9be62527b808d3651fdc423c9e618633a5c7e81134
MATLAB
7,408
256
function gui_advc (action) % % This file is needed by FASTICAG % This file holds the callbacks for advanced options -dialog % @(#)$Id: gui_advc.m 8776 2013-11-14 09:04:48Z roboos $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf_Fa...
a36c027f108d37b0ae9d8200cb1abcfe5a44cec0b331baa41e918036121691e6
MATLAB
7,413
177
% presents place fields over trajectories %modified from amapOF. Oct 2016, ehud. % clear all; %close all; globals; initglobals; Tstart = tic; scrsz = get(0,'ScreenSize'); PRINT_ERRORS = 0; PRINT_INFO=0; PRINT_NAN=0; GDEVELOP=0; % development mode - plot interim plots etc (eg in getSpikes.m) GDEBUG = 0; DEBUG ...
aac907b08d5680e02a507c88a9f212ad514a38a53b5e6be3aa8c591408fdcce0
MATLAB
7,418
174
%function update_unitsTable(Sesname, elec,unit,field, val) clear all; close all; globals; initglobals; DATA_TYPE = 'OF'; %DATA_TYPE = 'EM'; FigType = 'final'; FigType = 'data'; SHOW_TUNINGS = 'all'; % 'sig', 'all' INCLUDE_UNITS = 'W'; %'W', 'W+nW', 'nW' an_baseFig = 100; load('unitsTableOF'); % unitsT...
6f71fcb38f586e546805a1ecfbb3d14970d924094d5b9257b7160db992b622a8
MATLAB
7,422
175
function plotCoherence_band ( obj, varargin ) % Plot coherence for LFP online streaming mode % % Syntax: % PLOTCOHERENCE_BAND( obj, data_type, varargin ); % % Input parameters: % * obj - object containg data % * data_type - type of input data (raw, ecg cleaned or filtered) % * ax (optional) - axis where you ...
b46330b03b675dec000f44fb20d4e9ee3c72212982c94ded9f0fa2369b57a28e
MATLAB
7,422
251
% mglTestRenderPipeline.m % % usage: mglTestRenderPipeline() % by: justin gardner % date: 06/08/2022 % purpose: Function to test mgl rendering pipeline with progressively % more in the pipeline to see when there is a failure. % usage: mglTestRenderPipeline % % args: screenNu...