sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
097e04600d74b107fc19718cfe09b94de4a3e9ee2ccfaeddc7111977851a0110
MATLAB
10,445
176
clear all; addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_bin_corr/outputs/Grange/'); addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_weight_corr/outputs/Grange/'); addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model...
49f1e9030c97c0df692830bd8945f5b84c9eafcd844a7152f3f8fda8495d39dd
MATLAB
10,473
238
%% Two to One Electrode tunnels % To be used with the AFR Computation scripts % This program transplants the whole spike index over two electrodes if % there is only one axon. This is to cut down on errors evolved from poor % coupling of axon to electrode. Current allregion_unit_matched files have % outputs from NMI, l...
65d47a950b70ababa0ed75394ea090aa3ef381b52218f54927095ee7942ebbd7
MATLAB
10,474
367
function [dat, map] = volplot(dat, sel, cscale, cmap) % VOLPLOT make 2D or 3D plot of volumetric data (e.g. MRI) % that is defined on a regular orthogonal grid % % volplot(dat, sel) or % volplot(x, y, z, dat, sel) % volplot(x, y, z, dat, sel, caxis) % % where sel is one of % [x, y, z] intersection through the t...
1f857fc71a7cd341cdb8fd92df8ce4be31c1095b6620e029fdd26a0d9e3f3295
MATLAB
10,495
275
clear all close all load('../data/opt.mat') global BBCI_PRINTER EEG_FIG_DIR BBCI_PRINTER=1; EEG_FIG_DIR=opt.figure_path; for type = 1%1:numel(opt.epoch_type) clear epos statIval fprintf('Calculating ERP for %s epochs ...\n', opt.epoch_type{type}) %% load data data_path = [opt.preprocessedData_...
ff9488125311df1a163622798414b781becd55a33aef1f044044511373fda4b3
MATLAB
10,513
188
%Plots example IED. %2024/02/26 %% define directories: root_dir=define_flicker_root_dir; figures_dir=[root_dir '/stg-analyses/NatureComm2024-figures']; metadata_tbl=readtable([root_dir '/FlickerStudyMetadata.xlsx'],'Sheet','Subjects','PreserveVariableNames',1); metadata_tbl=metadata_tbl(:,{'Subject_ID','Subject_ID','...
c45ad64b8da76b8d3d25eab3302eed77654c081ce5f8bb967c7736696da14dd0
MATLAB
10,561
289
if ss_str.run_f20_e3010_timesweep data_dir = 'avalanches_code/data/fields20timesweep/'; % file prefix string: 20 fields, eps = -30, eta = 10 name_str = '_stim20e-30.0et10.0ph1.0p1.0'; dir_name_str ='timesweep_stim20_e30et10'; par_title_str = '20 fields, \epsilon = -30, \eta = 10, '; % time...
d349715d7b093015bf1a10bc94d6b8eabcf724bbc722bd3bc99382587729711f
MATLAB
10,575
321
% FindSynapse - find putatitve monosynaptic connections based on % cross-correlograms % % USAGE % [synLat,synStrZ,synStrR,bounds] = FindSynapse(cch,options) % % cch: a matrix of cross-correlograms in columns (expressed in number of events) % % Returns: % synLat: two column vectors of synaptic latencies: % ...
f780a9eddd7d0ff708357167f8465ba1ab093bea6e03baf485376a66ad9c7547
MATLAB
10,578
411
%% CLEAN clear;close all;clc; %clean old residues params.extract_databases = 0; params.extract_pivot_table = 0; params.export_png=1; params.export_fig=1; params.export_txt=1; params.export_mat=1; params.data_type = 'dff'; params.PEATS_binsize_ms = 100; %en ms params.PEATS_x_tickfreq = .1; %1/10 %% FILTERING SEQ...
1726e266282083c16b797e910d1e8ec80bea321c775a9583e9f7e0731bf29e58
MATLAB
10,579
380
function BEH_analysis_regression(exp_name) % to show plots for rebuttal rebuttal = 0; %load raw data load(sprintf('BEHdata-%s.mat',exp_name),'BEHdata') %load summary data load(sprintf('BEHsummary-%s.mat',exp_name),'BEHsummary') nS = length(BEHdata); [nB,nT] = size([BEHdata(1).dec1]); %% psychometric curve stay s...
d9d879b08356168eb35c6ab48023bea8388450c61bde6b59f5f83c4b312a2da1
MATLAB
10,579
267
%% %% Create phys space plot with smoothing using methods %% from the CMBHome software %% %% Todo: something seems wrong with the alt_heatmap %% so original heatmap should be used for now %% %% Note: this is set to only use highres_spikes.csv from high_res_traj.m %% use_hopper and use_laptop options are commented out. ...
5469b06728a728f1a628398e291cb099f8af317d5239272f956fa415591d6195
MATLAB
10,627
275
function [A1,b1,c1,A2,b2,c2,params] = make_Abc_interlace(signal,spatial_size,region_of_interest,options) % [A1, b1, c1, A2, b2, c2] = make_Abc_interlace(signal, spatial_size, ... % region_of_interest, options) % % Compute A, b, and c parameters for an interlaced 2D image. ...
02054b5103dc9c581e916ff20393b339386a07ab8656b5437927dbe3399e193d
MATLAB
10,635
309
function handle=jicolorbar(loc,tit) % JICOLORBAR Same as COLORBAR, but does not resize current axis. (JRI) % JICOLORBAR('vert') appends a vertical color scale to the current % axis. JICOLORBAR('horiz') appends a horizontal color scale. % % This is a modified version of an older Matlab COLORBAR function. % ...
baa30b002adc4cf5f1045f9f6df91f28c790fb16f342bca6dcbe73830db8765b
MATLAB
10,665
231
%% cameraCalibration.m % % This script assumes you followed a protocol for data acquisition as % described in Huang et al. (https://doi.org/10.1038/Nmeth.2488), i.e. you % recorded a stack of dark frames and a couple of stacks with uniform % intensity at different intensity levels. % % The camera offset is est...
472a0586a534e096a90b9df8b51b0546369491ec8a6b09ceddff16ae4d70969e
MATLAB
10,695
441
%% Load data binsize = 0.2; % bin size for population vectors, needs to be large thSmooth = 2; % smoothing factor of population vectors iso = 1; % set to 1 if need to re-run Isomap load(fullfile('Data','SpikeData')); load(fullfile('Data','BehavEpochs')); [~, foldername, ~] = fileparts(pwd); load(fullfile('Sleep',[...
2fab8789839f206e6aef92d0a84a36b320380dbc4b6d949fb26c57386377287e
MATLAB
10,703
251
function output_variable=neuron_reconstruction(wholestack,to_be_added,source_variable,outputpath) % wholestack: the recorded stacked % to_be_added: the neurons to be added % source_variable: neurons already tracked % outputpath: outputfolder figure id_added(size(to_be_added,1),1)=0; for i=1:size(to_be_added,1)...
b9dc461cb9f60f062273ddd0705dcbda720fcc4eb75178d7857f583f3425e9e3
MATLAB
10,708
281
% STATUS: analysis. For internal report. % % SYNTAX: % plotAll_PSD_Welch_OldProbe(sbjNum) % % DESCRIPTION: % plot estimate of power-spectral density for each channel. If axes are % highlighted in red, it means this channel is rejected (didn't meet the % SNR threshold). % % RESTRICTION: % Only for sbj 08 and 10. ...
c2d9b2426e0247ee3b1b48585a99843716c2c67dfe07d76c6a15721748edf603
MATLAB
10,726
267
% Information calculation for population spike count and maximum likelihood % estimator across phi, epsilon values. n_neur = 128; J_i = randn(n_neur/2, 1); J_i = [-J_i ; J_i]; prob_s_fun = @(h, J1, eta1, eps1) 1./(1 + exp(eta1*J1*h + eps1)); %% Compute, for fixed eta, epsilon, J, h_MLE and SE_h_MLE as h_true vari...
4695a56b5abbb0929800896c16b849f8163f17ee7181300322da05cd9841770d
MATLAB
10,732
305
function [mstruct, param,f] = defineModel(modelname) %build structure mstruct, which contains the hard-coded parameters in this %function according to string input modelname if strcmp(modelname,'jointRL') mstruct.modelname = 'Joint-action RL model with perseveration'; mstruct.modelshort = 'jointRL'; mstru...
cfe344233288a44a679822c6a7b3e6a51cfc421e33e4f9eaa3f16a507d6cae87
MATLAB
10,757
329
classdef acti < timeseries %ACTI create actigraphy objects % % R = ACTI(DATA, 'Epoch', epochVal) returns an ACTI object % containing the data in DATA. EPOCHVAL determines how many seconds % one point stands for. Note that the EPOCH property is immutable. % R = ACTI(..., 'StartTime'...
a423a9fe7da88a5083fa495b224ca4fc5ebbefe9062469698bf5572cd677ad0e
MATLAB
10,782
181
classdef Analogout < Sharedmethods % ANALOGOUT Digital-to-Analog conversion channel % An Analogout is a channel through which an analog waveform is sent out to the "command" BNC of an amplifier channel. % -------------------------------------------------------------------------------------------...
4db1065776281635649a5aa219f727016e79a8ff82264c9701ac8006026e5054
MATLAB
10,807
425
%function Duszkiewicz2024_Figure_SynapticConnections % This script reporoduces panels from: % Figure 4, Extended Data Figure 2 % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you c...
f70a94071535d51585bce4c3689902507d0515be2c62fddab5cf2083880facd4
MATLAB
10,822
267
function [results, params] = prevalenceCore(a, P2, alpha) % permutation-based prevalence inference using the minimum statistic, core % implementation of the method proposed by Allefeld, Goergen and Haynes (2016) % % [results, params] = prevalenceCore(a, P2 = 1e6, alpha = 0.05) % % a: three-dimensional array...
b4222a19589799209c9a38f84a6564ba26bec316097f27a9c6ef93a76e4bc300
MATLAB
10,840
301
% This software can reformat animal recordings for use in simulations. % Also statistics can be generated about the animal movements in the data. % % reference: https://www.mathworks.com/matlabcentral/answers/510528-transform-x-y-coordinate-to-angle % run options reformat_traj_data = 1; % choose to reformat data or l...
413acdc3b90edf9d226a6ca083d7d405941c903f13aef6fa9eaccfe8c5dd71d4
MATLAB
10,873
413
%% CLEAN clear;close all;clc; %clean old residues params.extract_databases = 0; params.extract_pivot_table = 0; params.export_png=0; params.export_fig=0; params.export_txt=0; params.export_mat=1; params.data_type = 'dff'; params.PEATS_binsize_ms = 100; %en ms params.PEATS_x_tickfreq = .1; %1/10 %% FILTERING SEQ...
44bac718cb872d8a2c1c4b233781cad711fe17c25665e7e481376f085492edda
MATLAB
10,874
334
function [w, args, log_posterior, wasted, saved] = smlr(X, Y, varargin) % Trains a Sparse Multinomial Logistic Regression (SMLR) classifier. % % Usage: % % [W, ARGS, LP, WASTED, SAVED] = SMLR(X, Y, ...) % % Fits the Sparse Multinomial Logistic Regression (SMLR) model to a % given dataset. Multinomial Logisti...
099851634d3de9517e004c709831f8734a814ae709d5aab24893e71ba8f2af6a
MATLAB
10,891
334
%% Fig6A-D: plot HR/FA rates clearvars; clc; close all; saveFigs = 1; addpath('.\functions\'); addpath(genpath('.\src\')); datapaths; load([BehPath,'\SalicylateBehaviorData_HitRates.mat']); NMf = length(UMf); NMd = length(UMd); UMd = UMd'; UMf = UMf'; F = figure; F.Units = "pixels"; F.Position = [1,1,13,11.2]./2.54.*...
bda6c59e18196ad9a352d391db8fb7248fa948f5cd9319ad13be6923437b2ddf
MATLAB
10,938
393
% Arithmetic average of HRFs % Light line color, plot ind HRFs % Different processing for sbj 08 and 10 because they use old SD design and % has both single and multi conditions % new codes, ignore grpPlotHRF function plotAllHRF_Grp_ChnCriteria(sbjGrp,criteriaOp) if sbjGrp==1 % all sbjList = {'08','12','13','...
aa9949dba1317a617f86fca43cee6dec462db5604634d4729e781c55a95832ec
MATLAB
10,986
321
% von Mises Mixture Model for Random Dot Motion % _ % This script performs a vMMM analysis for data from the RDM experiment. % % Author: Joram Soch, BCCN Berlin % E-Mail: joram.soch@bccn-berlin.de % % First edit: 07/08/2018, 15:10 (V1) % Last edit: 06/04/2020, 22:30 (V5) clear close all % specify bias bias = 'mo...
037fd8bf1b5f24095d20dcf9b343a0798dc161319e2d802bb94d71f76b1bcc8c
MATLAB
10,993
298
classdef MeasListClass < FileLoadSaveClass % Properties implementing the MeasList fields from the SNIRF spec properties sourceIndex detectorIndex wavelengthIndex dataType dataTypeLabel dataTypeIndex % Used for condition when dataType=99999 ("Processed") and...
1115bcf8409b7495f311575dfaf7f151032c7aa9b5cb8ae2e28132b64ca28015
MATLAB
11,000
241
% all_results = prevalenceTDT(inputfilenames, P2 = 1e6, outputfilename = 'prevalence', alpha = 0.05, decoding_measure) % % This function is adapted from the original prevalence.m function from % https://github.com/allefeld/prevalence-permutation/ % to perform permutation-based prevalence inference with TDT. % % See ...
16fc97fe86ac7b563024e65940840786cf44e18f6ff20d34975bd09e9a175833
MATLAB
11,010
414
%% Plot Figure 8 %% Clear workspace clearvars; close all; %% Load data load('Data/MaskOrt20220722T024B012_SpencerMod.mat'); % Add negative parts and remove 75deg ti = ... [1:sParmStim.BGnOrt-2,sParmStim.BGnOrt, ... sParmStim.BGnOrt-2:-1:2]; tBGOrt = sParmStim.BGOrt(ti); tBGnOrt = length(tBGOrt); tBGnOrt90 = fi...
88fcc454e6d727c45b496493e1696991152964a21b4ffcad66a2e4198019518e
MATLAB
11,026
214
% Inactive % Plot HRF using outputs from scripting % plotHRF.m plot HRF using outputs from group.mat from Homer3 GUI % Completed % This plot all conditions from one channel. function plotHRF2(sbjNum) figSaveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2st...
81dfea8d7a2983ed6d68ebb91408336d3578a031a6b49a6dd9dd4e386639f05d
MATLAB
11,029
326
function [errmsgs warnmsgs] = unit_create_xvalid_indices() % [ERRMSGS WARNMSGS] = UNIT_CREATE_XVALID_INDICES() % % This is a script that tests CREATE_XVALID_INDICES.M. It % does negative and positive tests on the selectors and % the actives selectors. % % ERRMSGS = cell array holding the error strings % describing an...
1709bdf8802876b2ca0296585cbdc36f0fe7b77111d6a828ee84e4ffb9ae9ace
MATLAB
11,047
410
%% parameters and data binsize = 0.1; % Bin size in seconds rng = 10; %Range of CCG in seconds sdSmooth1 = 1; % smoothing kernel of MUA, ideally std = binsize sdSmooth2 = 1; % smoothing kernel of spike trains, ideally std ~ 150 ms load(fullfile('Data','SpikeData'),'S'); load(fullfile('Data','BehavEpochs')); [~, fold...
b53d001056bcfd0304287e7c40ad45f997c8f17047f0e0b85df06421ca6d1ced
MATLAB
11,072
305
% weight distribution designer with no preferred direction biases % % references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/4...
fee096115ebbc464a011d7307822ac7a495507c522c4dd0c66fae60159265c30
MATLAB
11,073
331
function [conduction_time,max_area,direction,num_peaks,total_bins,overlap_bins, total_spikes, overlap_spikes]=... sum_area_nonpeakstest_210707(bincountvec, bincount_ISI,bar_graph,max_fb_locs,max_ff_locs,max_pk_fb,max_pk_ff) % Find feed forward and feedback peaks % Assumes even number of elements in bincount vec an...
14ae7dd52323865463a1eeb4baa1825b380f0e560b9d450e05ed208957b62be9
MATLAB
11,078
178
% GLM1 Estimate Mean Grid Orientation: % This script will produce two beta values corresponding to the brain % activity modulated by the sin and the cos of the trajectories that % participants are performing. % 4-Fold crossvalidation: iterate 4 times and use 3 partitions (2 runs % each) out of 4 to estimate the grid or...
3671641b7672b8b9c5b268870e430a60238e4330ca0657a5df80b481fe13cf6d
MATLAB
11,083
293
% config % % Descriptions tba % % $Author: Peng Li, Ph.D. % Division of Sleep Medicine, Brigham & Women's Hospital % Division of Sleep Medicine, Harvard Medical School % $Date: April 07, 2020 % % ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
9c95b1d59ae349a1f5ebb7537ce926ae1ec252fca5f02f1def27d5ad283025a8
MATLAB
11,093
374
function simulateBehavior(models,paratype,fbtype,nSubjects) % input parameter % - models % - paratype ( % empprior = parameters drawn from empirical prior distributions % random = drawn from random (=uniform) distributions % fitted = drawn from behavioral data % - fbtype ( % value = magnit...
21462fa91a678b4978266066d72425e7e338821a039c19a9212ced9b1dccc10a
MATLAB
11,099
410
%% parameters and data binsize = 0.1; % Bin size in seconds rng = 10; %Range of CCG in seconds sdSmooth1 = 1; % smoothing kernel of MUA, ideally std = binsize sdSmooth2 = 1; % smoothing kernel of spike trains, ideally std ~ 150 ms load(fullfile('Data','SpikeData'),'S'); load(fullfile('Data','BehavEpochs')); [~, fold...
f1c081f8e6299f6083207de143ab9cc2d475dfadecd36d40b2d9790a7405124c
MATLAB
11,124
262
function varargout = FileDataGUI(varargin) % FILEDATAGUI MATLAB code for FileDataGUI.fig % FILEDATAGUI, by itself, creates a new FILEDATAGUI or raises the existing % singleton*. % % H = FILEDATAGUI returns the handle to a new FILEDATAGUI or the handle to % the existing singleton*. % % FILEDATAG...
96fceac4905b54a48e061e86f38b7fe3f5d57e2017769a73cbad66636116c3d8
MATLAB
11,159
364
function [errmsgs warnmsgs] = unit_interpret_weights() % [ERRMSGS WARNMSGS] = UNIT_INTERPRET_WEIGHTS() % % Creates a really simple dataset, runs multiple % cross_validations with BP on it, and then checks that % interpret weights gives roughly the right output. This % isn't a complete set of checks, but should pick up...
4ebc00ceb2a2428cd5b0701f0aad78e38162e1e32bfb7f9f358228abf997165b
MATLAB
11,165
311
function [ hfig ] = FieldSynthesisInteractive( mask, doshift, lineProfile ) %FieldSynthesisInteractive Create an interactive line scan demonstration of %field synthesis % % INPUT % mask - mask at the pupil, which is the Fourier transform of electrical % field at the focal plane. zeroth frequency should be ...
ea6ad8d86dbbe08aafc41505328877c27aeb404c4c8ad5c8c04873e0f259127f
MATLAB
11,166
308
%This script combines and averages multiple anlyses of multiple mice %run the PLR_analysis_individual script first %file per mouse clear; clc; close all; %% set parameters run = 4; %run number to plot later nThree = 1; %set to 1 for three conditions, 0 for 2 conditions %%Load individually analyzed files f...
d0d7843deae3861dde81b07463c9279a51ca85034feeb69da296fa596d8da5ce
MATLAB
11,172
176
% Netlab Toolbox % Version 3.3.1 18-Jun-2004 % % conffig - Display a confusion matrix. % confmat - Compute a confusion matrix. % conjgrad - Conjugate gradients optimization. % consist - Check that arguments are consistent. % convertoldnet- Convert pre-2.3 release MLP and MDN nets to new format % datread ...
8171c812f24e831738e0c5b57672fb3c8d73c0c5558a5e7d077e4cc245165134
MATLAB
11,173
292
%This script scans an patterns OCT Volume. Uses multiple depths to extend depth of focus %I assume that prior to running this script, user placed focuse at the top %of the tissue. %Pre if (~isRunningOnJenkins()) clear; end currentFileFolder = [fileparts(mfilename('fullpath')) '\']; %% Inputs outputFolder...
621cb87d6d1bf8f0471a21046c7be607fe91dcbd56b660ac86b3d1fbbb78a0b8
MATLAB
11,190
358
classdef StringsClass < handle properties c status end methods % ------------------------------------------------------ function obj = StringsClass(arg) obj.status = 0; if nargin==0 obj.c = {}; return; ...
efec243ccba20305715b4c7fcc2badc714133d70da628ef7111cbd54d1284d83
MATLAB
11,191
408
function varargout = ExportDataGUI(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ExportDataGUI_OpeningFcn, ... 'gui_OutputFcn', @ExportDataGUI_OutputFcn, ... ...
9ebda948f7522bd64acc10e0be22c7c8491fdb362d6fb362151bf362b25ae586
MATLAB
11,209
238
function this = sleepDet(this) %SLEEPDET Perform sleep detection on an ACTI object % % $Author: Peng Li % $Date: Dec 02, 2020 % $Modif.: May 17, 2021 % generate window from doMask2 instead of recalculate based % on mask series % Jun 24, 2021 % see comme...
b8b18e286a550556eed9fb747edddc7d32b646577f8ff18699f9815fa0c2a172
MATLAB
11,220
389
% Probability Tuning curves clear; clc; close all [task_info, supPath ,~,task_DB_path] = loadDBAndSpecifyDataPaths('Vermis'); req_params = reqParamsEffectSize("pursuit"); raster_params.align_to = 'targetMovementOnset'; raster_params.time_before = 399; raster_params.time_after = 800; raster_params.smoothing_margins = ...
fd3eba0d42828006f5dc29ece14a4477623ac6c05e423de4e5e9a094d2fb02bf
MATLAB
11,232
195
%% Extended Data Fig. 5j: Avgerage pre- and post-stim propagative event frequency % in neighboring astrocytes split by "low" and "high" baseline propagation probability % Modified from PropEvtFreq_SplitLowHighBLProp_MC20231030.m % % 1. Load 'AQuA_CytoGCaMP_2Puncaging_WTCx43CBX_Fig2_3.mat' workspace % 2. Run t...
f4f1c9f1e565adaf0bbf9e52a7df52e1cf3d42fafa817b1cea18340d5257b447
MATLAB
11,243
278
function [err, ErrMessage, Info] = CheckBrikHEAD (Info) % % [err, ErrMessage, InfoOut] = CheckBrikHEAD (Info) % %Purpose: % Checks to determine if the fields in Info are appropriate AFNI style % % %Input Parameters: % Info is a structure containing all the Header fields, % % %Output Parameters: % e...
e3b48389d3f7b332ff1226de92ac2b596cb0f3f3c37b4b7ed8f9763a6e132518
MATLAB
11,280
235
% example script close all, clear all %% 1a. Set base paths % specify which folder the Morphys directories are placed % MAC USERS WILL NEED TO CHANGE SLASHES!!! dir_base = 'C:\Users\Thijs\Documents'; %% 1b. Send Matlab to correct folder dir_oop = fullfile(dir_base,'Morphys','Code','Matlab','Abfanalysis'); cd(dir_oop)...
cd298a96e601d06240d43182e83974e0e15f8c7626ce8d601bc12635be16719e
MATLAB
11,281
407
%% Analyze experimental IR-TFE data (MRF style experiment) addpath(genpath('EPGX-src')) addpath(genpath('lib')) %% Load in data % Contains im1 = calibration experiment, a series of echoes made with % increasing flip angles with a large gap in between. Fit this to % M0sin(alpha*tx) where tx = transmit sensitivity, M0 ...
1e43e662d8d41b2770053d61d4451744fbc91e6d44a8ca618905c7a98699aff1
MATLAB
11,282
371
clear [task_info,supPath,MaestroPath] =... loadDBAndSpecifyDataPaths('Vermis'); PLOT_INDIVIDUAL = 0; ANGLES = [0,90]; NUM_COND = 20; req_params.remove_repeats = 0; req_params.grade = 7; req_params.cell_type = 'CRB|PC ss'; req_params.task = 'choice'; req_params.ID = 4000:5845; req_params.num_trials = 150; req_param...
438ad9980203d9b4986a4114bdeb2c1cfb75b7ba062ce545a8c682c519701053
MATLAB
11,282
371
clear [task_info,supPath,MaestroPath] =... loadDBAndSpecifyDataPaths('Vermis'); PLOT_INDIVIDUAL = 0; ANGLES = [0,90]; NUM_COND = 20; req_params.remove_repeats = 0; req_params.grade = 7; req_params.cell_type = 'CRB|PC ss'; req_params.task = 'choice'; req_params.ID = 4000:6000; req_params.num_trials = 150; req_param...
f7e8eb1f67a8e51ac91ead6ebed748f3610a235dabdb300f9303c741334ea6e9
MATLAB
11,311
197
function [FigPl, FigHst, statsOut] = Figure3HistogramsAndSummaryPlots(Res,varargin) % New function for MS, just produces plots and stats for figure 3, nothing extra whatsoever. % - This is the template code for name-value list OR struct passing of parameters -- % if ~isempty(varargin) ...
a3dce1ea33f8f97210d8b577a397725646ff470e04b67f16810e8b852795edb7
MATLAB
11,312
207
function z = sandwich4x4(x, y) % SANDWICH4X4 compute x*y*x' provided y is Hermitian and dimensionality is % 4x4xN, or Nx4x4. If N==4 it is treated as Nx4x4 % Copyright (C) 2017, Donders Centre for Cognitive Neuroimaging, Nijmegen, NL % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the do...
fdc933d4a37038d73f1437e86dde606353e21de424e43029edffc02787aabb9c
MATLAB
11,312
302
function prepare_tdt_compiler % This function can be added to your script that you want to compile if you % want to make sure the Matlab compiler compiles all relevant files in TDT. % It also contains details on how to compile. It is a workaround calling % all relevant files in TDT once manually, which should invoke t...
1ecbdcb01a73ada5ce1f42ea791b08086147be1757f8332d93c602a1a4515bf4
MATLAB
11,335
324
function [OCTToHistologyTransformMatrix] = fineAlignUsingSurface(rOCT, imBF, markedline, fastmode, OCTToHistologyTransformInitialGuess) %This functions aligns a resliced OCT image with a brightfield image, %based on their segmented surfaces. It first segments out their respective %surfaces and then aligns for trans...
3c9cac3ed9e318209e927c1c79624b8781b49184ef52fd28db16ebec1411c7ab
MATLAB
11,346
406
function demprior(action); %DEMPRIOR Demonstrate sampling from a multi-parameter Gaussian prior. % % Description % This function plots the functions represented by a multi-layer % perceptron network when the weights are set to values drawn from a % Gaussian prior distribution. The parameters AW1, AB1 AW2 and AB2 % cont...
0c795d81eea6b49ee72f343143277b80a3fb7541b18e6ae0b5a80c1d50eab324
MATLAB
11,350
316
function this = exportReport(this, outputPath, varargin) % EXPORTREPORT Generate a professional PDF report for actigraphy data % exportReport(obj, outputFile) generates a PDF report at the specified path. % % Store to tempdir first and move to outputPath increase outputPath is % synced to any third-party...
df46482e408038b5fcfed87371c732e9a5ad05fa95036f4eb036f08c12bc8378
MATLAB
11,377
256
function [status_params,dated_output_folder,NMI_version, folder_address, keep_times]=... Wave_Clus_NMI_Func_211123(directory,scalingFactor,fs,duration,parent_dir,if_cw,skip_to,reuse_last_NMI) % Reuse last NMI only works if skip_to is not 0, reduces redundancy, saves memory %Change log starting 6/2/21 %added multi...
19498240ffce5c3315858c0cd332cfeb7cad8a9001d942a0ac7fbbffc87d8744
MATLAB
11,384
301
addpath('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BasicFunctions'); BCTypelabels = {'BC5o', 'BC5i', 'BC5t', 'XBC', 'BC6', 'BC7', 'BC89'}; BCTypes = [50 51 57 58 6 7 89]; nType = length(BCTypes); SpotSize = [1 2];% small (1) and large (2) SpotSizeLabel = {'Small', 'Large'}; NumSpotSize = length(Spo...
7e8c4b1583f8c3eebcecb4842d72bb35f9631c0211cf59f533cb0bc2094f6350
MATLAB
11,399
319
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
ba5b6e5d57198ac47c9c99cc9385ed893145f020ebb61d9d0b505a2797af70c5
MATLAB
11,430
316
% util unit test % % mv_calculate_performance % check the different metrics with predefined clabel and cf outputs tol = 10e-10; mf = mfilename; % mv_calculate_performance(metric, output_type, cf_output, clabel, dim) % number of instances in classes 1, 2 and 3 N1 = 100; N2 = 200; N3 = 300; %% --- CLASSIFICATION MET...
e3e9b2275bfc3e4c9e89c19574e569d1f77aeb4b8c4f98f9be467c53df0f93a1
MATLAB
11,437
264
% split into single and multi groups. % new. Use trials from dcNew var % Use different method of concatenating to validate the code in % calcCumSumUpdateDCNew.m % work for all sbj 08-16 function calcSlopeValue_AllChns(sbjNum,numClasses,saveOp) % channels pruned stored in mlActAuto var processedDataDir = ['C:\Users\mn0...
1286e03e43fd3b4c49522b14a33b8ac1ab104ef39c9557768b47a2e2893b77ca
MATLAB
11,445
391
function D = tsss_spm_enm(S) % Perform tSSS on rawdata file 'infile' acquired with an Elekta Neuromag % 306-channel MEG system. The tSSS-processed data are written into 'outfile'. % The SSS operation is performed in the head coordinate system with the % expansion origin given by the 3x1 dimensional vector 'r_sphere' ([...
ce4667935b56e0382b1e49ab164ede9fd4c0aed71a748e751f46c5ab74303d99
MATLAB
11,446
314
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig8 PF x tactile interaction" % 3. Using ctrl+enter within each function to run each section %% Section 1: open files % ctrl+enter to run this section clear co=lines; co(6,:)=[.5 .5 .5]; [gc]=grad_co; co(3,:)=gc(...
aa575ab0e8896ed972fbca465bab4e1bb0c7d558d0980ef5d484ad459a9a62ea
MATLAB
11,472
249
clc clear cd 'G:\Fiber_Photometry\2023-62_D1flp-D2cre_D2GLUN2B_mPFC\2023-62_PAVLOV_FR_RL\RESULTS_2023-62_RL1_1sec__bsl_indiv_-3k_-05k' %A=load('CS_C1.mat'); %load le fichier .mat d'un Event/Group (par exemple, si tri en Event/Group/Session) %B=load('CS_DELTA.mat'); %idem pour groupe 2 %A=load('CS_IL...
7a422b9dfd1531756f84100dd99f50530d61f785ff4926e7ffd307a3ce88566e
MATLAB
11,474
293
% STATUS: active. % % SYNTAX: % preprocessFNIRS06_CV_GLM_ssBeta(s,numClasses,rejTrOp,rejChnOp,lpFilt) % % DESCRIPTION: % Convert nirs to snirf file format, preprocess data and fit GLM to % entire dataset. Used for plotAllHRFs.m % % RESTRICTION: % Only for sbj 08 and 10. % % INPUTS: % s - struct containing paramete...
aa3d43e1fb2af3dd46c8a59cd7fef1aa1c731a83f877057c26a897c2a581c4f3
MATLAB
11,475
233
classdef Spike2Setupsettings < Sharedmethods %SETUPSETTINGS Setup configuration information % This object contains all the information about the set-up configuration that is required to know what Analogout % (DAC) channels are associated with what Analogin (ADC) channels. This object is used when creat...
39ce93f042845905709027f58628799ae56b73be8a1ad744465dd3997cdb63a8
MATLAB
11,481
235
function dicom2nifti_bids(p) % function dicom2nifti_bids(p) % % Converts Dicom to Nifti images and stores them in a BIDS folder % structure. Inside the function, specify a number of 'filter' strings that % can be used to identify the appropriate files. % % Input: % - p: Structure with analysis parameters, including ...
b49c3bfce481f8dbcf6388185f0215c0e20b48e122d432eda1df2400cc8b91ca
MATLAB
11,484
332
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig3 and Supp Fig2 PFstimulation_plasticity\probability" % 3. analyze the data within the folder of "Fig3 and Supp Fig2 PFstimulation_plasticity\probability" % 4. Using ctrl+enter within each function to run each section ...
51d12b3854f4b4e4aee32ed0a96d68a15c085b046f2754078011a07b228f6cc6
MATLAB
11,503
436
% Filename : eegprocessor.m % Author : Andreas Seas % Created : 17-11-2021 % Edited : 21-11-2021 % Descr : *** % *** means fix me %% clear slate close all;clear;clc %% Set up Workspace disp("Set Up Workspace"); homedir=pwd; addpath(genpath('C:\Users\as822\Box\PST Project')); addpath(genpath(...
85aa367e750ba799db8e6c5d8c19d9bb3b60e497cf736012901a8a5669866080
MATLAB
11,515
272
function [cfg, clabel, n_classes,n_metrics, clabel2] = mv_check_inputs(cfg, X, clabel, X2, clabel2) % Performs some sanity checks and sets some defaults for input parameters % cfg, X, and y. % Also checks whether external toolboxes (LIBSVM and LIBLINEAR) are % available if required. if ~iscell(cfg.metric) cfg.met...
af934d9902dfa6c84c32206431145a2c46dacd8696566a7f013705d63b4a772b
MATLAB
11,542
249
function [areas,total_bins,overlap_bins, total_area, overlap_area]=... spike_flagging_single_211108... (spon,spon_dir,times_struct_spon,spon_duration,parent_dir,if_cw) % Testing peak finding capabilities across multiple units for elimination % of zeros % Ensure status and tunnel pairs are loaded spon and post s...
9353815efc8db158fa5648cf8545e3530c88537f6f4079a25bea1dd1dcc2c46e
MATLAB
11,543
393
%% SfN19 load('Data/20220921_OriPop_RTmasked_reduced.mat'); DecCfg = load('Data/M21D20180720_Orimask_OriMask_dx_detrend.mat', 'DecCfg'); DecCfg = DecCfg.DecCfg; GABFILE = imread('Data/GaborZ0084W0100O00000P00000.bmp'); GRATFILE = imread('Data/CSGZ0700S0200O00000P00000.bmp'); GABSTIM = 127*ones(201,201); G...
e561ee2d25f17498aee0f35bffd49329c29df381c500c25d8d695fa1d691ad6b
MATLAB
11,543
172
% GLM2 Test mean grid orientation: % This script will test the mean grid orientatio based on the paramtrci % modulation approach. The computed phase is used to re-align the angles' % trajectories of the experiment to each participant mean grid orientation %% Set up the environment clc clear restoredefaultpath SPMPath...
488ae2ddc5f9a43c71f53712071577a37e0b5cfbcf6025308263c1e01be8cefb
MATLAB
11,562
393
%% SfN19 load('Data/20220921_OriPop_RTmasked_reduced.mat'); DecCfg = load('Data/M21D20180720_Orimask_OriMask_dx_detrend.mat', 'DecCfg'); DecCfg = DecCfg.DecCfg; GABFILE = imread('Data/GaborZ0084W0100O00000P00000.bmp'); GRATFILE = imread('Data/CSGZ0700S0200O00000P00000.bmp'); GABSTIM = 127*ones(201,201); G...
d8a0ab5905ee088562f6dfa82542e343a18c66abaaeb383be0c1aca4b21d0c64
MATLAB
11,594
456
% This script reporoduces panels from: % Extended Data Figure 1 % Run in folder A6216-210623 to reproduce the manuscript figure % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you c...
83975a7bf656ecc543df52cc1f82c7c14349cfde661de05c55e72a7f58cdf06e
MATLAB
11,603
303
% config % % Descriptions tba % % $Author: Peng Li, Ph.D. % Division of Sleep Medicine, Brigham & Women's Hospital % Division of Sleep Medicine, Harvard Medical School % $Date: April 07, 2020 % $Modif.: Mar 10, 2026 % Fix a bug (instead o...
cb606851c39406fe1b5f44b695c1e0aeb0f385af59b8f9dc5cef35833564be0b
MATLAB
11,611
403
function [] = summarize(subj,varargin) % Prints info about the contents of the subj structure % % [] = summarize(subj,...) % % SUMMARIZE(SUBJ) will give you a high-level summary of all the % objects contained, including group members. It's % much more informative than just typing 'subj'. % % DISPLAY_GROUPS (optional, ...
4be4c10c3915bb3ba51b453a86727dba6c61fa7f44f8997235658eb5eb08d835
MATLAB
11,622
315
function remove_and_add_neurons(data, neurons_cleaning, outputpath, inversion) % click on a neuron to delete it and then click on save to permanently % remove it from the sets of tracked spots % click on button to add neuron and then save to check the resulting track addpath('./Functions/'); %% GUI Initializa...
d8d9aebfb14529fed8ecca85db0d6b61e069d591b269b8d811d2311261c9e357
MATLAB
11,632
336
function [raw_signals, deinterleaved_signals] = open_doric(filepath,s) %% argument to enable the plot of debug figures debug = s.debug; %% PARAMETERS START %remove artifacts from chuncks artifact_th_high = 10; % MAD artifact_th_low = 1; % MAD %PARAMETERS STOP %% LOAD DORIC DATA [header, data] = load_doric_csv(filepa...
a184ab34862b719e4021f5a918e29ce54661f62314628bcb76bb9b53c2fc1469
MATLAB
11,633
395
% Arithmetic average of HRFs % Light line color, plot ind HRFs % Different processing for sbj 08 and 10 because they use old SD design and % has both single and multi conditions % new codes, ignore grpPlotHRF function plotAllHRF_Grp(sbjList) figSaveDir = 'C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProj...
b7fcd6e3e9c8712e7a06721440a8bcd905ee9d8ce051885b32f47f1ee16aeca4
MATLAB
11,637
337
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
3eeac2fd886e744c8f8527cbd8ec4f504517b49ad2a9b62059a81128236fc93b
MATLAB
11,644
460
function Duszkiewicz2024_Figure_SingleRec_Angled % This script reporoduces panels from: % Figure 1, Extended Data Figure 1 % Run in recording folder A3707-200317 (Dataset_1) % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Pey...
ff406140b6a6c0a69bba2bf5c8d8d9f84974ecfe573110be7dfa62a3d69735f8
MATLAB
11,651
360
function test_suite = test_copy_to_derivative %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 test_functions = localfunctions(); %#ok<*NASGU> catch % no problem; early Matlab versions can use initTestSuite fine end initTestSuite; end function test_copy_to_derivative_unzip_f...
00b05bc60831bae806c3b7006f27c4b76e069d8e7e3a897a1722ea34dcab7432
MATLAB
11,655
371
%% Description errorb(x,y,varargin) % errorb(Y,E) plots Y and draws an error bar at each element of Y. The % error bar is a distance of E(i) above and below the curve so that each % bar is symmetric and 2*E(i) long. % If Y and E are a matrices, errob groups the bars produced by the elements % in each row and plots the ...
6bc67b5ea68d6d8a47aca20fac98a20b2ad2f551b53417586834b108f9523734
MATLAB
11,663
179
function [XSecBinsPrePost_PermMean,XSecBinsChangeAvgBaseline_PermMean, XSecBinsChangeAvgBLPrePost_PermMean] = MeanFt_XSecStatBins_PermEventOnsetByRegion_NoLmk(mydata, CONDITION, TSERIES,... time_window, ExcludeBaseline, perm_num, param_name, ExcludeRampingCells, RampingCellThresh, NBinsPre, NBinsPost) % MeanFt_XS...
1098700e2318ad9cbc56c3936734cd1631bfc0e476d96fc0adb0c42179cad172
MATLAB
11,690
369
clear; close all; clc; %% % from RFMapping_RF_DiffEncoding_batch % Goal: summary plot of Different encoding properties of individual BC to % to exam if spatial information of noise play an role in heterogenous % responses in the subcellular units % FolderPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Activ...
26f8c6437a72a1b53d95d8609879babe7a4d361c7aee00fc19c6d0aa7f1b4aa7
MATLAB
11,730
359
clear; close all; clc; %% CellStr = {'53018_2', '10119_4', '61018_1', '53018_1', '12019_7', .... '10919_3', '11819_1', '12019_4', '122718_2', '10119_2', .... '92418_2', '11019_3', '10519_3', '12119_3', '11919_1'}; CelFils = [ 1 9 1 3 3,... 16 3 4 4 4,... 3 3 9 4 9]; ...
506820fb1a75a78b26008ec01adffe813511ba8d898f2d67d1c1c09d82852112
MATLAB
11,746
244
function [Res] = getShuffledSpatScores(DataIn, varargin) % Spike shuffled thresholds for directionality for single rate maps. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Shuffling parameters % prms.fastMode = 1; %...
c9b5cdca3a4cd04b76cb4de47c75b03b6b7b5014215b0967130d6b1a58e4ea4f
MATLAB
11,752
264
function plot_MultiOnly_DiffStartT_AllChn_CompClassifiers_Final(sbjNum,numClasses,saveOp) processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; if numClasses == 2 savePerfFN = 'performanceLinearDiscriminantUpdated_LR.mat'; else ...
8c27ccabadd89b3cfad1d97f83c2273a5b5e3cc50362584b45c6f8bd48571708
MATLAB
11,820
336
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig3 and Supp Fig2 PFstimulation_plasticity\amplitude" % 3. analyze the data within the folder of "Fig3 and Supp Fig2 PFstimulation_plasticity\amplitude" % 4. Using ctrl+enter within each function to run each section %% ...
434df23a39dab5d3403260d3f9b0c0e05e659904f87e92af9b2b3faeff40d23f
MATLAB
11,860
288
function [K0new, K1new, K2new] = tuneVestibularSimultaneous(... K0_0, K1_0, K2_0, B, I, S, ... tts, head, target, E, P, conds, light, sines, R, RR_data) % Mask free params mask_learn = B.learn_mask_vest_eye_pc; mask_tune = B.tune_mask_vest_eye_pc; n_total = length(K1_0.Kb_eye_pc); % Combine all JR's data in o...
da414c538b0734bdf0cb18f826874ca7cf30e54e744c8bae4563023aeec31648
MATLAB
11,863
240
classdef Setupsettings < Sharedmethods %SETUPSETTINGS Setup configuration information % This object contains all the information about the set-up configuration that is required to know what Analogout % (DAC) channels are associated with what Analogin (ADC) channels. This object is used when creating Ab...
2730d3b0d414388708089e7dbf72b7fa919646214347476ebc4d22cda8fd0fa3
MATLAB
11,866
321
% Sensory Mapping Code close all clear %% Load In Widefield Video %Inputs prompt ={'Enter number of WF frames collected.','Enter X size.','Enter Y size.','Enter sampling frequency.','Enter number of skipped frames.','Enter fraction to downsample pixels.'}; t = 'Input'; dims = [1 50]; definput = {'15000','640','...
9164373acbbf9da7e441111a8a4c072c60f237ef1a88e186c78c795592efbb6c
MATLAB
11,880
307
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = 'Cumulative Sum';numRept = 5;numClasses...