sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5698a32b7dfcc8903bba42e86ec5b49d552eecdd13d9dc9308a09eca64da7ef4
MATLAB
9,528
448
function [dat] = read_neuralynx_sdma(dataset, begsample, endsample, chanindx); % READ_NEURALYNX_SDMA read specified channels and samples from a Neuralynx splitted DMA dataset % % Use as % [hdr] = read_neuralynx_sdma(dataset) % [dat] = read_neuralynx_sdma(dataset, begsample, endsample, chanindx) % % The splitted ...
cf809955db33c337a6e385c688e7af2e7a042b57a1db84e36982d4df5225be91
MATLAB
9,531
343
%figS4_eval_synthetic_highFR.m % %% clear all; close all; clc; %% addpath if not added yet % assumes script run within local directory scriptdirs = {pwd; '..\..\plot'; '..\..\helper_functions'; '..\..\analyze'; }; addpath(scriptdirs{:}) datadir = pwd; nSS = 1000; ssfile = 'subsample1000_highFR_stdRP.mat'; sspath = f...
37e6dd8095d0709d905d7923c9242a68219bcfe86b284dd4a8ed267155a849a6
MATLAB
9,533
260
function convertUG_BIDS_2021_pmod_debug(subj) maindir = pwd; usedir = '/data/projects/istart-data/'; %try % 11-18-21 | This is the code I am using for the bids converter. % Plan now is to use the BIDs converter for only the simple regressors. Ie: % Export the endowments (cue onsets) and the decision phases % (accep...
1c1aeb86f6ac73e9e70d7e013b21bb3ec55aac237ffa1dce7c8de04d92049f52
MATLAB
9,538
261
function convertUG_BIDS_2021_pmod(subj) maindir = pwd; usedir = '/data/projects/istart-data/'; %try % 11-18-21 | This is the code I am using for the bids converter. % Plan now is to use the BIDs converter for only the simple regressors. Ie: % Export the endowments (cue onsets) and the decision phases % (accept/reje...
84a055d2e0f8eec602b23eb7d6707a5cb3aa5c55ba4390cc14c6f6a674742809
MATLAB
9,538
374
% This configuration here (gen_net_opts_model_type2.m) applies random sampling for epoch construction and image crop generation. % This setting doesn't require the classification information, like the class statistics for each image. % In contrast, the configuration in file gen_net_opts_model_type1.m uses class val...
ac76c935ac423320f9680184b90e9613e29c9a17ff5a0e87ba5e4bfe04cf7e85
MATLAB
9,540
262
function output = analyze_network(G, option) %analyze_network takes in a network and outputs standard graph analyses % Usage: output = analyze_network(G,option) % options: 'local','global','both' if ~exist('option','var') option = 'both'; end [n, m] = size(G); if n ~= m error('Input matrix mu...
2d6646488c34a0a158c1d1b62a0b7358b30ef6f3edf2359024a7ebf7a29be18b
MATLAB
9,546
215
function write_plexon_nex(filename, nex) % WRITE_PLEXON_NEX writes a Plexon *.nex file, which is a file % containing action-potential (spike) timestamps and waveforms (spike % channels), event timestamps (event channels), and continuous variable % data (continuous A/D channels). % % Use as % write_plexon_nex(filenam...
4f934c74733e9d21a8e911704934f099b76e59d39a43e92a57771790cd22a72d
MATLAB
9,546
206
showfigs = 0; %% Define all three planes (m) X = 1e-6; % YZ Cross-section position, m Y = 1e-6; % XZ Cross-section position, m Z = 200e-6; % XY Cross-section position, m delta = 3e-3; % half plane window,...
5ac2f99d51249361030855ad4c749ba04297094afa5de80fbfdaa8343cdad875
MATLAB
9,558
331
function [omitH, omitCenters, eye_pos_filt, eye_vel_pfilt] = desaccadeVel3(eye_pos_raw, samplerate, presaccade, postsaccade, freq, params, fit1) % REMOVE TRANSIENTS transient_threshold = params.transientThreshold; eye_pos_raw = removeTransients(eye_pos_raw, transient_threshold); % LOW PASS ON POSITION N = 4; fc = para...
d2eb2000a7152287338171f1e800cc15854d18fcc76933ac26624afbe2e60ae2
MATLAB
9,560
256
% runEphysExpt.m % % Top level function for running electrophysiology experiments on the % updated 2P deux two-photon scope. % Sets up folder structure for organizing data (date/fly/cell), % prompts whether this is new cell or additional trial(s) for cell. For % new cell, prompts for experimental condition, asks ...
cbc7ea85e4738a13c0d03bb57795994caf6494ee4d51913845df907ed5d33201
MATLAB
9,561
258
function getSpikesStepComboPhase_cell(cond, tDelay, numPhaseBins, ... postStimExclDur, pDataPath, pDataFNames, saveFileName, saveFileDir) % preallocate matrices for binning spikes and phase numDelays = length(tDelay); spikeCounts = zeros(numDelays, numPhaseBins); phaseCounts = zeros(numDelays, numP...
e9a86364a23a0170178df07433d4161eb98e83000c17f7de3027458b993b0616
MATLAB
9,582
258
function [SMVdata, background] = iRSHARPv1(phaseMap, wrap_raw, mask, Params, handles) % ========================================================================================= % function [SMVdata, background] = iRSHARPv1(phaseMap, wrap_raw, mask, Params, handles) % % Inputs: % phaseMap - unwrapped pha...
337f6cc6777fbecf0cd8f3c4a6d970032cd0c336dccaf44347b42e82a9b20408
MATLAB
9,588
292
function [animal_facing_angle_deg] = ml_clean_headdirection_data(animal_facing_angle_deg, animal_pos_t_mus, showFigures) animal_pos_t_s = animal_pos_t_mus ./ 10^6; animal_pos_t_s = animal_pos_t_s - animal_pos_t_s(1); if showFigures figure plot(animal_pos_t_s, animal_facing_angle_deg, 'k.-')...
a68c281ae10938a30dffc22e00cdee1d9360199bc66ad7d26a19d3ddb49520b4
MATLAB
9,591
225
%{ Provides comparison of various filtering on learned component traces. INSTRUCTIONS: 1. Set "Current Folder" to the one containing the excel file. 2. Ensure data is in the first sheet, with "time" as the last column. 3. Modify the five variables below as needed. 4. Run script. Generates figures displaying raw a...
911a54b1b6cf80c4eff99a297b112874e9c4f9cee75156ad7a0ced6a45589c79
MATLAB
9,592
194
function plot_individual_worm_videos_post_analysis_function_1(main_folder,output_video_frame_rate,save_excel_file,path_history,demo_mode,parameters,count_number_of_reversal_trial_rails,count_number_of_reversal_trial_turns,stimulus_intensities,test_stimulus_duration,current_tracks,fps,behavior_colors,stim_color) close ...
c880b485d49ae2973415486604f099d2766c5f6b7170a9a2c9da7f1dbbe8863a
MATLAB
9,597
196
% DATA ANALYSIS PIPELINE FOR FIBER PHOTOMETRY EXPERIMENT % Name: OptoDoseResponse_PooledOverall_2023 % Cohort: PFC dLight1.3b with opto % May 2023 - Marie Labouesse, marie.labouesse@gmail.com % 1- POOLED GRAPHS AND MEASUREMENTS % loads FP data previously analyzed (with: OptoDoseResponse_DataExtraction then Op...
8f1abcf4d74f1b3af7c8c017a089e7ba49075be81c27f130ddc2b9ec91d0312e
MATLAB
9,609
254
%script MatAFNI_Demo % % % %Purpose: % Demonstrate the use of the matlab AFNI library % The script is echoed onto the screen but it is best % you read through it with a text editor. % % %Input: % You must have the data sets % ARzs_CW_avvr+orig, ARzs_CW_avvr.DEL+orig and ARzsspgrax+orig % in the worki...
1e34646f7e3cedec0c566744dca9c2d6d9a075e02ce20dc27ae4b54065ae1f86
MATLAB
9,618
237
function [nev] = read_neuralynx_nev(filename, varargin); % READ_NEURALYNX_NEV reads the event information from the *.nev file in a % Neuralynx dataset directory % % Use as % nev = read_neuralynx_hdr(datadir, ...) % nev = read_neuralynx_hdr(eventfile, ...) % % Optional input arguments should be specified in key-val...
7ddf8adc972acde4cca3d9febd72f07bed69c12e05c9076f1b95c86dca4a36d5
MATLAB
9,630
210
%function [Spikes,nose,Fs]=getSpikesOF(File); %getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct %2016 % %1. parse the data according to gaps in Timestamps (> 1s) %Session_str, e.g.,'20150906Thalamus36\20150906Thalamus36_1to...' % %Spikes{Nelecs,Nunits}, cell holding spike times in ms fr...
2dd10cf6dfd7f2b64945540644a3cc573584875771ff35abc54693a48debf0ae
MATLAB
9,637
280
% Fig.3 VIP Cells Analysis % Run config.m % Process data for each animal using the processAnimalData function [psth, response, visI] = processAnimalData(cell_activity_allday, stim_type_allday, trials, nanimals, nstim_type, win, threshold, ngratings); %% fig.3c - Plotting PSTH for VIP cells % Define limits for the p...
3c8569b3caa4a5dcab82660a830e44f838cf5d87df89d40175a52afbfdace099
MATLAB
9,637
220
function varargout = motion_survival_plot(varargin) % MOTION_SURVIVAL_PLOT MATLAB code for motion_survival_plot.fig % MOTION_SURVIVAL_PLOT, by itself, creates a new MOTION_SURVIVAL_PLOT or raises the existing % singleton*. % % H = MOTION_SURVIVAL_PLOT returns the handle to a new MOTION_SURVIVAL_PLOT or t...
0db31f61e50ace03eca6ab02d8c3881575ae1f496f5587c81fc4a3739aed6e99
MATLAB
9,643
328
%% Experiment 12: Noise Stability Ananlysis %% Perturbation: rng('shuffle','twister'); U_Scales_Noise = struct('scale',[],'noise_sigma',[],'UU_diag_SC_vs_SCnoisy_all',[],'all_combo_diagonals',[]); d = 2.5e-4; std_multiplier_list = 0:2.5e-4:0.05; var_multiplier_list = std_multiplier_list.^2; k_multiplie...
34b0e935a2b3f0dd6159651ff98cf468b55a6fd7bc54b11fca9138b8798a249c
MATLAB
9,643
222
function plot_model(model_name,data,x,empirical_coeffs) mouseNames = unique(data.mouseName); nSims = 20; % simulate the model with parameters x switch model_name case 'multi_trial_belief' value_init = ones(2,4) * 0.2; for iSim = 1:nSims % loop...
b616e6f969e8bdd029c64f7d96118df232c7ab5e59ee1fa1c934ce49c74cd92f
MATLAB
9,657
368
clear all close all clc %% Behavioral Data analysis % 03/29/2020 % Daniel Sazhin % This script takes a participant's responses and collapses them into a % dollar amount for analysis. % Update the subjects list with up-to-date subjects maindir = 'C:\Users\danie\Documents\Github\istart\UGDG'; % set on computer doing...
6dd230fb40b80ac39e89e42ee29bd2e875f0d8b6845b265778d7218aebb689a6
MATLAB
9,662
208
% ========================================================================== % script : MIBI_linearRegression % -------------------------------------------------------------------------- % purpose : linear regression TSC and brain mask for quantification % input : ROIs and postprocessed data % out...
ba320d00bc2bb49abafd74aed71d98d4e086040d4266fceae8415209408da5ee
MATLAB
9,672
270
function ellipse_t = fit_ellipse( x,y,axis_handle ) % % fit_ellipse - finds the best fit to an ellipse for the given set of points. % % Format: ellipse_t = fit_ellipse( x,y,axis_handle ) % % Input: x,y - a set of points in 2 column vectors. AT LEAST 5 points are needed ! % axis_handle - optional....
1e76566a847f04c73a1b67fb3213d1ad1e41f0a0bb050b608f42d458b56e6b09
MATLAB
9,674
255
function [ellipse_t, rotated_ellipse] = fit_ellipse_altMethod( x,y,axis_handle ) % % fit_ellipse - finds the best fit to an ellipse for the given set of points. % % Format: ellipse_t = fit_ellipse( x,y,axis_handle ) % % Input: x,y - a set of points in 2 column vectors. AT LEAST 5 points are needed ! % ...
9e1f2bfa6e39fb57a6387e0946b220836af89ccf6d6133eef27bc60878318dde
MATLAB
9,678
260
function [coords,direction,lifetime]=dotMotionFrame(coords,direction,lifetime,stimParams,timeSinceLastUpdate,displayParams); % [coords,direction,lifetime]=dotMotionFrame(coords,direction,lifetime,stimParams,timeSinceLastUpdate,displayParams); % % Displaces input device coordinates coords corresponding to one motion fr...
43358007fd79bd48df9e78afc5c53dabaacfd77b43c6299cab5076c399706ae5
MATLAB
9,685
204
function make_no_autocorrelation_env(handles) %% Internal variables fs=filesep; env_folder=[handles.env.path_gagui fs ..., handles.env.name{2} fs,... handles.func_data_name fs,... handles.env.group]; if ~isfolder(env_folder) mkdir(env_folder); end change_permissions(handles,env_folder) n_parcel=length(...
17b36a99bfa23dfa334a44c959815a79ad41e4cd926af23f080e6dd79f2e11b7
MATLAB
9,689
260
function [assignment, cost] = assignmentoptimal(distMatrix) %ASSIGNMENTOPTIMAL Compute optimal assignment by Munkres algorithm % ASSIGNMENTOPTIMAL(DISTMATRIX) computes the optimal assignment (minimum % overall costs) for the given rectangular distance or cost matrix, for % example the assignment of tracks (in...
ad1a193cfc199da1d518db6470bb1a085fa71d3d62175a5d5c02efbbb5fdf414
MATLAB
9,690
208
function compute_mcmappy_shrunk(obj, session, trial) % Call this one for the maps using the actual geometry (like a % rectangle). %experimentDescriptionFilename = fullfile(obj.RecordingsParentFolder, 'experiment_description.json'); % cm_per_bin = obj.Config.placemaps.cm_per_bin_rect_both_dim; % cm_...
c126f049cdf04ce75dc72415fa093dd5f24636f8db4da32a41f8c18e60a98b2a
MATLAB
9,697
229
function run = nirs_preprocessing(run) % NIRS_PREPROCESSING % This function performs the preprocessing steps on the fNIRS data % % INPUT: % - run: matlab structure containing the raw nirs & motion data of each run % % OUTPUT: % - run: same as input, but with the preprocessed data in the field % run.data_nirs.data_prepr...
734cce5ac1c6ff98f2c2c7cd45ce6c0f05d989bae30a37b1d8ce34515c9ec72e
MATLAB
9,706
274
% processLegTrack.m % % Call this function to process leg tracking data output from APT % % Takes .trk file output from APT and returns processed leg tracking data. % Leg positions, velocities, step parameters % % NOTE: work in progress as additional analyses added % % INPUTS: % none, but GUI prompts throughout % % ...
e74797de6e4dbe0e4080d760e7f1f714db92575a9b1b812feb40c3efa7743783
MATLAB
9,722
271
function data = LoadBinary(filename,varargin) %LoadBinary - Load data from a multiplexed binary file. % % Reading a subset of the data can be done in two different manners: either % by specifying start time and duration (more intuitive), or by indicating % the position and size of the subset in terms of number of r...
e350a92dd7ef73d0d4a70d20a69a92a9de0a37781118bb4eda40b6b09ef508b1
MATLAB
9,727
190
% mglDigIO.m % % $Id: mglDigIO.m 438 2009-01-30 04:46:05Z justin $ % usage: mglDigIO(command,<arg1>,<arg2>) % by: justin gardner % date: 06/30/09 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: This is a mac specific command that is used to control a NI...
aa26559e96ff900cb8cb3dcf34613bcc6f24faf751fe36dd03e1eb65e3674338
MATLAB
9,729
237
function [perCell, total] = mltp_compute_bfo_general_placey(obj, session, rotDeg, mirrorContexts) % mirrorContexts should be the same length as the number of contexts % an entry of 0 means do not mirror, and 1 means to mirror % this is used because often context 2 has the reward cup mirrored % Allo...
0f8bbf21ea23473a37abb161e368ac4b8dc62de2482d7843feab2f7d3ebdf7b6
MATLAB
9,730
252
% p_HFOWaitFigure function st_output = p_HFOWaitFigure(st_intput,pstr_Field,pFieldValue) if nargin ~= 0 if nargin == 3 f_WriteFields(st_intput,pstr_Field,pFieldValue) else error('p_HFOWaitFigure:argChk','Wrong number of input arguments'); end return end %% Variables % Figure Background ...
aba753f026c5334861013dddf8171faf6f6dc2546a22b8fd5138730351062fd6
MATLAB
9,730
376
function group_output_info=gen_network_refine_group(train_opts, net_config, group_input_info) multi_refinenets_group_info=My_net_util.gen_group_info_basic(net_config, 'refinenets'); layers=cell(0); [one_layers, net_input_info]=gen_input_path_merge_net(train_opts, group_input_info); layers=cat(2, layers, one_...
dcf40252a60dc4cd9521db7375aff06c2c177467b2406709d823a2d65a2ea72b
MATLAB
9,737
264
% saveContLegStepParamCond_indpt.m % % Function that saves continuous leg step parameters for all steps that % meet the user specified conditions on bodytraj % Treats all time points as independent, as long as bodytraj condition(s) % are met, unlike saveContLegStepParamCond_bouts.m % Modification of saveLegStepParam...
be85172d4d5c19b6ef18df3748d8e1ed24bf98c3eb4aefc44c1e3f62f0942bab
MATLAB
9,744
370
clear all close all clc %% Behavioral Data analysis % 01/16/2022 % Daniel Sazhin % This script takes a participant's responses and collapses them into a % dollar amount for analysis. % This script is to deal with two subjects with different input folders. % Update the subjects list with up-to-date subjects maindi...
5754fdbbdae93d6731a9a618d6cd0f8622275b3071ed956a2fc4e5a459ce520b
MATLAB
9,754
332
function []= report_events_parameters (ds_events,ds,nparams,specify) %% UNPACK STRUCTURE all_mchw=[]; all_mchws=[]; all_mchwe=[]; all_mchp=[]; all_mcho=[]; all_tdtw=[]; all_tdtws=[]; all_tdtwe=[]; all_tdtp=[]; all_tdto=[]; n_mch_events=[]; n_tdt_events=[]; %% MAKE TITLE STRINGS params=ds_events.params; nparams=...
d97591ba0b89264a7bb047e89852e3cea761d762c22ce3b772b941d50b23048f
MATLAB
9,756
263
function fout = waitbar(x,whichbar, varargin) % Updated to support scProgressBar in sigTOOL % %WAITBAR Display wait bar. % H = WAITBAR(X,'title', property, value, property, value, ...) % creates and displays a waitbar of fractional length X. The % handle to the waitbar figure is returned in H. % X should be be...
c1846cb76a15bf87d4ca73c936465d2d768403d62f9512a6c0d9fed0abfa4c25
MATLAB
9,757
251
function [h, coordsys] = ft_headcoordinates(fid1, fid2, fid3, fid4, coordsys) % FT_HEADCOORDINATES returns the homogeneous coordinate transformation matrix % that converts the specified fiducials in any coordinate system (e.g. MRI) % into the rotated and translated headcoordinate system. % % Use as % [h, coordsys] =...
14df97d21f9e8fcb703cd9391feecfe3a9e9a38123496642504ce58a934f3d66
MATLAB
9,769
217
clear all close all %% Parameter initialization run('spiking_parameters_simple_dopa_m_c.m') %most parameters are stored in this file plot_var = 1; %% main program Ach = zeros(1,t_total/dt + dt); for l = 1:num_trials tic %% initialization [v_it,v_kt] = deal(zeros(N,1)+v_rest); %membrane potentials ...
7ba113e52176eaf6b70cf8846ebaf6a7fc1b0b9a93f723c5baaa5b4befcc4cd6
MATLAB
9,774
258
% This is a mesh processor script: it computes basis triangle parameters % and necessary potential integrals, and constructs a combined mesh of a % multi-object structure (for example, a head or a whole body) % % Copyright SNM/WAW 2017-2020 %clear all %#ok<CLALL> % set tissue_dim <--- [~,name,~]=fileparts(pwd...
44a09dcdffb4b3f07f7ac5877d2af3e5095995593851b5f89ebc06efc086b1e0
MATLAB
9,788
418
% % Perform curve fitting. % % PARAMETERS % $NETWORK % $DECOMPOSITION % % INPUT % dat/info.$NETWORK % dat/decomposition_split.source.$DECOMPOSITION.$NETWORK.mat % dat/split.$NETWORK.mat % dat/means.$NETWORK.mat % % OUTPUT % dat/fit.$DECOMPOSITION.$NETWORK.mat % curves Struct by name of curve of parameters in colu...
dcb522a401909a82a9d8f51b4040b8315a1a5a28fe5437976cc06dee8e30eb7e
MATLAB
9,789
248
% mglMovie.m % % $Id: mglMovie.m,v 1.1 2007/10/23 22:21:23 justin Exp $ % usage: movieStruct = mglMovie(filename,position) or mglMovie(movieStruct,command,<argument>); % by: justin gardner % date: 12/23/08 % purpose: Used to display quicktime movies. This *only* works on 64 bit mac for now....
b90d12a8767296b0d16a5272b46863c94d13d5955636083968e76c048cb84ae4
MATLAB
9,797
257
function [hdr, record] = edfread(fname, varargin) % Read European Data Format file into MATLAB % % [hdr, record] = edfread(fname) % Reads data from ALL RECORDS of file fname ('*.edf'). Header % information is returned in structure hdr, and the signals % (waveforms) are returned in structure reco...
77c369ae65661255d916b775e0003efa9cf365f7a3e8b2faff21ebbab33e8d28
MATLAB
9,799
190
classdef MLExperimentBuilder < handle properties (Constant) ExperimentDescriptionFilename = 'experiment_description.json'; SessionRecordFilename = 'session_record.json'; end % properties methods (Static) %% function [experiment] = buildFromJson(config, sessionsP...
7976a39dbaa7228417fe4d0b98e2f18990be6bf58d91003238284fe00aa855d0
MATLAB
9,802
311
function theAxis = scrollsubplot(nrows, ncols, thisPlot) %SCROLLSUBPLOT Create axes in tiled positions. % SCROLLSUBPLOT(m,n,p), breaks the Figure window into % an m-by-n matrix of small axes, selects the p-th axes for % for the current plot, and returns the axis handle. The axes % are counted along the top r...
e56d527acbfb1fd0b228d0af64c9c302e71bf44da9a4cf2807362091e81993f2
MATLAB
9,802
205
function [] = PlotDirectionalBehavioralMappingExperimentGroup (LNPStats, meanLEDPower, stdLEDPower, L, density, xx) %Takes in structure LNPStats and plots them depending on the settings fps = 14; BTA_seconds_before_and_after = 10; BTA_seconds_before = BTA_seconds_before_and_after; BTA_seconds_after = BT...
2aa927489651a21da8068f9582257b18f639f8a9eda8a3f4d97b8009b3a19185
MATLAB
9,818
114
function [ opt ] = internal_parameters( opt ) % *-* 25.11.2019: the'internal_paramters.m' script was converted to a % function %% This function performs SPATIAL TEMPLATE MATCHING for CaT detection. % --------------------------------------------------------------------------- % Internal_parameters % % This scrip...
3a20a32d3da9b6da308da04b7739541109afd498f7082c49a19cb0eda45c17f0
MATLAB
9,819
151
clc, clear % ------------------------------------------------------------------------ % Human batch options that can be changed in the GUI or here directly % ------------------------------------------------------------------------ % set the number of cores for parallel processing try numcores = max(cat_get_defaul...
67b7ab921686a64b840af218fba86bc20277cc47968b36b640797a75175e57db
MATLAB
9,824
275
function freezeColors(varargin) % freezeColors Lock colors of plot, enabling multiple colormaps per figure. (v2.3) % % Problem: There is only one colormap per figure. This function provides % an easy solution when plots using different colomaps are desired % in the same figure. % % freezeColors freeze...
cc66740241852995cc088a2c403508745847db3ea4e6509ce07b994ddd22bb4f
MATLAB
9,834
210
showfigs = 1; %% Define all three planes (m) X = 1e-6; % YZ Cross-section position, m Y = 1e-6; % XZ Cross-section position, m Z = 0.5e-3 + 200e-6; % XY Cross-section position, m delta = 3e-3; %1.6e-2; % ...
9a4d1d724f6543d94976a5612f8d3ccf5645eff041286b16c0b96920f6a98162
MATLAB
9,835
278
function h = plotLFPTrendLogs( obj, varargin ) % Plot LFP band power and stimulation amplitude accross time from LFPTrendLogs % works as an auxiliar method to the extractTrendLogs. % % Syntax: % h = PLOTLFPTRENDLOGS( obj, ax ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where ...
f0309cc4e8cf0569afd1c90e22d11397fa9633869c2ae63706519766adeedcab
MATLAB
9,841
308
% upDownStaircase.m % % $Id$ % usage: upDownStaircase(nup,ndown,initialThreshold,stepsize,<stepRule=0>) % by: justin gardner % date: 06/20/05 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: implements a upDownStaircasecase % % e.g.: to start a 1up-3down upDown...
dd3b8289dd2578a0c00183ab7faae29c328062fa67eb776076210f68513c0ff0
MATLAB
9,857
280
function [dat] = read_neuralynx_dma(filename, begsample, endsample, channel) % READ_NEURALYNX_DMA reads specified samples and channels data from a Neuralynx DMA log file % % Use as % [hdr] = read_neuralynx_dma(filename) % [dat] = read_neuralynx_dma(filename, begsample, endsample) % [dat] = read_neuralynx_dma(...
2e4997d1d506e354a7d0ef3d48b940cdb0d9d35638ab3c5358bcff062be7faea
MATLAB
9,863
278
function HDR=bv2biosig_events(EVENT) % BV2BIOSIG_EVENTS converts VMRK marker information BioSig Event codes. % according to biosig/doc/eventcodes.txt. % Currently, the convention of the BerlinBCI is implemented and supported. % % HDR = bv2biosig_events(arg1) % % arg1 can be an HDR-struct containg HDR.EVENT.D...
4b2a8078dfaf67f48e689f2f908207a0996f66f91a9a1f57ea808ca004806fa4
MATLAB
9,869
238
% stats_grid_memory (data_dir, read_from_excel, show_plots) % this function prints stats into the console and % generates some figures % % INPUTS: % data_dir (str): path to source data % read_from_excel (bool): load data from .xlsx? (as opposed to .mat) % show_plots (bool): visible plots? % % Mackay...
ae839fd512fb770c90ebf70c14c78d25970b3eb8b86d21748ccf2b8c5ee92931
MATLAB
9,870
188
% f_GetIcons.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 st_Icons = f_GetIcons [m_icon,m_map] = imread('./Icons/open.gif'); m_map(find(m_map(:,1)+m...
7ea203ab2fb2e9c59b5934b4990c2cf4249fd07a8704af68e6de460aaf6d18c7
MATLAB
9,896
313
function saveastiff(data, path, options) % options.color % : true or FALSE % : If this is true, third dimension should be 3 and the data is saved as a color image. % options.comp % : 'no', 'lzw', 'jpeg' or 'adobe'. % Compression type. % 'no' : Uncompressed(Default) % 'lzw' : lossless LZW % ...
883c39fc07c4df2ab8fb9669b35cd2649494c6ba291e44d21e14a06db400eabe
MATLAB
9,905
267
% plotLegStepsHist.m % % Function that plots histograms of leg step parameters. Multiple % histograms per figure, by specified conditions (iInj or opto). % Works on multiple pData files. Select through GUI. Should be for 1 fly. % % INPUTS: % whichParam - which parameter to plot, as string; must match field of % ...
94036b98a98750388e7955683792d0e526960a54e93b58c27ad4c7d4840d1eba
MATLAB
9,909
261
% This is a mesh processor script: it computes basis triangle parameters % and necessary potential integrals, and constructs a combined mesh of a % multi-object structure (for example, a head or a whole body) % % Copyright SNM/WAW 2017-2020 %clear all %#ok<CLALL> [~,name,~]=fileparts(pwd); L = length(name)+1; i...
fd6e8a8a8e9c2eca71aa87d35bb2934ae55ac2726b1b53616549971de7d7b280
MATLAB
9,960
262
% plotAEPPEPbyFictrac.m % % Function to plot mean and standard deviation of leg AEPs or PEPs (user % specified), colored by values of a FicTrac variable (yaw, forward, or % lateral velocity; user specified). % User specifies number of bins in which to divide the FicTrac variable or % the edges of the bins. If num...
67e14d80383bdb55f0d03ab15d210f86c72ccb7496ba7a3dee1d9b1c99aec722
MATLAB
9,961
329
clear all close all clc %% Before you run any code % The script implements many of the analyses from Tanner et al. That % manuscript contributes a simple method for estimating weights on % already-defined edges in a structural connectome. Specifically, we use % linear regression to explain the future activity of node...
69901826f47b2d5fe22c0efb140fec405fb4934c243371c86a1c3189ec0c9726
MATLAB
9,967
221
function plotCrossCorrVar( obj, varargin ) % PLOTCROSSCORRVAR Plot cross-correlation and cross-variance for LFP online streaming mode % % Syntax: % PLOTCROSSCORRVAR( obj, varargin ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % * data_type (optional)...
88f2135e54b5eac1ba297a40842c91092768b3bc2f6e8844737c553ac1ae596e
MATLAB
9,969
266
% This project is a general project to perform the analysis % on a general experiment (nothing too specific). % It will make placemaps, and perform correleations. close all clear all clc tstart = tic; % Don't change these projectCfgFilename = fullfile(pwd, 'project_config.json'); pipeCfgFilename = fullfile(pwd, 'pip...
95edac6d2a3ba3177d0dc866b68f6ed6276a1e136032f3d199774f0a9ef27a70
MATLAB
9,983
218
clear all; close all; RUNSIMPLE = 1; SAMPLETIME = 40; % ms zeroIdx = 21; %101; binEdges = -20.5:1:20.5; %-100.5:1:100.5; load ('Alon_maxCorrValAndIdx_normalized_multi_minAndMax.mat'); % maxCorrIdx % vStim % vTrial % do2Stim % do2Trial binCenters = binEdges(1:end-1)+floor(mean(diff(binEdges)...
fac0bf1e496a17fcc7f293a25e8adda801f386caaa3cd94c84e3df29269fc431
MATLAB
9,987
349
%% Script to visualize functional projection of eigenmode regimes % Necessary for Ternary Plot: addpath ternary_plots/data_plots/ addpath ternary_plots/axes_creation/ addpath ternary_plots/utilities/ %% Projection Analysis: scale = 200; filename = sprintf('MICA_schaefer%d_SCFC_struct.mat',scale); load(f...
fc53e4121175134b8e576f7729c687ffe63c741572a8569a00af38777b59c1d5
MATLAB
9,992
177
function [] = C2_ROISelection_RFT(badSubs,ROI_num) % ROI analysis -> Calculates ROI for RFT based on grand average %inputs: % badSubs: subjects you want to reject % ROI_num: number of sensors to constitute the ROI for each side & config %% Load clean MEG file % data_folder='/rds/projects/j/jenseno-avtemporal-att...
cab91365ffb7cecacb17d67fcef4348181380f6e2ff238ee1b07dee7ec6213b0
MATLAB
9,999
218
%%% demo of the full MIN1PIPE %%% clear warning off gcp; % To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary" % if isempty(gcp('nocreate')) % parpool; % end min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [160,160]; li...
dc0b567e293c2406d69d953cb1986bb27b6e02f8573815a84a0d686a68ba8887
MATLAB
10,003
285
function [spike] = ft_read_spike(filename, varargin) % FT_READ_SPIKE reads spike timestamps and waveforms from various data % formats. % % Use as % [spike] = ft_read_spike(filename, ...) % % Additional options should be specified in key-value pairs and can be % 'spikeformat' = string, described the fileformat (defa...
74658c2d0d8aa3b68798c7fa8c4ebcb05a99f26731b38523d5d658ca592f73ef
MATLAB
10,009
206
%% FOG_EVENTS % Analyzes the FOG events and provides descriptional statistics of the % observed FOG events % % INPUT: % - *run.mat files (contains all events) % % OUTPUT: % - descriptional statistics in the command window % - plots of the descriptional statistics % - FOG_events_all.mat: table of all events of all part...
cf71426ea1e89bd3e43085985b393b97c2fa4feae24a2e0f05e08936a4448728
MATLAB
10,013
362
% % Draw a plot that tests whether a given vector of numbers follows a % specific distribution, i.e., a Q-Q plot between the given data and % a known distribution. % % PARAMETERS % type String representing the type of distribution that is % tested against; see below for possible values % x The vector of values % no_...
33194d7001e13b6387d55e5e63bb73f76b02beaf3e1a1aa0c563fce88d700b0e
MATLAB
10,019
263
function fout = waitbar(x,whichbar, varargin) % Updated to support scProgressBar in sigTOOL % %WAITBAR Display wait bar. % H = WAITBAR(X,'title', property, value, property, value, ...) % creates and displays a waitbar of fractional length X. The % handle to the waitbar figure is returned in H. % X shoul...
d6c1d7a7cad01043066a371c08e047ae24fa61905a0f6d63fb92eb6fe00c22e9
MATLAB
10,036
240
function gretna_Vol_ROI_signal(Data_path, File_filter, Template_path, Template_filter, RoiIndex, Output_path, Level, Num_thres) %========================================================================== % This function is used to extract signals for each voxel within each ROI. % % % Syntax: function gretna_Vol_ROI_si...
01c957e26b1e1defd11398255d5dafe00fd3fde13ba9461eb63fb58346748519
MATLAB
10,039
175
function varargout = times_from_profs(mov, NeurProf, lambda, varargin) % [x_est, x_bg] = times_from_profs(mov, NeurProf, lambda, {BGprofs, batch_size, bin_mask}) % % Find time traces from ROIs and a movie. This function uses the TFOCS % library to find ROIs and time traces using either non-negative least % squares, ...
65e214e9b7718aab36305cd3c1a8aa6abe08b55d989e5acf75fae4575c29e124
MATLAB
10,041
177
% s_selectAndSaveCSTfixPredictionsMatchingVoxels.m projectDir = fullfile(simseqRootPath); baseDir = fullfile(simseqRootPath,'simseq/results/'); subDir = 'preprocData_stRet_matchingVoxels_1ch-glm'; subSaveFolder = 'savedPredictions_fixedPRF_combT'; fitName = {'gridFit2','stRet','stRet'}; betaFolder = 'be...
822f359a056856f168f589599fbbffde6e1eb7ac139af904c81db608c8f1719e
MATLAB
10,071
183
classdef Units < types.hdmf_common.DynamicTable & types.untyped.GroupClass % UNITS Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. % OPTIONAL PROPERTIES properties electrode_group; % (VectorData) Electrode group that each spike ...
3eac1ff15f4749e187f416bc6360ebc761bb45af41829eb58cdf22a929cbe56d
MATLAB
10,092
219
%%% demo of the full MIN1PIPE %%% clear warning off gcp; % To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary" % if isempty(gcp('nocreate')) % parpool; % end min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [160,160]; li...
744451e76d5bad16b1e00db8774fbf5971e6c3ded14f4a710ad122be6cc75e17
MATLAB
10,095
273
function mltp_plot_rate_difference_matrices(obj, session) mltp_plot_rate_difference_matrices_helper(obj, session, 'peakFiringRate', 'PFRS', false) mltp_plot_rate_difference_matrices_helper(obj, session, 'meanFiringRate', 'MFR', true) mltp_plot_rate_difference_matrices_helper(obj, session, 'informationRate', 'IC', fals...
192697055fe36c746e1bdf9fc1ef75dc94dfa86370130adf5ca04d4096e452bc
MATLAB
10,098
290
function convertUG_BIDS_2021_debug(subj) maindir = pwd; usedir = '/data/projects/istart-data/'; %try % 11-18-21 | This is the code I am using for the bids converter. % Plan now is to use the BIDs converter for only the simple regressors. Ie: % Export the endowments (cue onsets) and the decision phases % (accept/rej...
d9011893522c1c0160e79ae0149db515d2871977e2552cf848925d5bee5bac25
MATLAB
10,113
265
function [tpr,tnr,info] = vl_roc(labels, scores, varargin) %VL_ROC ROC curve. % [TPR,TNR] = VL_ROC(LABELS, SCORES) computes the Receiver Operating % Characteristic (ROC) curve [1]. LABELS is a row vector of ground % truth labels, greater than zero for a positive sample and smaller % than zero for a negative o...
2e9adbffdbc7f6e1d997002baa5321bb764842ce81567686d566e2c07b73a3f4
MATLAB
10,115
226
%Output results of Mass Univariate Toolbox t-test to a spreadsheet. % %EXAMPLE USAGE % >> ttest2xls(GND, 1, 'results.xslx') % %REQUIRED INPUTS % GND - A GND variable with t-test results % test_id - The test number within the t_tests field of the GND % struct % output_fname ...
2e3f21c0a2ed571f0a2cc9318cb76f8f6a7a9e32632494f85973c930fc1ea998
MATLAB
10,116
255
function [HZmvntest,P] = HZmvntest(X,c,alpha) %HZMVNTEST. Henze-Zirkler's Multivariate Normality Test. % Henze and Zirkler (1990) introduce a multivariate version of the univariate % There are many tests for assessing the multivariate normality in the % statistical literature (Mecklin and Mundfrom, 2003). Unfortunatel...
cf72eb010b59c9bf2d8cbf9bf77f8d9c121d2949aab53518676fe534a1fb4dad
MATLAB
10,117
272
% multiLinRegEphysFTContParam.m % % Function to perform multiple linear regression where an ephys parameter % is the independent variable and FicTrac and continuous step parameters % are the dependent variables. Specifically, dependent variables are one % FicTrac parameter and one or more continuous step parameters...
8c64e6af95de65a0cf1922dbc4433ad8ed43d4fb11e82bd0820a52be241de441
MATLAB
10,133
277
% Function f_EqualizerFreqFilter.m % % Description: % This function performs a kind of spectral equalization by removing a % polynomial tendency to the magnitude of the signal spectrum estimated via % the FFT. The procedure changes the FFT magnitude but conserves the % original phase. % % Inputs: % pv_InSignal: input...
fc28d25c6420baf0399ec98d736e9bab331d5c84c35809289a3bd73e14d4a03c
MATLAB
10,150
223
%%% demo of the full MIN1PIPE %%% clear warning off gcp; % To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary" % if isempty(gcp('nocreate')) % parpool; % end min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder scale_lowBG = 5e3; scale_no...
b584bae176da3b8a4b5b3daeafcc6894c7bcfa57fe95aa8e1a1023a0ffb0816e
MATLAB
10,156
273
% scatterMoveCondData.m % % Function to generate a scatterplot of movement conditioned data, the % output of moveCondPairData(). % Specify data on x-axis and data on y-axis by field name. Can run for any % combination of fictrac or imaging fields. % Plots multiple flies either on same plot or on different plots % Pl...
8262b76e927d64f7f238120a69a0aa09aea137c57713f448cad6832518cbf9be
MATLAB
10,161
239
function varargout = resolve_problems_gui(varargin) % RESOLVE_PROBLEMS_GUI MATLAB code for resolve_problems_gui.fig % RESOLVE_PROBLEMS_GUI, by itself, creates a new RESOLVE_PROBLEMS_GUI or raises the existing % singleton*. % % H = RESOLVE_PROBLEMS_GUI returns the handle to a new RESOLVE_PROBLEMS_GUI or t...
c9e78dca3c086f0169276f64f70859c38d5cbb75f0728bed049037213be7c5ca
MATLAB
10,167
258
% getSpikesStepPhase_cell.m % % Function to get timing of spikes relative to leg step phase % Bins spikes by phase during step cycle, then normalizes by time spent % during each phase. Specify number of bins of phase, delay between % behavior and ephys. Bins separately for each leg % Can condition on behavioral param...
eab6e3cc8f5b49412ddf36e005b78fecfa309ef808cb38a80cb867dd21ed0f02
MATLAB
10,168
222
%%% demo of the full MIN1PIPE %%% clear warning off gcp; % To disable parallel processing, change "parfor" to "for", and change "min1pipe_h5_vary_nopar" to "min1pipe_h5_vary" % if isempty(gcp('nocreate')) % parpool; % end min1pipe_init; addpath(genpath('../ANE')) %% Set data and folder patch_dims = [50,50]; list...
e4d2ea4020eb2d42134d394c1dce3b01c8df449e4831f90a870256c9a48e1f3c
MATLAB
10,180
283
%% Script to plot (1) neurobiological similarity matrix, %% (2) co-vulnerability to psychosis matrix, and (3) their correlation % Copyright (C) 2023 University of Seville % Written by Natalia García San Martín (ngarcia1@us.es) % This file is part of Neurobiology Centiles Psychosis toolkit. % % Neurobiology...
ce3f843123fbc0c64a6e57736baf6d642a4045531f9da3e73fcbd601aabfd84e
MATLAB
10,182
282
function validationStr = fillValidators(propnames, props, namespacereg) validationStr = ''; for i=1:length(propnames) nm = propnames{i}; prop = props(nm); % if readonly and value exists then ignore if isa(prop, 'file.Attribute') && prop.readonly && ~isempty(prop.value) ...
d31f37fbb21d53a278e3b4027cff8994b381b1ff3898c6a9fd9b58e151e352b5
MATLAB
10,200
337
%% CREATE VARIABLES activity_length=120; bin_size=10; start=0; ex_thresh=2; type='Peak'; load('Y:\Christian\Processed Data\Event Analysis\standard_ds_onsets_full.mat') corrs=cell(2,length(ds_events)); rand_corrs=cell(2,length(ds_events)); vars=cell(2,length(ds_events)); rand_vars=cell(2,length(ds_events)); mea...
1e7efd020519822c94000e34d812d8c8f04e70c551ad6b66dc705468b7ef11b3
MATLAB
10,201
275
function ClusterStates_MakeFigure(SleepState,basePath,noprompts) %Check needed here if Sleep state has the right stuff v2struct(SleepState.detectorinfo.detectionparms.SleepScoreMetrics) v2struct(SleepState.detectorinfo.StatePlotMaterials) v2struct(SleepState.detectorinfo.detectionparms.SleepScoreMetrics.histsandthre...
c253c3299685fbb53e81c5f091004803f3d64be894ecd37bb389f6641466b691
MATLAB
10,206
287
function [mri, hdr, cpersist] = read_ctf_mri4(filename) % READ_CTF_MRI reads header and imnage data from CTF format MRI file % % [mri, hdr] = read_ctf_mri(filename) % % See also READ_CTF_MEG4, READ_CTF_RES4 % Copyright (C) 2008 Ivar Clemens % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtr...
c42089fd85808285936e7488d537f25c783e71093de3714cc0a4157b8de0af2d
MATLAB
10,223
162
function [neur_locs,Vcell,Vnuc,Tri,rotAng] = sampleDenseNeurons(neur_params,vol_params,neur_ves) % [neur_locs,Vcell,Vnuc,Tri,rotAng] = sampleNeurons(neur_params,vol_params,neur_ves) % % Function to sample the shapes and locations for all somas in a volume. % The inputs to this function are: % - neur_params - Struct ...
9bf62dd7b14310a622db0f18a3e4d8a4090a092e8b9593b271d7b8feeb2baa44
MATLAB
10,227
272
function Test close all h = figure('units','pixels',... 'position',[270,350,150,300],... 'menubar','none',... 'name','TestFig',... 'numbertitle','off',... 'resize','off'); uicontrol('Parent',h,'Style','pushbutton','String',char([36816,34892,20195,30721]),... 'Position',[10,150,50,20],'callback',...