sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2f26befef34db2348d12d5aef7fb19ed12177adcdfcb8b3b82e7fbc7334e86d1
MATLAB
3,652
108
clc clear %% settings type_of_method = 'LDA'; % options: discharge, action_preference, LDA filename_p_values = 'p_kruskalwallis_per_bin_and_neuron'; c = lines(7); marker_size = 4; line_color = [0.5 0.5 0.5]; color_obs_only = [.7 .7 .7]; color_match = c(2,:); color_nonmatch = 'k'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
0c5520db48aef175caaf47721dea37863dbf0550cafe5055932dc293d9eca5ec
MATLAB
3,658
104
classdef ExperimentGUI < DetectionGUI %EXPERIMENTGUI is a GUI to control a stimulus detection experiment. % Author: Lasse Osterhagen properties (Access = private) % GUI components txtCurrentTrial txtNumRewards % Number of received rewards numRewards = 0; end methods function t...
e97846f1e0d87289372c9b8fa12130b3d67a1f5e9a14a5385a69d0ae7e1d995d
MATLAB
3,680
127
function [phi_star, I, beta_opt] = phi_star_Gauss(Cov_X,Cov_XY,Cov_Y,Z,beta_init) %----------------------------------------------------------------------- % FUNCTION: phi_star_Gauss.m % PURPOSE: calculate integrated information "phi_star" based on mismatched decoding % See Oizumi et al., 2016, PLoS Comp for the deta...
f54c3ffdb80df1bb9dbe9ab6f41cb33342c6871e2ce519efc3a5a6c813919795
MATLAB
3,689
71
function [behavior_table, event_timing_struct] = behavior_parser(filenames, timing_table) % The code of this function was adapted from behavioral processing of the RIFF_player_nightRIFF.m % * * AlexKaz, 29/07/19 * * [total_struct] = create_table_from_all_csvs(filenames); cleaned_beh_cellarr = cell(1, 3); s...
b91b058c67fb88aac3b40d7a9bfea756b2a0ec5dc41f07081518f56e0a39fced
MATLAB
3,694
108
classdef ToneStimulusSampleFactoryTest < matlab.unittest.TestCase %TONESTIMULUSSAMPLEFACTORYTEST tests ToneStimulusSampleFactory % It only tests one fixed factory object. % Author: Lasse Osterhagen properties(Constant) sF = 192e3; gateDuration = .0005; dur_freq_set = [.5, 10000; .1, 15000; .1, 20000...
486561da9b9440b3a46a25c963e839aa5201647f1ebcd4c88940aa7d0f02a7dd
MATLAB
3,697
131
clear close all clc %% settings filename_o2o = 'xx_108_4_single_o2o_perf'; filename_e2o = 'xx_108_4_single_e2o_perf'; filename_e2o_sig = 'same_or_diff_LDA'; % 1: e2o sig, -1: e2o n.s. but neuron was tested bins_to_consider = 9:20; boundary_angle = 25.9; % in deg (read from Fig04E command win output) c = lines(7);...
14fac3d240f24adc8f4bc630138d55d08f247934444d58462e21b5620f9fb868
MATLAB
3,703
118
% Main frame acquisition loop - timings imaqreset len_of_run = 10; cam = videoinput('tisimaq_r2013',2,'Y800 (1280x960)'); src = getselectedsource(cam); % frame = getsnapshot(cam); bg = imread('bg.tiff'); h = imshow(bg(1:2:end, 1:2:end)); title('RIFF real time picture'); hold on; h_rat = plot(1,1); fileID = fopen('lo...
aa43ca980c1b2291ef92de966952a9b1ad4a08d6887a3f806c1a5d4e20b61bd5
MATLAB
3,739
94
function [data_mat, noise_locs] = flatten_noise_areas(data_mat, is_uV, neural_mode, bit_resolution) % changes by AP, 061220, adding options for both deuteron and tbsi if strcmp(neural_mode, 'deuteron') SAMP_RATE = 32000; elseif strcmp(neural_mode, 'tbsi') SAMP_RATE = 22000; end NOI...
ff9fcd57bf3c9f479cc8fc7ae684e320b8f1401fbddf214d79efbd2b555e254e
MATLAB
3,745
78
%Author: Tatjana Schmitt, 2019-2022 function [subfield_maps_filled, subfield_borders_rotated_switched, subfield_maps, tonotopy_axes] = ... subfield_assignment(BF_borders_broad,subfield_borders_rotated, coordinates_BF_map_rot_norm,... coordinates_BF_map, tonotopy_axes_rotated) %% transform subfield borders b...
53110425ed9ebb0997ab96a2bb9aa61e1c14bdcfa65354fbd650afa224673407
MATLAB
3,752
102
function [saturatedFrames] = whichDataSaturated(data, varargin) % function [saturatedFrames] = whichDataSaturated(data) % Find where the OPMs have railed/saturated during a recording % Will return all the frames where any OPM has saturated % % It's quite fiddly so you may have to change the options to appropriately % t...
a863daa9567d710ace0dc6ba9a3943e7c7d62b854077346578a2d98bdb22ca88
MATLAB
3,752
97
%% LaBGAS_2_spm_fit_firstlvl_models % % This script runs first level analysis from % a CANlab style first level DSGN structure array and % CANlab/spm style onset/duration and noise regressor files % using CANlab's canlab_glm_subject_levels function % % See canlab_glm_single_subject('dsgninfo'), or documentation in %...
e255ffd8cdcbe3566f92188576ddefc12b7f8c44beb68567be48415ac17956d7
MATLAB
3,768
107
%--- Script generating figure 4 --- %% Initializes everything clear, close all run StartupAnalysis rng(1949) %% Sets Figure parameters % db1FigSize = [100 100 1600 900]; db1FigSize = [50 50 1200 600]; iFig = 0; hFIG = []; chOutDir = 'C:\Users\perre\Cardin-Higley Lab Dropbox\Quentin Perrenoud\PerrenoudCardin_Fi...
4fab30c9c7febc07da0acca9d470cc49a88a8615363d68ac90d8cfec92225750
MATLAB
3,770
159
function FS_AV_Parse(DIR,varargin) % FS_AV_Parse % Parse Data from FreedomScopes % Created: 2015/08/02 % By: WALIII % Updated: 2019/05/02 % added better wireless and large file handeling % By: WALIII % FS_AV_parse will do several things: % % 1. Seperate Audio and Video, and place them into .mat files in a...
edde168f39019a73d8fca319dbac966fbac2896a3eac522da876a3dd5c45b674
MATLAB
3,773
101
%%% Parameters of model %%% c = .5; %contrast sigma = .5; %semisaturation constant sigma_opp = .9; %semisaturation constant for opponency cells p.varNoise = 0.03; %noise intensity p.varImpResp = 800; %temporal correlation of OU noise (ms) p.s = [sigma,sigma,si...
2f7547be9ecdf3037664e8e1e35ff358f7bb678ffb53787fb22627da2de782c9
MATLAB
3,792
101
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <convHRF: convolved an input signal with a double-gamma hemodynamic response function (HRF) > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public L...
a0352e1525a8f27193a9950d33f28fa7e46c222cd69d791f925e53b6e3291312
MATLAB
3,824
83
function preprocess_anatomical_maskcreation(fsldir, subjectdir, diratlas) warning('off','all'); cd(subjectdir); k = strfind(subjectdir,'subject'); sub = [subjectdir(k:end),' - ']; clear k % fprintf('%=============== Generating Anatomical Masks ===============%\n\n') % SPM: Anatomic...
b2642bfb484a8edc50913509c9ed7cd09a3af8a7412573ca830094272b7b4be8
MATLAB
3,831
113
clear all;close all;clc; preproc_dir='E:\mouse_development'; template_dir = 'E:\mouse_development\md_brain_atlas'; FWHM=0.5; interx = 0.25; intery = 0.25; interz = 0.75; cd(preproc_dir) age_list = dir('mouse*'); for i = 1:length(age_list) age = char(regexp(age_list(i).name,'\P\d+','match')); ...
f33c5396a37e635fb7899323643821c8c5c09694dba3926caa083fbae1a5f484
MATLAB
3,833
98
clear close all clc %% settings alpha_level = 0.05; correction_type = 'BH'; % options: 'uncorrected', 'Bonferroni', 'BH' bins_to_test = 1:24; % bins in which the significance test should be done save_figure = 'off'; %% load data load data_Fig3A.mat %% prepare data for figure x = 1:24; y = NaN(4,24); % rows: mean ...
2943741549b3908c7a6c7defa499cfb66292fe3866564e888c16af34ab90f11e
MATLAB
3,842
151
%Tried to make everything TanH function [output] = integrate_dynamics_revised_cla_vip(W, params, x0,It, input_c) %It = linspace(0,params.tfinal, params.n_timepoints); %input_c = input_C(x0,It); [output.t, X] = ode45(@rate_dynamics_ode, ... linspace(0, params.tfinal, params.n_timepo...
85e684a586d791a07bb448bf5f8d31fcb33ca773cae1a836ca952b28aa1766a0
MATLAB
3,856
99
function findOutlierInZscoreResp(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM; %% Grab Monoc ...
cbcc42b0b5a9fa22d66ed9c35768f85d793fc17d6cb3ce8ed3739174a585f8f0
MATLAB
3,860
152
% Integrate Dynamics % Nair et al., 2021, Aditya Nair function [output] = integrate_dynamics_revised_cla(W, params, x0,It, input_c) %It = linspace(0,params.tfinal, params.n_timepoints); %input_c = input_C(x0,It); [output.t, X] = ode45(@rate_dynamics_ode, ... linspace(0, params.tfi...
169507187d2b23671b3afa5f68d49aaa2411df20fb2d94b68f4cf5cd38c16575
MATLAB
3,869
177
%this is just an example of how to use the matlab functions clc clear all; %cd C:\MATLAB6p1\work\ethernetStandAlone %tesitning is concted function 'tesitning is AO_IsConnected function'; ret=AO_IsConnected; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Connect %%%%%%%%%%%%%%%%%%%%%...
33025d9d22395a16d1af57c15f4c98bc5271d449e6594a249fb93a888634e970
MATLAB
3,871
121
function s_comp = set(s_comp,varargin) % SET Set Sig_comp properties and return the updated object % Property names are: % Input_method, Static_value, Value_formula, Static_reps, Reps_formula, % Seq_values, Seq_values_str, Coord_index, Index_formula, Wrap, Sweep. global INPUT_METHODS; INPUT_METHODS={'STATIC_VALUE','SW...
320eecef4c3459a5b57b5f1e81dc12634e3e54a9e07174f145b9fb9857a21bc5
MATLAB
3,874
109
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <remLV: removes unwanted signals from large vessels or CSF > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Fre...
6599b3796bc5080c3ca17a4711fef9f6f811cc8ce509490e3b991588d96a67eb
MATLAB
3,877
99
function gramm_dCOS_line_testMedian(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM; %% Grab Mon...
57c745bc0e63e1d56c6806d8be58e72369ce2b7a195a03b6ad2c1f1830f28d1f
MATLAB
3,878
103
function s_comp = Sig_comp(varargin) % Sig_comp class constructor. % s=Sig_comp(STATIC_VALUE) creates a Sig_comp object which represents a % Signal component. % Sig_comp is the base class of all numerical signal components (Level_comp, Freq_comp ...etc) % and static value is the value of the Signal component ...
8b825ea55bff9dbb47d210ada1cc7cfbf2533c4cf6aa62f856bb7be886896fd0
MATLAB
3,881
79
function [Angles, TurnAngles, Length, AlignedLength,Branches] = Angle(name) %creates function called Angle that can be called on in other scripts with outputs: Angles, TurnAngles; Input: name newname = [name '.txt']; %adds .txt to name to create complete file name [DataX,DataY] ...
de943f2ada03bc7e478a5508d6c3919645586ff79fdbd4db2fdd8b617fda43c9
MATLAB
3,881
100
function [db2Power, in1CntrIdx] = NS_FourierPowerHann(db1Trace, inSampleRate, varargin) %[DB2POWER, IN1CNTRIDX] = NS_FourierPower(DB1TRACE, INSAMPLERATE, %[DBWINLENSEC, INNSTEP, BLDOPLOT]) computes the spectral power of DB1TRACE %over time. DB1TRACE is divided into segments whose length is specified by %DBWINLENSEC...
2beb062a6775942ad36e675c2aa5bbc568c81c6fdf6ddbdfb710126b6eeb97e4
MATLAB
3,882
68
% Changed by AlexKaz on 110520 to create the 32x1 linear channel map for the Deuteron system function createChannelMapFile_16x2_Cambridge_NeuroTech_new_layout() PIN_LAYOUT_TYPE = 'old'; % {'old', 'new'} Nchannels = 32; connected = true(Nchannels, 1); layout_dir = 'C:\Users\Owner\Desktop\global_integ...
f1a4c8dac1e30bfcf1af8c038c598b0084e1f8c8d1fa3030df06634fc5ccf8a2
MATLAB
3,885
112
classdef AdjMatrix < handle %AdjMatrix % Class to handle adjacency matrices with labels properties (SetAccess = private) Adj double MetaData struct Emb Embedding end properties (Dependent,SetAccess = private) Contacts double ROI cell end ...
7338f2e5d2aa535f47537c5cbf518588cbf597d750625974882d60e8352d5ee4
MATLAB
3,894
102
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <resampleEndtidalBreathing: resampled breathing data to the time-step defined by TR > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as pu...
2df4936a7f4fc20d9a25e1522606b0f7f5a509b9b8581dc1daa39791fb9d9bb7
MATLAB
3,904
116
% MIBI smooth stitching script used by the all channel stitch loop % Author: Dmitry Tebaykin % Contact: dmitry.tebaykin@stanford.edu % if exist(xmlFileName, 'file') % textXML = fileread(xmlFileName); % paramNames= {'XAttrib', 'YAttrib'}; % pointsLoc = zeros(0,2); % for i=1:length(paramNames) % patt...
27be87a7f80d5795117acfa16135f60c52e7047578a298e5c2fb9b745c98953d
MATLAB
3,924
44
function SUBJECT = ASLPrepareASLDataDICOM(SUBJECT, filename, prefix , fast) % ClinicalASL toolbox 2023, JCWSiero % Prepare (multidelay) ASL data: interleave control and label files per PLD, M0 and perform Look Locker Correction DATA = double(niftiread([SUBJECT.NIFTIdir filename])); DIMS = size(DATA); SUBJECT.(...
0a2affd1b895cb204f646b00cc9a90ad07a8805c7e23b59e38ce97116e1a34eb
MATLAB
3,927
42
function SUBJECT = ASLPrepareASLDataPARREC(SUBJECT, filename, prefix) % ClinicalASL toolbox 2023, JCWSiero % Prepare (multidelay) ASL data: interleave control and label files per PLD, M0 and perform Look Locker Correction DATA = double(niftiread([SUBJECT.NIFTIdir filename(1,:)])); % read in first PLD NIFTI for DIM...
ccffc238db66c632990ce661c4ccfa775d535f01ae4bf7d282e9906e1d2a2e95
MATLAB
3,929
145
function [dataPC,pc2un,varnrm] = tdrPca(data,pcapars,plotflag) % tdrPca Principal components analysis of population responses % % Inputs: % data: population response (simultaneous, see 'help tdr') % pcapars.trial_pca: trials/conditions to compute PCs % pcapars.trial_prj: trials/conditions to project onto PCs % pcap...
e0575488f34befc9150dd7a629f38ff6f4bdb0285910896340463bdec7516b43
MATLAB
3,932
110
function [options, remaining_arguments] = getOptions(options, varargin) %GETOPTIONS Get options from variable length arguments. % % options = getOptions(options, 'option1', value1, 'option2', value2, ...); % [options, remaining_arguments] = getOptions(options, ...); % % GETOPTIONS parses variable length arguments...
e807923a89309f158d01aa47fe6198de8504002c075d351c00b7e1161fd4d195
MATLAB
3,941
106
clear all; close all; clc %% Parameter Settings %%%% Setup main directory which hosts /Data, /resources/, and /partialbrain_preprocessing_pipeline2020_nx folders cd ../ dirhead=pwd; % %% install spm12 under the Matlab home folder following % %% https://en.wikibooks.org/wiki/SPM/Installation_on_Windows#Preamble addpat...
c74363a65883aa5934c172d605658341ab55ecc5aec75ca8ed2a197df406a214
MATLAB
3,954
87
function generatePanels_FigS4_rev(FigS4) %% Constants p10Maps(1,:)=FigS4.constants.colormap(3,:); p10Maps(2,:)=FigS4.constants.colormap(2,:); p10Maps(3,:)=FigS4.constants.colormap(1,:); p10_ArousalStates=fieldnames(FigS4.P10.Histograms); p15_ArousalStates=fieldnames(FigS4.P15.Histograms); p15Maps(1,:)=FigS4.co...
3719423b1324c09fb7a493f69e045586cad4abd02a7b12ef931b69b5f1c1db11
MATLAB
3,963
109
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <chopTimeseres: shortens timeseries data to within a specified epoch > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by ...
8d8042509d414d23b4c0e362e03db1217c114b5c4f046bb882cdda9c9494c3f7
MATLAB
3,969
102
%% LaBGAS_extract_pmods_phenotype_trial_tsv.m % % This script will extract symptom ratings as parametric modulators % from the phenotype_trial.tsv file for each condition of the emosymp study % % DEPENDENCIES % BIDS data organization % % INPUTS % phenotype_trial.tsv file % % OUTPUT % noise_regs & onsets files that ...
9c966347f96ed8c58a2227137c670997f75a9b6031664305858d6518417cd561
MATLAB
4,003
119
%% % This code runs multiple examples of the spatial network used in Handy % and Borisyuk, 2023 % % The examples show the default network (no astrocyte ensheathmenth) and % one example of the network with astrocyte ensheathment. Similar to Fig 6 % in the main text % % Important notes: % The examples are run in parall...
bb16ff857e5d211419ad23e451ee84d5aabcf4ba841451378fb16cd8989f5281
MATLAB
4,015
144
function [minPos,fmin] = polyinterp(points,doPlot,xminBound,xmaxBound) % function [minPos] = polyinterp(points,doPlot,xminBound,xmaxBound) % % Minimum of interpolating polynomial based on function and derivative % values % % It can also be used for extrapolation if {xmin,xmax} are outside % the domain of the po...
18692f70f454b4e5b1efb0c10a73ec4deec19690ca8f41b593372b9ffbe11675
MATLAB
4,021
147
%% significance of distance clear; clc; %%%% distance in subspace %%% %load data load('permutation_A.mat'); perm_a = sdata; load('permutation_B.mat'); perm_b = sdata; % null distance = struct('A',[],'B',[]); distance.A = struct('high',[],'low',[]); distance.B = struct('high',[],'low',[]); for r = 1:1000 %samples ...
d20e74643afda5d3c9321c5800bda3b17540bf332a378a756230391c20614f2e
MATLAB
4,021
147
%% MIRO Demo % Demo file to demonstrate MIRO processing workflow. You can modify this % code and use with your own data. %% Load Data % Paths FilePath_calibration = '.\Calibration_files\'; FilePath_data = '.\Raw_data\'; SavePath = '.\Results\'; % Load calibration data load([FilePath_calibration, 'sCMOS_calibration....
2e84c5abcf71581a320e3e6ac6073272690a3bef56d68c65f2e54120e447689a
MATLAB
4,024
119
% F-value time-frequency analysis % 'F' is F-values of data. % 'F' will be a 3D shape (channels * time * frequency) % 'TF' is time-frequency spectra of data. % 'TF' will be a 5D shape (channels * time * frequency * trials * events) % 'data' should be a 4D shape (channels * time * trials * events) % 'sf' is a sa...
bc45966de3b6a131fc637f9b0804775863a05803c35876a144cdcde6a6faf096
MATLAB
4,025
77
function [similarity,similarity_shuffle] = neuronal_similarity_session(calcium_data,calcium_time,calcium_fps,behav_data,behav_time,behav_fps,min_behav_duration,type_str) % This function calculates the similarity in average neuronal activation % for each behavior. Uses Eucliden distance or dot product between first % ...
1deae41714c80900aa785677f750de5a533d070d160c8141b24654c08e0edc03
MATLAB
4,029
120
function errorflag=mAO_populate(lastflag) global mAO errorflag=0; SWTRIG=zeros(length(mAO.TRIGChannels),1); while mAO.TRIGind(1)<2 for ic=1:length(mAO.TRIGChannels) [Result,SWTRIG(ic)]=MexFileEthernetStandAlone(24,mAO.TRIGChannels(ic),mAO.TRIGdata{ic}); end for ic=1:length(mAO.TRIGChannels) ...
90669853b384d93651166aa52f3225dbc2894ace8b36d4848b9261469fcf7550
MATLAB
4,033
83
function [pairwise_table] = GeneratePairwiseSpreadsheet(T,sensor_feats,clin_vars,time_diff_range) % 'T' is the table of demographic data and feature data % 'sensor_feats' contains a cell array of feature names for modeling % 'clin_vars' contains a cell array of pertinent contextual variables: diagnosis, se...
9f1384427cc3874f34d4f7ae38c34624de3f06caf76f255bebef109a017693e7
MATLAB
4,034
66
%DISCO High contrast colormap with strong gradient discontinuities % % Examples: % map = disco; % map = disco(len); % B = disco(A); % B = disco(A, lims); % % A colormap designed to highlight contours. It has strong gradient % discontinuities, and maximizes the range of colors used in order to % imp...
84d0285cb2ef1eab4ba43beebaa23ddd57d2bfd6d9eaab216a57967dab18dd8c
MATLAB
4,050
102
function generatePanels_Fig03(Fig03) %% Pre-Whitened Resting state HbT power spectrum Age=fieldnames(Fig03.data); reorder=[2,3,4,5,6,1]; figure(30); subplot(2,3,5); hold on for AgeNum=1:length(Age) plot(Fig03.data.(Age{reorder(AgeNum)}).FrequencyLow(:,1),(10*log10(Fig03.data.(Age{reorder(AgeNum)}).AveragedDa...
4a0f5ee0acfdb1c037e4dff539a106afd104e72b14bb22c9c1c2cba622daef78
MATLAB
4,052
79
function [t_sim_times, cam_inds] = make_ind_ars_for_triggers(t_behavior, t_sound, t_camera, t_state) % Function make_ind_ars_for_triggers sub-samples the 30FPS frame stream to 10FPS sequence, that is % found to be empirically optimal for both replay and compactness of data representation and storage. % The function f...
50e65d764beb1413d6843f727d0515d36f9f2e95312b24257004bac5c7f07f94
MATLAB
4,052
146
function q_probs = est_q(Z, N_st, probs) %------------------------------------------------------------------------------------------------- % PURPOSE: estimate mismatched probability distribution q from the original probability distribution p % % INPUTS: % p_past: probability distribution of past state (X^t-tau) % ...
ec8953368d1f36019b60166bc2331a8386782f163e78034eb2bf7636041ca8eb
MATLAB
4,065
104
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <import_EndTidal: imports GEN4 RespirAct data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software F...
2d7f122be52e16e5234cad4180736e6fe6cab09f596ba6765dcbfde02177dd08
MATLAB
4,080
133
function expdata = prepare_session_folders(data_folder, rat_num) % JN 2020-04-24 fname = fullfile(data_folder, 'rat_sessions.csv'); table_rat_sessions = readtable(fname); idx = (table_rat_sessions.DoProcess == 1) & ... (table_rat_sessions.Rat == rat_num); rat_table = table_rat_sessions(idx, :); if ~any(idx) ...
7b4d1e1175d33065b0cc312d0b50002518a141f22022b060a2d7c48fcbf3a213
MATLAB
4,083
120
%% Plot mean trace of all trials % The script was used to generate Figure 1B in manuscript % "Brain rhythms control microglial response and cytokine expression via NFκB signaling" % Plots are generated in a new folder named 'plots' in the parent directory %% Dependency: % 1. 'Statistics and Machine Learning T...
fa86f35f7245dfc8eb18ead8c73a3f5be81f240bf65ba928018b3aae2596ad19
MATLAB
4,085
66
%DISPARITY High contrast colormap with subtle gradient discontinuities % % Examples: % map = disparity; % map = disparity(len); % B = disparity(A); % B = disparity(A, lims); % % A colormap designed for depth and disparity maps. It has subtle gradient % discontinuities to bring out contours, and maximi...
a9f444a5740b9ac77b294ee319b8c76d7ae5a3cbbf16963254f9e2ba8c1eda48
MATLAB
4,097
99
function [similarity_map_neuron,similarity_map_behav,corr_coeff,corr_pval] = neuronal_behavioral_similarity_session(calcium_data,calcium_time,calcium_fps,... behav_data,behav_time,behav_fps,... behav_distrib_feat,min...
d824abe21c2d192e056f8a552c385d4458dc27ec4d70e47fd4990547723997ee
MATLAB
4,097
185
function fb_plot_allpxs(MOV_DATA,MIC_DATA,FRAME_IDX,varargin) %fb_plot_allpxs uses the center of mass (df/f here) (COM) across time to define % a color, and the opacity is dictated by the max df/f % % fb_plot_allpxs(MOV_DATA,MIC_DATA,FRAME_IDX,varargin) % % MOV_DATA % % MIC_DATA % % FRAME_IDX % % the following may be p...
d4eecaaa4728ebed4501b305ae5b8a8d5b5f9808a0b2fae07b29fc468603288b
MATLAB
4,110
199
function FS_BatchDff(DIR, varargin) %run thorough directory and make Background Subtracted Movies in AVI format % This Script is for 'unprocessed' videos % WALIII % For unprocessed videos % 09.05.15 %% Default Paramaters: filt_rad=10; % gauss filter radius filt_alpha=10; % gauss filter alpha lims=3; % contrast prct...
99e1f30cf48066ce9c6c5f3dc38039aa3e79520fd8a85c335e3d48610569f101
MATLAB
4,129
131
function sampled_points=generate_signal(handles,trial_index) % GENERATE_SIGNAL generates the sample points of the Signal. % SAMP_RATE=GENERATE_SIGNAL(SIG,SAMP_RATE,PARAMS) generates the sample % points of the given Signal. The number of points is determined by the % given samp_rate. % params is a collumn vector that h...
4de79f7277396a9be6dea0dc115444c875f7aa40d2b1f80f54b88535bae90f23
MATLAB
4,148
102
%% stimuli sensitive units (5a-d) load(fullfile('..','data','auditory_units.mat')); unitnum = [16,2,5,2]; sounds = [10,1,5,1]; ylimsize = [2,10,8,10]; xlimsize = [1500,2500,1000,1000]; t = linspace(0,2500,192000*2.5); figure('Position',[100,100,1500,800]); loc = [3,4,2,1]; for day = 1:4 tsounds = data(loc(day)).sou...
e96890a98ce85725e160af5b6963f7c6e9d36a0d9ec150e705149676a083906d
MATLAB
4,154
115
classdef BinCodeGenerator < handle % BinCodeGenerator can create binary code from (7-bit ASCII) char arrays. % The binary code can then be sent to a sound card for asynchronous % communication. % Each char is represented by its binary ASCII code. It is framed by a % start bit (1) and a stopbit (0). ...
e6e4c421455e4bee4fb9eb6fd92a89eb708273fc67fa50c443372659b88f4a9a
MATLAB
4,157
117
%% % This code provides a demo for the spiking simulation and mean field % theory for Kumar et al., 2023 % % The spiking simulation uses mex code and a par-for loop % The simulations run for 2 seconds (of simulation time), which is shorter % than the default 5 second, but finishes faster (~30 seconds depending on % c...
dd1f9e21639e128097c441079db66ba6ece0cf8af94092d782fcd7eeb2853c35
MATLAB
4,159
131
function generatePanels_FigS1(FigS1) %% Constants MUA_Time=((1:length(FigS1.SingleAnimal.P10.MUA))/20000)-1; LineFormat.Color = [0 0 0]; LineFormat.LineWidth = 0.5; LineFormat.LineStyle = '-'; lineColors=FigS1.Constants.colormaps([3,6,9,12],:); %% Plot Single Animal P10 example figure(501);subplot(3,1,1); ...
09041669466575fb82d23b29128ed18541c207c2740f9f19257fce99162e3e3c
MATLAB
4,162
118
%Function for CEEMDAN %WARNING: for this code works it is necessary to include in the same %directoy the file emd.m developed by Rilling and Flandrin. %This file is available at %http://perso.ens-lyon.fr/patrick.flandrin/emd.html %We use the default stopping criterion. %We use the last modification: 3.2007 % ...
dbd48d53fd87de16ab4d8b8b101ff8e070f963790efd60ae095ce0ff7448e1a8
MATLAB
4,171
93
function c = nanconvn(a, k, varargin) %Full credit to Benjamin Kraus for making this code. This implementation in N dimensions simply %extends the Matlab Exchange entry https://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv % NANCONVN Convolution in ND ignoring NaNs. % C = NANCONVN(A, K) convolves...
170e09bae448b45988532dfde43667989140d949a98b99f4b548c40018317ab0
MATLAB
4,179
101
function [indexChans] = goodChannelIndices(dataTable,hemisphere,completeChannelSet,printDebug) %goodChannelIndices Considers bad channels and hemisphere/cross-set options % This function also creates correct channel ordering for patients with % specified "contact" IDs rather than channels % Options: % - he...
20c24f7506e4dad3fb3689ed9053f3eeb2ff9df812a841111f97e1f0b975f9a2
MATLAB
4,188
89
% Always run this first before you run other scripts. % % NOTES: % - standard folders and variable names are created by these scripts % % - in "prep_" scripts: % image names, conditions, contrasts, colors, global gray/white/CSF % values are saved automatically in a DAT structure % % - extracted fmri_data objects ...
658cef7d7f324bcba033bdb9efc233ad3ff4babe9961c3269676c9fe4b3728af
MATLAB
4,198
89
% Always run this first before you run other scripts. % % NOTES: % - standard folders and variable names are created by these scripts % % - in "prep_" scripts: % image names, conditions, contrasts, colors, global gray/white/CSF % values are saved automatically in a DAT structure % % - extracted fmri_data objects ...
869f86ee3195d1b1e42393368de81e53b441d157046eaf6d79407019d92b1774
MATLAB
4,198
121
function [ctxidx, hpidx] = poolcells_acrossep(animaldir, animalprefix, day, eps,exclude_list) %% tetinfo = loaddatastruct(animaldir, animalprefix, 'tetinfo'); cell = loaddatastruct(animaldir,animalprefix,'cellinfo'); spks = loaddatastruct(animaldir, animalprefix, 'spikes', day); % get spikes %% for ep = eps % ge...
f33e5f44d57ad33ef26fb0e2e1e731a78708b9be6d61e3b4d0d49622f7f4730b
MATLAB
4,213
107
function shearletIdxs = SLgetShearletIdxs2D(shearLevels,full,varargin) %SLgetShearletIdxs2D Compute a index set describing a 2D shearlet system. % % Usage: % % shearletIdxs = SLgetShearletIdxs2D(shearLevels) % shearletIdxs = SLgetShearletIdxs2D(shearLevels, full) % shearletIdxs = SLgetShearletIdxs2D(shearLe...
f4e031ebb7eea3ad493387e09cf6f78f4ef2886d5c62e13c862e84f54a58ffb8
MATLAB
4,213
40
function SUBJECT = ASLSaveResultsCBFAAT(SUBJECT, prefix, ORprefix) % ClinicalASL toolbox 2023, JCWSiero % save BASIl results: NIFTI and PNG - loops over smoothed BASIl data % load BASIL output data : %% CBF Arrival transit time (AAT), aCBV, arterial transit artefact (ATA) for spatial COV computation, allPLD for anot...
10c480190a5506e5aca577700c2477d8f74ab5201dab4f48af463f22ba402bcb
MATLAB
4,244
139
function robot_calibration(soundOn) global vars delete(instrfind); delete(timerfindall); if(nargin < 1) vars.soundOn = false; else vars.soundOn = soundOn; end if(soundOn) vars.tcp = tcpip('132.64.61.88', 80, 'NetworkRole', 'client'); try fopen(var...
257b3de5098178eb01492926f69bb95a463c39a0c992b3bfd0ffe19b9dbf469c
MATLAB
4,261
135
%% First Step: FPN correction disp('FPN correction...'); tic; for i = 1:n_frames [fpn(:,:,i),Bias(i),Scale(i)] = MIRO_FPN_correction(im(:,:,i),Parameters); end toc; %% Second Step: microlocal image processing % Frequency Re-Weighting & Shearlet Thresholding tic; [a, fpn, ka, SNRa, Parameters] = MIRO_Spectral_weig...
2485ee095c3dc5ae143d9dc146a34abadd20cef197c25afa20da0b569725516c
MATLAB
4,290
119
%---------------------------------------------------------------% % This is the script for calculating trajectory selectiviy % % indices for all cells -- Wenbo Tang (Jan 06, 2023) % %---------------------------------------------------------------% clc clear all close all %% animalprefix_list = {'AM2','J...
18d44dde92018c1fa0bb2ea5c22a5b5e32c6585c49f79fcb2d39b45e97708f36
MATLAB
4,350
192
function IDX = laminarLabeling_LFP %% For each session - format the LFP (ch x time x trls) % This needs to be trial-wise bl corrected % Do NOT trial avg. % Keep all stimulus presentations (no condition selection at all) % Make sure stimulus was on screen for 500ms. %% load session data global STIMDIR cd(STIMDIR) ...
17eb1190eb7e5af1ae8e336cf9245ec78aa63e6db5b4c78dd4807aa4c1262d9c
MATLAB
4,357
138
classdef LogbookEvaluator < handle %LOGBOOKEVALUATOR extracts data from a LogBook of a behavioral experiment. % Arguments: % logbook - event log of a LogBook instance. % % Evaluation of data from a behavioral experiment starts in this class. % It extracts trials, sham trials, and other AudioObjects from an even...
74dc5454ee4f25cf243e4a48d509cea9a7653c43d91192a78575586b779025f1
MATLAB
4,361
169
S = load(fullfile('..', 'data', 'zone_angles.mat')); zones = S.zones; clustering_data = load(fullfile('..', 'data', 'running_trajectories.mat')); do_sub = ones(1, 6); data = [[2019 10 22 4 4.5]; [2019 10 23 4 20]]; pinfo = array2table(data, 'VariableNames', ... {'Year', 'Month', 'Day', 'Rat', 'StartMinute'}); ...
0ce62cb7226ae8068c1ec26376f7c0c49899aa1807b2794e8160a29d975ef2f8
MATLAB
4,366
107
%Author: Tatjana Schmitt, 2019-2022 function [radial_vectors_fitted, borders] = fitting_BF_vectors(stats, idx_vectors, ... radial_vectors_BF, radial_vectors_mean_BF_smoothed) % fits BF course of vectors, calculates turning points, sets borders and % calculates edges of auditory cortex %% initialize variables...
35b49455989098d1cb820ad5803e6fedcc24ed32eb761459800d37b1fb230829
MATLAB
4,375
119
function [TTL, CD] = DT_parse_deutoron_autologs(folder) % JN 2020-04-15 files = dir(fullfile(folder, 'AutoLOG_*.txt')); % JN 2020-05-08 if isempty(files) error("No deuteron AutoLOG files found in %s", folder) end n_files = length(files); all_ttl_tables = cell(n_files, 1); all_cd_tables = cell(n_files, 1); for...
623354bf0946c427e41eb55b45aae5884014d91ca11e6ba0929dcacdb2e3e7c9
MATLAB
4,386
116
function runExperimentSession(kind, configurationFile) %RUNEXPERIMENTSESSION opens a GUI to run a detection experiment session. % Arguments: % kind - a string identifying the kind of experiment: % 'gap' - simple gap detection experiment [default] % 'tone' - a simple tone detection experiment % 'la...
32612c4c3a79381caa278b9ca951b384525e34af06d53c51c44c82040c36d21f
MATLAB
4,388
124
function plotsingleEvent_Fig04(Fig04) %% READ ME %This function plots the data generated by the single trial loaded in %'filname' and includes, behavior, EMG, HbT and LFP %Subscripts: brewermap %% Filter for EMG [z,p,k]=butter(3,[300 5000]/(0.5*Fig04.constants.an_fs),'bandpass'); [sos_EMG,g_EMG]=zp2sos(z,p,k); ...
8d237e0feb2bbce189c5d946d9da74fa2c29ac31a1b5bca524a19272cf35e003
MATLAB
4,397
115
function [ directionalFilter,scalingFilter,waveletFilter,scalingFilter2,shearLevels ] = MIRO_SLcheckFilterSizes(rows,cols,shearLevels,directionalFilter,scalingFilter,waveletFilter,scalingFilter2) %% Check filter sizes %% configuration 1 filterSetup{1}.directionalFilter = directionalFilter; filterSetup{1}.scalingFilter...
2ee89c152860bab4ace3625f64ab238e67acac592991d3bfb7c7ccdfbe5b543b
MATLAB
4,399
80
function [clean_env_t, erased_env_t] = align_beh_snr_trigs(snr_t_orig, beh_t_orig) % Function align_beh_snr_trigs aligns the triggers from SNR and behavioral system. % The behavioral triggers are derived from a single .csv file, of one of the three environments. % % Assumptions: % 1. Every SNR tri...
7db3c2712eff9f0478109fa969433cb684ac6b12df438d25daacf1eeee78c195
MATLAB
4,404
218
function [ROI STATS]=FS_image_ROI(IMAGE,varargin) % FS_image_ROI.m % FS_Image_ROI takes in image, and allows user ot selet ROIs, outputs a file to % run through and extract ROIS frim data. % Created: 2015/08/02 % By: WALIII % Updated: 2015/11/18 % By: WALIII % select file to load nparams=length(varargin); ...
d05988d49eec8aed6f9e2a5b949bd20badc8895ee77fff908cf3400accf39793
MATLAB
4,407
151
function [coef_fix,coef_nrm,average_time] = tdrVectorTimeAverage(coef_time,vecpars,plotflag) % tdrVectorTimeAverage Define fixed regression vectors by time averaging coefficients % % Inputs: % coef_time: regression coefficients % .name: regressor names [nvc 1] % .response: coefficients [nun npt nvc] % .ti...
6e71293fc4805379ae372be0501bd154eb75c8a8e242ea80a9b01d779206d19d
MATLAB
4,408
195
%% Clocking the denoising frame = imread('background_dark.tiff'); disp('uint8(filter2(fspecial("average", 3), frame))'); tic; for i = 1:100 % One operation takes 12.7 mSec a = uint8(filter2(fspecial('average', 3), frame)); end toc disp('wiener2(frame, [3 3]);'); tic; for i = 1:100 % Oneoperation takes 61...
ba1112585d80a26cbda7b3955a13ad94522b19c00c6bed1a786dd4960f3ceeac
MATLAB
4,438
118
%% % Creates a spatial network of neurons, using the design by % Rosenbaum et al., 2017 %% function [Wex1, Wex2, Wix1, Wix2,target_neuron, firing_neuron,... id_start_firing, synapse_num_default,synapse_type]=... create_spatial_network(Ne1, Kee, betaee, Kie, betaie,... ...
97afdf0dfb776892588a9f25cd91410bb935b7bb34553e406a53bbe2df2b8131
MATLAB
4,451
104
function [accuracy_training,accuracy_test,accuracy_shuffle,p_value,Model] = decoding_CCGP_linearSVM_simple(dat_all,figopt) %---------------------------------------------------------------% % This is the function for cross-condition generalization % performance using linear decoder (linear SVMs) % % -- ...
18514d99875f9f72c4bb9d6aad4c22bd65a8eb988962b70b7aa990f01d9bda82
MATLAB
4,463
117
function [group_step1 group_step2 group_step3 thresh] = micca_clustering(data, data_corr, indx_sample, threshold) % % [group_step1 group_step2 group_step3 thresh] = micca_clustering(data, data_corr, indx_sample, threshold) % % clustering method % N = length(unique(indx_sample)); if nargin < 4 %% automatic threshol...
2b63f541a7744e593b54909797bf2cd3923f33fd1d1d78ed4da0c6394102b6fb
MATLAB
4,470
121
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % sections of this code were contributed by Jeroen Siero, j.c.w.siero@umcutrecht.nl % <smthData: smoothes input images using a gaussian kernel > % % This program is free software: you can redistribute it and/or modify % it...
adbbd73e5e1bef0c0a903a7ba55eadb7f887fce3eb370220d670292b0a0d2673
MATLAB
4,484
160
function STIM = findAllTrials(Date,e) %% TuneList setup %load everything in from TuneList TuneList = importTuneList(2); % % case {1,'all di tasks','dionly','ditasks'} % % ditasks = {'cosinteroc','mcosinteroc','dmcosinteroc','brfs','dbrfs', 'rsvp'}; % % % % case {2,'brfs','Brock'} % Brock % % dita...
902d4783d4df3970288b571b30fc6d0ca7d17b8049240201209d02b43b1388e2
MATLAB
4,500
133
%% % This code runs multiple examples of the non-spatial network used in Handy % and Borisyuk, 2023 with two feedforward input % % The examples show the default network (no astrocyte ensheathmenth) and % one examples of the network with astrocyte ensheathment. Similar to Fig 5 % in the main text % % Important notes: % ...
775135e62d1eaa0816739e1f617a95d5607c03c639f0e9de2a23f532ef41367d
MATLAB
4,513
166
function hdr = load_nifti(niftifile,hdronly) % hdr = load_nifti(niftifile,hdronly) % % Loads nifti header and volume. The volume is stored % in hdr.vol. Columns and rows are not swapped. % % Handles compressed nifti (nii.gz) by issuing a unix command to % uncompress the file to a temporary file, which is then deleted. ...
459237917f784912a762502f12f3cfe4690829fc04918c8f057e69e68af5ba63
MATLAB
4,535
129
classdef GapStimulusSampleFactory < AudioObjectSampleFactory %GAPSTIMULUSSAMPLEFACTORY creates gaps in continuous background sound. % This class is an AudioObjectSampleFactory that inserts gaps in a % continuous background sound (e. g. white noise). % Attention: The gate duration may be at most as long as the sho...
a99c77335ca81497d8d9c70cb9e51e4a629d3d9c684d6a46120214c1c6239c5e
MATLAB
4,535
127
%--- Script generating figure 3b --- %% Initializes everything clear, close all run StartupAnalysis rng(1949) %% Sets Figure parameters % db1FigSize = [100 100 1600 900]; db1FigSize = [50 50 1200 600]; iFig = 0; hFIG = []; chOutDir = 'C:\Users\perre\Cardin-Higley Lab Dropbox\Quentin Perrenoud\PerrenoudCardin_F...
844ba69938250bccd3a7aa2ded1aa28d73559ea187f3f7958602ce5d0de344ae
MATLAB
4,537
108
function perm_id = rotate_parcellation_lh(coord_l, nrot) % % Usage: % perm_id = rotate_parcellation(coord_l, nrot) % % Description: % Rotate parcellation (authors: @frantisekvasa, @saratheriver) % % Inputs: % coord_l (double array) - Coordinates of left hemisphere regions on the sphere, size = [m x 3] %...
ff344590d33f6a148373f1ccb0db69da8384b804c83964729cd8626f6f76cb1b
MATLAB
4,540
126
%% % Analyze and plot the official results of the DiRT simulations (reproduces % Fig 1) % % Loading DiRT_Results adds three items to the workspace: % 1) DiRT_results: # time points x 2 x # trials x # phi values % The first column contains the time vectors, while the second % contains the number of activa...
65a04cac74db584fdee089cd9c06b99bbbdc1735f3581f3dc96356ef647ce77f
MATLAB
4,554
130
%--- Script generating figure S5 --- %% Initializes everything clear, close all run StartupAnalysis rng(1949) %% Sets Figure parameters % db1FigSize = [100 100 1600 900]; db1FigSize = [50 50 1200 600]; iFig = 0; hFIG = []; chOutDir = 'C:\Users\perre\Cardin-Higley Lab Dropbox\Quentin Perrenoud\PerrenoudCardin_F...
9f43371843b6dd3aa7e4b0fc6d006d6e876ab0678867387b11b9b20960bbde6d
MATLAB
4,557
126
classdef FileStatsAccumulator < handle %FILESTATSACCUMULATOR accumulates session stats from saved experimental %data. % Author: Lasse Osterhagen properties (SetAccess = private) % Higher false alarm rates will let the session to be excluded falseAlarmRejectionRate = 0.2; % Session will be excluded if valu...