sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1f5a6cd7c3ddc99a914b12777c7f759d1237f3da90f93a544a2aef83d87bf5d9
MATLAB
4,567
86
function [similarity,similarity_shuffle,similarity_neighbor] = neuronal_similarity_longitudinal(calcium_data_1,calcium_time_1,... calcium_data_2,calcium_time_2,long_reg,... centroid_location_1, centroid_location_2,ca...
fc0d2fcbb48f2d434c380942f2e0b7024a852f45e1ea043108970228bd44c684
MATLAB
4,577
115
%--- Script generating figure 2 --- %% 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...
28c0d858f5af7f4605b13f4712145846e59c14f88f5ea7b4d664f2566438286d
MATLAB
4,584
109
%% This scripts runs the spin-test for the correlation between the age-effects on cortical thickness and MEG levels % Based on the toolbox by Alexander-Bloch et al., 2018: https://doi.org/10.1016/j.neuroimage.2018.05.070 % % Step 1: % Load the statistical map for the age effects on cortical thickness (here t-stats for...
8240f6efc63577b3e48e6f8e5a1445d6fc0528f96d922bb803bfb33abdfdcac5
MATLAB
4,606
137
%This script can be used to analyze voltage clamp traces containing sEPSC. % WRITTEN BY: Nina Doorn (11-07-2022) %It will return a matrix with every row one of the cells/traces you %analyzed, and the columns: % -number of the run % -average sEPSC amplitude % -sEPSC frequency % -The threshold used for event detection %...
f1462e60f7b266b80b64876901745efb8a601792aa5cd962f8339ffe91ec7cdd
MATLAB
4,609
125
%% Plot mean PSA of all trials % The script was used to generate Figure 1C 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 % Dependencies % 1. 'Statistics and Machine Learning Too...
4402ec24b16788df1ded5ae854124224928ac3e6f6690f556bf36a5d6a66376d
MATLAB
4,627
180
function [analysis params] = SDT_MLE_fit(nR_S1, nR_S2) % [analysis params] = SDT_MLE_fit(nR_S1, nR_S2) % % Find a maximum-likelihood fit of the unequal variance signal detection % theory model to the input data. % % INPUTS % % * nR_S1, nR_S2 % these are vectors containing the total number of responses in ...
f3499bdcc18cc76efdbde0e9b61cf9c723063d7931531a4622c8b5b093709c2b
MATLAB
4,637
114
%% LaBGAS_create_single_trial_fmri_data_st_obj % % This script creates an fmri_data_st object from the single trial con % images written in rootdir\secondlevel\model_x_yyy\data\sub-zz by % LaBGAS_copy_single_trial_con_imgs_CANlab_folder_struct.m and adds a % convenient metadata_table field containing % 1. single trial ...
99d68210fc6a9a2f5a43bd2ac3b350e37063d987c7558314aa3a7e5ec0145cdd
MATLAB
4,638
116
function FR_sim_Network(load_file, I0, w0, w_max, save_file, w1_range) load(load_file, "P", "D", "M", "s", "Env_track", "final_weight", "phase", "N") % load the weight matrix and necesarry inf [tau, d_t, err, check_dynamic, plot_mean, activation_all, tracker, max_step] = FR_sim_setup(); ...
7d589293c01a5d83902a999e25f0b72b84093b44292718c3caa2670071865f5f
MATLAB
4,649
104
function [bestpmFits, EE] = applyNIModelling(obj, modelName, numRepeats, modelPar, initialGuess, jitter, freeParams) %% applyNIModelling % as if for now, this is a seperated code, but eventually this will be % intergrated in applymodelling in the dataModelling object. % Needs a urgency signal and reflectingbound i...
3c53040d83187f21b880b25e7777f9229a5074f39abdf8f58524d5c0e43e84f8
MATLAB
4,661
151
%% Study 1 EEG %% Patient List patientList = {'201','202','203','205','206','208','209','210','211','213','214','215','216','218','219','220','222','223','226','228','229','230','231','232','233','234','235','236','238','239','240','241','243','244','246','247'}; dataDir = 'C:\Users\\OWNER\\Dropbox\\Berkeley post...
2396c2a4938a10181e45931abc70367e0d94144020202f4893c93c062f8fd584
MATLAB
4,670
138
% Script modified from Reference: % Christopher Fietkiewicz and Kenneth A. Loparo, �Analysis and Enhancements of a Prolific Macroscopic Model of Epilepsy,� Scientifica, vol. 2016, Article ID 3628247, 10 pages, 2016. doi:10.1155/2016/3628247 % Description: Original model used for Figure 2 in Fietkiewicz and Loparo 20...
c607ebb80607fe0602e49c12ac100a3586dbf1bd2dfafa418a0046a6228da029
MATLAB
4,671
210
function FS_DFF_STD_Image(DIR,varargin) % FS_DFF_STD_Image.m %run thorough directory and make STD and MAX images for every mat file in directory % This Script is for 'unprocessed' videos % % Created: 2016/03/09 % By: WALIII % Updated: 2016/03/10 % By: WALIII %% Custom Paramaters nparams=length(varargin); ...
219672548b25863363de7427c2e4f153cc998fb31d8e8fc80d015e2fb99d21da
MATLAB
4,672
126
%Author: Tatjana Schmitt, 2019-2022 clearvars path_to_matlab_file ='directory to whole tonotopy'; load(path_to_matlab_file) %% set parameter save_flag = true; frequency_hub = 1; % select the frequency you want to extract/analyse (1,2,3,4,5 for 4,8,16,32,64 kHz respectively) se = strel('disk', 1); ...
ca28567f7870092e4d8187820a7660157905cd188ca43982d798a043251816e0
MATLAB
4,681
161
%% MIRO main MATLAB script % MIRO Multiscale Image Restoration by Optimally-sparse representation % % SYNOPSIS: % [miro, Parameters, intr, fpn, im] = MIRO(im,PropertyName,PropertyValue) % % INPUTS: % im % Noisy image: variable name or file name (only .tif files). If left % void, the program opens a di...
bcda982df156a6728c25877385182e64832e2039496510198c4a48884f32c85f
MATLAB
4,690
118
%Author: Tatjana Schmitt, 2019-2022 function [subfield_borders_rotated, BF_borders_broad, coordinates_BF_map, coordinates_BF_map_rot_norm,... subfield_idx, tonotopy_axes_rotated, axes_idx] = roi_creation(BF, complete_boundaries_map, stats, rotation_angle) disp('Calculating rotated coordinates for visualisation ....
5ed3960f36296f80cad2ed4b159405b609351681ef200b67b0a6e2e57bc6c4cd
MATLAB
4,702
246
function fig_num=fb_visualize_rois(ROI,varargin) % % % % % % nparams=length(varargin); roi_map=[1 0 1]; bg_map='gray'; label_fontsize=9; label_color=[1 1 0]; clims=[0 1]; label=0; fig_num=[]; filled=0; weights=[]; weights_map='winter'; weights_range=[ -inf inf ]; ref_image=[]; ncolors=[]; weights_correction=0; wei...
478ab0f549b4b7d02b43703ac3e8930a6618d5beae79d0c90f20c08701eb213f
MATLAB
4,705
174
function [Y,ndx,dbg] = natsortrows(X,rgx,varargin) % Natural-order / alphanumeric sort the rows of a cell array or string array. % % (c) 2014-2021 Stephen Cobeldick % % Sort text by character code and by number value. % SORTROWS <col> input is supported, to select columns to sort by. % %%% Example: % >> X = {'x2','10';...
50636e1f3e2dfcdafab63dc7b88db0fd9a483d281593a2019c43dca33ed41139
MATLAB
4,732
196
function fb_detrend_and_align(ROIS,varargin) %detrends and aligns data aligned to silence % % % % % nparams=length(varargin); fs=22; per=12; cut=25; out_dir='extraction_silence'; save_dir='detrended_aligned'; disp_minfs=1; disp_maxfs=9e3; dat_dir='trace_data'; padding=[0]; fs=24.414e3; colors='hot'; minlength=.2; if...
855a36b965c105b60ef0b1d8fbe6496a0ae3ab9c6b929b34bc4479c5b332eb05
MATLAB
4,753
129
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given String_comp property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the Sig_comp property-PROP. % VAL will be le...
279bec30eae8b81aa94fe0eb5be34752e3c22733141611e9ec3e190ffc91bc03
MATLAB
4,763
135
function linfields = DFSwb_HPexpt_placefield2_savefields_crossvalid_fun(animalprefix,ep,exclude_trajtime, savedir) %---------------------------------------------------------------% % This is the function for calculating linearized place fields % % for cross-validation % % Pre...
c1e93102a6fcfd9e9aea73e6544941f21ae74c8dd0c036cd9c940586b1955144
MATLAB
4,763
168
function [phi_G, Cov_E_p, A_p] = phi_G_Gauss_LBFGS( Cov_X, Cov_E, A, Z ) %------------------------------------------------------------------------------------------ %PURPOSE: calculate integrated information "phi_G" based on information geometry % with a combination of an interative method and a quasi-Newton (LBFGS) ...
73d766d7386d06575c366bd2efec3bbf1ecf20099670d68df6d1fd1dc3ebf460
MATLAB
4,776
142
%% % Default parameter values for Kumar et al., 2023 % % Takes in the firing rate of the background, whether pre- (0) or post- (1) % damage, and the number of populations (3: PN, PV, and SOM; 4: same + VIP) %% function [params] = A1_params(r_bg,damaged,Npop) if Npop ~= 3 && Npop ~=4 error('Code only tested for 3 an...
4d07c8bdfd9b4edcbdae43642871742180e8b6010f81a178829df1957feb5ddd
MATLAB
4,778
109
%---------------------------------------------------------------% % This is the main script for gathering behavioral performance % % for all the animals -- Wenbo Tang (Jan 05, 2023) % %---------------------------------------------------------------% clc clear all close all %% % set directory denovo_dir = ...
76b59cc980f6407c5dc624c70f66283f1d16671e29e04adfc2e84476e017db83
MATLAB
4,780
129
%--- Script generating figure 3 --- %% 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...
95a72c6653952110ccea1e597fcc062834becc222bc29cb443a22ab6eee6c11a
MATLAB
4,785
136
function FR_sim_Ring(load_file, I0, w0, w_max, save_file, include_noise, sigma, w1_range) load(load_file, "P", "D", "M", "s", "phase", "N", "n") % setup [tau, d_t, err, check_dynamic, plot_mean, activation_all, tracker, max_step] = FR_sim_setup(); % set simulation range if nargin < 7...
c05511e50ba9a77d7c104a7b19a5b2b88ef48d63bb352b98a42faf1723233def
MATLAB
4,797
172
function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be...
620e97c6db3b09e71f51fdbaa0165076aab57d6820784bb92c46d5d68367ecc4
MATLAB
4,811
248
function [LOCS,VALS]=fb_compute_peak(CA_DATA,varargin) % Computes the peaks for a calcium trace or series of calcium traces % % % % algorithm: schmitt trigger, double exponential fit (for now) % % thresh_hi=1.2; thresh_lo=-1; thresh_t=.05; thresh_int=8; thresh_dist=.3; fs=22; method='p'; % f-min, simulated annealing...
8026cb1c9b505668ba8c27b96bf99bf2fb9883274645c541b1e992c5a42f2dbe
MATLAB
4,832
179
function [rsq_simult,rsq_adapted] = visIDX_scatterRESPocc(IDX,flag_SaveFigs) %% Goal % 2 plots; dII index vs occ. % plot 1 - simult % plot 2 - adapted %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; uctLength = length(IDX.allV1); % B. pull out all laminar matrices 3x(6,450,el#...
15341ea9a30d6766cffcf7f71c5f44b525d10132e3bbcac0a841b97804488079
MATLAB
4,863
119
classdef Coll_tiff_handler < handle %collaged_tiff operates a multipaged .tif file where each directory is %a collage of NxN images or rats. properties num_rects_horz % Number of rects in a horizontal line in collage led_area % rect_len % Length of a single rect led_l...
51d62e55de184a9987dd974e9de1300c789714950816294e09cf3fccd477609e
MATLAB
4,886
118
function [ directionalFilter,scalingFilter,waveletFilter,scalingFilter2 ] = SLcheckFilterSizes(rows,cols,shearLevels,directionalFilter,scalingFilter,waveletFilter,scalingFilter2) %SLcheckFilterSizes %% configuration 1 filterSetup{1}.directionalFilter = directionalFilter; filterSetup{1}.scalingFilter = scalingFilter; f...
085415915ee228bf0c04ccbed8a93f2fd1042b02f6cd863e1e0987ed640d388e
MATLAB
4,902
147
function [SDF_fulltm,SUA_fulltm,condition,CondTrialNum] =... continuousDatMonocCompare(STIM,ContinuousDat) %% BMC -- 10-29-20 sdf = ContinuousDat.SDF; % timepoints x trials sua = ContinuousDat.SUA; warning('hardcoding DE and PS') DE = 2; NDE = 3; PS = 90; NS = 180; % 1 - simult % 1. Monoc 1 % 2. ...
84d67d5d41088fc0cf1858f622b6f5172b6f8e688a3592ce3bf5e9f1a3d00f2b
MATLAB
4,925
149
%% % Simulation results for the non-spatial two populations model for networks % with and without astrocyte ensheathment of exc synapses %% %% Figure 5A and B: correlation across neurons for a specific example % Load the data prob_ensheathed_I = 0.0; prob_ensheathed_E = 0.8; ensh_strength = 0.5; num_ffwd_inputs=2; nu...
d7318e8f833729128e5a36f226cde28780bf2e39f1493a3c785e1c6d742d1591
MATLAB
4,940
132
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given Sig_comp property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the Sig_comp property-PROP. % VAL will be legal...
73c22d77689cc2130cac2c25afa589f733ee11f9b0b7c8e3e95b878b768bcb82
MATLAB
4,949
133
function AY = mm_fun(A,Y,chunk_size,run_paralel,FOV) if ~exist('run_paralel', 'var') || isempty(run_paralel); run_paralel = true; end if ~exist('chunk_size', 'var') || isempty(chunk_size); chunk_size = 2e4; end if ~exist('FOV', 'var') || isempty(FOV); FOV = [512,512]; end % multiply A*Y or A'*Y or Y*A or Y*C' depending...
d0264431b21fc25d133381247e1076a5f37dde511c1eb7d423e6604baba7c654
MATLAB
4,955
177
function value = load(str, varargin) %LOAD Load matlab value from a JSON string. % % value = json.load(str) % value = json.dump(..., optionName, optionValue, ...) % % The function parses a JSON string into a matlab value. By default, % numeric literals are converted to double, string is converted to a char % array,...
4cdd0eb0dc2f645c308cca3d4f75fe673b8202858a309ffe21fab74389e3dd1c
MATLAB
4,959
157
%% Study 3 EEG %% Patient List patientList = {'102', '103', '104','105','106','109','110','111','112','113','114','115','116','117','119','120','121','122','124','125','126','127','128','129','130','131','132','133','134','135','136','138','139','140','141'}; dataDir = 'C:\Users\\OWNER\\Dropbox\\Berkeley postdo...
8931797603b933d91132e2cf2f929dc69247ea1e79bccc881bd9654c9be7ecb3
MATLAB
4,979
116
classdef MaskApi % Interface for manipulating masks stored in RLE format. % % RLE is a simple yet efficient format for storing binary masks. RLE % first divides a vector (or vectorized image) into a series of piecewise % constant regions and then for each piece simply stores the length of % that piece. For ...
611d6b4e1f37f311779a1bf76217efbaa0ab8fca8fe526b06b901ee677c2fc7b
MATLAB
4,997
113
%create objects from masks and export to fcs for ez_segmenter function create_objects(point_index, pipeline_data) %% Pre-processing steps to mask data, convert into fcs / csv usable format, and create attributes to be saved later % get point from provided index point_names = pipeline_data.points.getNames(...
2a92cb54e16955605f543f5068d3dd6f753f5e6af978cd31d311d7396bc64790
MATLAB
5,001
170
% Experimental data for simulation % Fig. 3 % % go to 'SVM.m' or 'PVD_and_MLE.m' to simulate and decode data %% Data of one monkey using Circular Gaussian fitting clear; clc; close all; load('neural.mat'); %% Reshape data of each monkey for m = 1:2 Data = []; if m == 1 monkey = 'A'; mRe...
f856255c77ecfda059a0217354262823fb891782ac086c8ceafb03466c75b2f5
MATLAB
5,016
155
%% % Reproduces the modeling panels in Fig 3 for Kumar et al., 2023 % % Uses compressed spiking datasets for the 3-population spiking simulations % (panel b, c, and d) % Reruns the code for the mean field theory for panel c (i.e., simulations % vs theory firing rates) % Uses the compressed datasets corresponding to t...
e7cea457454890cf149f0d06538334168100e0409f98cbd52c19b674fd218907
MATLAB
5,025
146
%Author: Tatjana Schmitt, 2019-2022 function [idx_vectors, radial_vectors, radial_vectors_BF, radial_vectors_mean_BF, ... radial_vectors_mean_BF_smoothed] = vector_analysis(BF, stats, varargin) % creates vectors with specific step size and plots BFs along these % vectors, calculates mean BFs and smoothes data p...
38c4fffd3bbfcdb2171e67013c5ad6987628734afbf43632e69abe6829e70dfa
MATLAB
5,030
146
function bmcSuperBarAdaptation(IDX) %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; uctLength = length(IDX.allV1); % B. pull out all laminar matrices 3x(6,450,el#) %preallocate % RESPout = nan(size(IDX.allV1(1).RESPout,1),size(IDX.allV1(1).RESPout,2),uctLength); % dII = nan(size...
5660f03fe534814a8b677b5305c90ee0ec8e423cfdfbd4a2f866b2e10c072769
MATLAB
5,038
147
function bmcSuperBarAdaptation_ICPSDE(IDX) %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; uctLength = length(IDX.allV1); % B. pull out all laminar matrices 3x(6,450,el#) %preallocate % RESPout = nan(size(IDX.allV1(1).RESPout,1),size(IDX.allV1(1).RESPout,2),uctLength); % dII = n...
1a5560fb5bb9757798b860bb07475bd5e085247db5d731e2c6ca2409441460dd
MATLAB
5,043
154
function prep_for_fig05B(type_of_method,count_or_relative,... isubplot,legend_flag) marker_size = 2; plot_linewith = 1; % line_color = [0.5 0.5 0.5]; c = lines(7); color_match = c(2,:); color_nonmatch = 'k'; color_segment_exist = [0.5 0.5 0.5]; color_segment_nonexist = [.85 .85 .85]; %%%%%%%%%%%%%%%%%%%%%%%%%%...
5c02ee4a20f26b88dced5824f866043ead34fdf71e669ca143c9c3bcca87ad6b
MATLAB
5,049
117
% Neuromag layout of magnetometer % This function returns the positions of 102 MEG channels % Copyright by Hong Gi Yeom % You can use this code for academic purposes function [position]=neuromag_layout_mag() p=[ 3 -67.416206 35.916687 10.000000 10.000000 6 -53.602242 40.989067 10.000000 10.000000 9 -62.018288 21.176...
bb9e4988fb63147ec1626d4cbb2c3d7cbcc1ec6e5b6d21e0fbe808b3bb399d5b
MATLAB
5,051
154
%REAL2RGB Converts a real-valued matrix into a truecolor image % % Examples: % B = real2rgb(A, cmap); % B = real2rgb(A, cmap, lims); % [B lims map] = real2rgb(...); % % This function converts a real-valued matrix into a truecolor image (i.e. % double array with values between 0 and 1) using the colormap ...
0bbe97076e8332fb320b285d2c117ba3ab44b189d12b30196a1e5dafe5e9efc7
MATLAB
5,053
154
%REAL2RGB Converts a real-valued matrix into a truecolor image % % Examples: % B = real2rgb(A, cmap); % B = real2rgb(A, cmap, lims); % [B lims map] = real2rgb(...); % % This function converts a real-valued matrix into a truecolor image (i.e. % double array with values between 0 and 1) using the colormap ...
3685913fdb90d0e994780493cbf322a88cfa01f2dccf56641705131f7258e5b3
MATLAB
5,060
151
function [SDF_fulltm,SUA_fulltm,condition,CondTrialNum] = continuousDatConditionSelect(tune,STIM,ContinuousDat) %% BMC -- 10-2-2020 DE = tune.DE; NDE = tune.NDE; PS = tune.PS; NS = tune.NPS; sdf = ContinuousDat.SDF; % timepoints x trials sua = ContinuousDat.SUA; % 1 - simult % 1. Monocular DE PS % 2. Cong Simu...
dceb232f48010be011b56d5e09c8faefcb79c969122f6308e705344642065bfa
MATLAB
5,071
118
function [area_num, area_type, rat_angs, rat_rs] = rat_locs_to_Maciek_MDP_area(rat_locs, ar_ports) % Function rat_locs_to_Maciek_MDP_area calculates the MDP spatial state of the rat out of its % cartesian location. % % ASSUMPTION: % # All input value are given in pixels as produced by the came...
a8f01e8b287cc6b3e35cb30d98c97f599d6dcadcdca9226ac6c1b4dd0410e5ec
MATLAB
5,081
141
function plotScatterPlots_Fig01(Fig01) %INPUTS: %SUBSCRIPTS: %% Constants plotOrder=[3,4,5,6,2,1]; %% Avg whisker evoked response Population frameRate=Fig01.constants.dal_fr; leadTime=5; plotTime=((1:size(Fig01.Whisk_Evoked.Population_dHbT,1))/frameRate)-leadTime; figure(11); subplot(2,3,1); hold on for...
1be5cac7848b9958d3328ba4aebdfaa3a136a1e099a62007c64390e2c91c1eda
MATLAB
5,084
121
%%% Script to compute the output measures of the Computational Model Drave article of the simulated. % It takes all data files in a folder that are .mat format and containing electrode numbers (first column) % and spiketimes (second column). It detects network bursts based on spike % rate, exactly the same as for exp...
09ddcc6f49fd41a06fea901610723fb832afff2731e4a1f27efbbc8c14416f7d
MATLAB
5,089
170
%%%%create graph within school tbl = readtable('37070-0001-Data.csv'); var = tbl.Properties.VariableNames'; SCHID = table2array(tbl(:,1)); UsID = unique(SCHID); UID = table2array(tbl(:,2)); ID = str2double(table2array(tbl(:,5))); %spend time with: ST1-ST10 ST = table2array(tbl(:,66:75)); ST(ST==-99|ST==-97...
3a512dc290bd1aed61be2cd456d42bf9dda3b92395d3ca07a73dbfc7d374e11f
MATLAB
5,096
145
% raster_CompareUnits % adapted from twoUnit_TestSortConfigs.m %BMC - 10/8/2020 %The purpose of this code is to plot a condition-specific 2xN subplot %where N is the number of units in the SORTDIR, % i.e. monoc PS compared across all sorted units as visualized by a stacked % SDF and raster in each column. Each column...
19839f9862ff0b907a68a97692d906e38bf46c26eaa60ccb3b8faf44f1459167
MATLAB
5,100
180
function check_mdp_sound_timing(mdp_table, sounds_table, stats, ... experimenter, fig) % JN 2020-04-30 % refactor the code % JN 2020-05-24 % The strig column is not really suited for the mdp sound % timing checks because time passes between strig is taken and the % actual playing of sounds. start_t versus start_t ...
d4ed62f5cbc985fcf5a63790d222647c0164b300d479eb56953ab784de4382fe
MATLAB
5,104
140
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <scrubData: GLM based nuisance signal regression > % % 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...
ff41eb0cf421bf160f0c66d106efae303979e9f9eb8b1bbd6966739d85751896
MATLAB
5,104
130
function GLM_ndLevel() %parametric modulator at first level dbstop if error %does t-test and full_factorial do_ttest = 1; removesub = 0; %% define path cd ~ home = pwd; homedir = [home '/OBIWAN']; task = 'hedonicreactivity'; mdldir = fullfile (homedir, '/DERIVATIVES/GLM/SPM', task);% mdl directory (timing and o...
8662969fec8065e1b00f579b001fb3160f5e71c0fd20d813f270b01b2372c8e7
MATLAB
5,106
127
function varargout = cameras_GUI(varargin) % CAMERAS_GUI MATLAB code for cameras_GUI.fig % CAMERAS_GUI, by itself, creates a new CAMERAS_GUI or raises the existing % singleton*. % % H = CAMERAS_GUI returns the handle to a new CAMERAS_GUI or the handle to % the existing singleton*. % % CAMERAS_G...
422f372b87b01d57d63a0cb1b844c374bf2ab24ab04031c32a4dba8edb8fd0ad
MATLAB
5,107
115
function [valid_flag,err,is_formula]=check_if_legal(sig,comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given Signal component property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(SIG,COMP,PROP,VAL,DEF_ARR,VAR_ARR) % checks that VAL is a legal value as the Signal component-object proper...
6b135ed92723c1613f478ec883ddc49e359baee635836f99d5a0dd2882aa85b1
MATLAB
5,113
154
% HEADER: % This script preprocesses the real data. It removes line noise in human % data, segments all data into 5sec (can be set differently below) % segments, calculates chosen features and allows visual labeling via prompt % input. % % % YOU DO NOT NEED TO RUN THIS SCRIPT IN ODER TO TRY OUT THE CLASSIFICA...
e96bcd363e93414e8832a7f34b2f9f64e28b4ea9bc37dad7fbc56dc07f5c9baf
MATLAB
5,140
155
clear clc close all %% Constant decleration and loading constants options = odeset('RelTol',1e-4,'AbsTol',1e-4); %% Choice of stimulation parameters start_stim = 0; % [s] When to start the current stimulation end_stim = 0; % [s] When to end it f_stim = 1; % [Hz] At what frequency do you want th...
0f2d6a1cc95f8722173bef4bf76532e8d73c6df0a5f5a8430cbb275e73c238a9
MATLAB
5,164
164
%% % Reproduces the modeling panels in Kumar et al., 2023 % % Uses compressed spiking datasets for the 4-population spiking simulations % (panel b and c) % Reruns the code for the mean field theory for panel c (i.e., simulations % vs theory firing rates) % Uses the compressed datasets corresponding to the parameter s...
261959afa3956730bc55d5e52a2ad4d1fdbd2ba1f372e91c3043214b8f3bafef
MATLAB
5,166
158
function oimg = loadtiff(path) %% loadtiff('yourfile.tiff') % Copyright (c) 2012, YoonOh Tak % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are % met: % % * Redistributions of source code must re...
d9ae6858f3ffb66faee3aa537aa1859848e7d1c580f231bb7d58c75be6c2b559
MATLAB
5,167
137
%Author: Tatjana Schmitt, 2019-2022 function frequency_response_area(root_path, red_cell) %% set parameters save_flag = true; %% get file temp_filepath_SPLanalysis = [root_path, '\**\Tono_analysis_ANOVA*']; SPL_file = dir(temp_filepath_SPLanalysis); SPL_path = SPL_file.folder; SPL_name = SPL_file.name; load...
7e31ca82f962fc685a44d7dbd1c834f397bf474340431e72e7e7aff65b9e3c6c
MATLAB
5,187
139
% 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 Licens...
af1492349f7bab0568efd8937fef29b2b109c045f9798a1bf07b98a0b70f035e
MATLAB
5,208
150
function seg = local_AC_UM(Img,mask_init,rad,alpha,num_it,epsilon) % This function aims to implement Shawn Lankton's local active contour. And % the energy model is the UM model as defined in eq.(11)-(14). % The local variables are calculated by filtering operation instead of % iterating inspired by Chunming Li's I...
350a2262d065bb63f8dc8e279885d3fb90d48a046607194674660bff525572d0
MATLAB
5,225
73
function SUBJECT = ASLOutlierRemoval(SUBJECT, prefix, method) % ClinicalASL toolbox 2023, JCWSiero tic outputmap = [SUBJECT.ASLdir prefix '_BASIL_perDYNAMIC/']; if ~exist(outputmap,'dir') mkdir(outputmap) end DIMS = size(SUBJECT.(prefix).ASL_label1label2_allPLD); if ~exist([outputmap 'DYNAMIC_1'],'dir')...
a9e5fbb36c96f181dc794dd081905480c13fe237aa57ba6ea55eb2f88a44ab27
MATLAB
5,245
160
%% % Simulation results for the non-spatial one population model for networks % with and without astrocyte ensheathment % % Creates S1 Fig for realization 2 from Fig 3C %% % Load the data load('./CompressedData/NonspatialOnePop/balancedCompressed.mat') load('./CompressedData/NonspatialOnePop/brokenEx2Compressed.mat') ...
61d335bb9b5a52f64653148ad8e6cdacd51ea97f5450a2424c34968518791a1e
MATLAB
5,250
179
function [lc,cmap,ic] = linecolors(nc,cmap) % linecolors extract ordered line colors from colormap % % Inputs: % nc: number of colors to be extraced % cmap: colormap ([ncol 3] or string) % custom maps: 'shortjet','blue','darkgray' % % [lc,cmap,ic] = linecolors(nc,cmap) if nargin<2 || isempty(cmap) ...
582381789870666401965dbc72f3767da8399a8524eb7cd12326ff7999ae4362
MATLAB
5,256
132
function GLM_ndLevel() %parametric modulator at first level dbstop if error %does t-test and full_factorial do_ttest = 1; removesub = 0; %% define path cd ~ home = pwd; homedir = [home '/OBIWAN']; task = 'hedonicreactivity'; mdldir = fullfile (homedir, '/DERIVATIVES/GLM/SPM', task);% mdl directory (timing and o...
129e4eb94657b4eaf274d15d2e357af0330d5eb75eec5ab0b3e5efc669dc8ba5
MATLAB
5,280
201
function [ subject ] = cs_nmri_qcplot_power_mag(subject, data, params, title_txt) %[ subject ] = nmri_qcplot_power_sensor(subject, data, params, title_txt) % % Generates a QC plot for power at sensor space % % % subject = subject structure, see nmri_read_subject % could be a struct or .m file or .m...
ac36984f88fa2f43ee35dd8164706632883b3dcfa05d1e54a0d3a6adb1e5fec3
MATLAB
5,291
133
function [phase, Env_track, final_weight, weight_before, weight_mean, weight_var] = Sim_CA3RecNetowrk(n_ca3_per_track, n, M, s, P, D, plot_figure, seed, use_gpu) %{ We use Sim_CA3RecNetwork to simulate the weight matrix of N = n_ca3_per_track * M CA3 cells over n distinct environments, which mimic the animal explor...
6eda1862f545be2ae62c8f25422333e0df1c009bf0ad0098da7e7f11bc0fe7be
MATLAB
5,317
163
% Main frame acquisition loop - timings function acquisition_loop_new() imaqreset cam = videoinput('tisimaq_r2013',2,'Y800 (1280x960)'); src = getselectedsource(cam); % frame = getsnapshot(cam); fileID = fopen('locations.txt','w'); fprintf(fileID, '%s\t %s:%s\r\n', 'Frame_ID', 'X', 'Y');...
686fcbb60bb2e814676a8afc652d0ff2343e0e382d12f6c841e3663f5125b2ed
MATLAB
5,319
127
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <fALFF: calculates (fractional) amplitude of low frequency fluctuations ((f)ALFF) > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as ...
0c1843de5f2090fe14b88265a3931f2b418bb403ec8d728a42dbfdcd7d2401b7
MATLAB
5,323
153
function seg = local_AC_MS(Img,mask_init,rad,alpha,num_it,epsilon) % This function aims to implement Shawn Lankton's local active contour. And % the energy model is the MS model as defined in eq.(15)-(19). % The local variables are calculated by filtering operation instead of % iterating inspired by Chunming Li's I...
edbccde6e08b0a917ff9f233e207c6f234f2a394cfec7b055d73e6bcc4de3d30
MATLAB
5,323
158
function [ outMat,minMatIdx ] = hammDist(truncatedPep, fileName, hammdist) % % Written by Leah V. Sibener 20141001 % % Edited by Timothy F. Miles 20190114 % This function will output a nx3 matrix of paired peptides and their reverse % hamming distance. In this version of the program the hamming distance is % co...
2b0033b74567a62d074d37042f6e409902bd5cafe017cce3740487af5c291920
MATLAB
5,324
82
% Set options used in various core scripts % -------------------------------------------------------------------- % % You can change these values on your local computer, but do not commit the % changed version to the repository. % prep_2_load_image_data_and_save options & prep_3_calc_univariate_contrast_maps_and_save ...
98d5964092205b5c966e63026f8b0694b1a39847ad4054b06b249899c56a1f89
MATLAB
5,333
135
% Function used to place features with their respective dendrites and % create an over neurodegeneration feature table. % Updated: 08-30-2022 function [blebs1data,blebs2data,blebs3data,blebs4data,blebsNoneData] = ... blebAnalysis(n1,n2,n3,n4,imFeatures,sFactor,totBreakProp,dLength,imOrigBig,dendIntensity) % Comb...
6e5c97bd7d6b16797741aee68f7a30a9dbeacb133afdf2dd9bd2c287b7b6aa71
MATLAB
5,350
137
function out = set(out,varargin) % SET Set Output_manager properties and return the updated object % Property names are: % Plot_falgs, Plot_handles. property_argin = varargin; while length(property_argin) >= 2, prop = property_argin{1}; if ~isa(prop,'char') treat_error(['The property input is not a val...
8287df0b42953aafc287f3ac83452cfabf8ebde9d89484ef478115f36a230349
MATLAB
5,359
135
%---------------------------------------------------------------% % This is the script for calculating path-equivalent % % coefficients for all cells -- Wenbo Tang (Jan 07, 2023) % %---------------------------------------------------------------% clc clear all; close all; %% animalprefix_list = {'AM2',...
df212dc18c9a8148a593af52c66346a54ff1ccbfcea13ba64ab9d251b79920aa
MATLAB
5,366
137
%% % This code runs a demo for the DiRT simulations used in Handy and % Borisyuk, 2023 (corresponding to Fig 1) % This code interfaces with mex for speed % Also makes use of parfor across trials (see inner loop) % Runs over specified values of phi (i.e., fraction of the cleft blocked % by protruding astro...
13930fde752a01a8f7d092a7e2d6d02a86736a11a16fbaacac2ba8ea980e91a3
MATLAB
5,404
117
function [dataTable,ROIsToProcess,ROIlogicals,mapToNewROI,mapToRSGroup] = loadGoodData(varargin) o = ecogutils.postHocOptionsParser(varargin{:}); dataTable = loadECoG.loadMergedDataFiles(o); ROI_table = ecogutils.loadROItable(); mapToNewROI = containers.Map(ROI_table.oldROI,ROI_table.newROI); mapToRSGroup = ...
46c3b724494186f9529baf7cba1ce0778fa4ba541420cb46dec54dcacd6fa46f
MATLAB
5,404
263
% Gridfit test script % This script file is designed to be used in cell mode % from the matlab editor, or best of all, use the publish % to HTML feature from the matlab editor. Older versions % of matlab can copy and paste entire blocks of code into % the Matlab command window. %% Topographic data load bluff_data; x=...
dab4b8a5b8772d25c99a130acf580c5ab71bb87f49792a9450042bc1e42963a8
MATLAB
5,412
174
function [FR_evn, FR_tracker, FR, n_step] = FR_simulation(n_ca3_per_track, M, s, map, phase, synaptic_weight, eta, eta_IC, I0, d_t, tau, err, ... check_dynamic, plot_mean, FR_init, max_step, activation_all, tracker) %{ Simulation for the firing rate network. Parameters: n_ca3_per_track: number of CA3 populat...
17ef4152cda688b375bc90643a7b13c6677a4c48d107c388629bdecb8373a326
MATLAB
5,422
152
clear all clc close all %% Define parameters dir = 'dir\'; Input_name={'group1' 'group2'}; Save_name={'subBG_'}; %Save_cell_area={'cell_area'}; frame_number=120; pixel_number=400; ext = '.txt'; ext_xls = '.xls'; ext_fig = '.fig'; ext_jpg = '.jpg'; %% Main code for a=1:1:2 for j=1:1:6 %% input data...
91de4fc7dbef9bf5891b478564964edb1d63ea36e719460fe1f69672cf25d8e6
MATLAB
5,449
113
function file_format_data=get_file_format_vals(signal,signal_table,line_num,chan_num,line_trial_num,... num_lines,line_trials,line_max_trials) % GET_FILE_FORMAT_VALS returns a string that consist of a number of MATLAB % commands. These are initializa...
f3eb31b2efde1235246c977fdaf7451b2c7f791565cae23592c2c235282a67c5
MATLAB
5,471
128
function [shearlets, RMS, dualFrameWeights] = SLgetShearlets2D(preparedFilters,shearletIdxs) %SLgetShearlets2D Compute 2D shearlets in the frequency domain. % %Usage: % % [shearlets, RMS, dualFrameWeights] = SLgetShearlets2D(preparedFilters) % [shearlets, RMS, dualFrameWeights] = SLgetShearlets2D(preparedFilters, shea...
0ce1369c25002e132387f599e57098ddae256cac0d6d961e39514548a2b0948c
MATLAB
5,476
202
function [ subject ] = nmri_qcplot_power_grad(subject, data, params, title_txt) %[ subject ] = nmri_qcplot_power_sensor(subject, data, params, title_txt) % % Generates a QC plot for power at sensor space % % % subject = subject structure, see nmri_read_subject % could be a struct or .m file or .mat...
66a4888a4a3188e60d80e466171fb9be002096177940e64bab5132b4e7eeeec1
MATLAB
5,485
143
function [delay] = CalculatePacketDelay(vid, fps) % CalculatePacketDelay Calculates recommended packet delay for a GigE Vision camera. % % DELAY = CalculatePacketDelay(VID, FPS) calculates recommended packet % delay DELAY for a GigE Vision camera, represented by an image % acquisition videoinput or gigecam ob...
7b004a2564de3759be354fa6923e1b2f3076dcf18f9f4f510c5473dc1ce6d18d
MATLAB
5,501
142
% MIBI smooth stitching script % Author: Dmitry Tebaykin % Contact: dmitry.tebaykin@stanford.edu %% Necessary parameters % Provide the XML file path from the run, stitching parameters will be % extracted automatically. Example: xmlFileName = '180501_Hip_Panel3ug_Final-2b.xml'; xmlFileName = ''; % Output folder for st...
e1e99d0427770bad932a3e7b50f6bf39a31c3ceb7de53039498f50376ae6b221
MATLAB
5,509
155
%IMSEQ Open an image sequence as if it were a video stream. % % h = imseq(filename) % % This class creates an interface to a sequence of images similar to that % of MATLAB's VideoReader class. However, the read method can only read an % image at a time. % % The format of the filename is assumed to contain a...
eea442cde1f12f2429ef4c8795ee56d78e4ac3f7c7f9ac8b9f5a6078c4459be0
MATLAB
5,538
116
function Estimatetheta_Voxelwise(varargin) % Varargin: Porg = varargin{1}; % Original images Prot = varargin{2}; % Coregister or aligned images Vvector = varargin{3}; % V1 or main diffusion vector (depending on the model you are using) Vvector_Vol = load_nii(Vvector); VvectorImg = double(Vvector_Vol.img()); [pthname_t...
16d0b268a7ad133a893aa19b4f5ba16e569f5f046d2cfeef14368517dd9606df
MATLAB
5,540
167
% Spontaneous neural activity during pursuit task % Fig. 5a, fig. S7a, and fig. S9, a-e %% PSTH of spontaneous activity clear; clc; close all; monkey = 'A'; % A for Monkey A, B for Monkey B load(['mSpikes_' monkey '.mat']); % Gaussian smoothing for i = 1:size(wide,1) wide(i,:) = gaussianFilter(wide(i,:),10); e...
04854e723088fbbe9cb11aaa405ea3583da9dc8e68fd9b941605afcd7eb2b4fd
MATLAB
5,571
202
clear all; c1 = [121 180; 136 180; 151 180; 166 180]; % window before NP, 1s = 30units c2 = [181 240; 181 225; 181 210; 181 195]; % window after NP c = [c1 c2]; load('riNPrnr.mat'); load('rrNPrnr.mat') crossN = 4; repeatN = 1; sampleN = 400; %% rr reward or not rrRw={}; for i=1:size(c,1) t = c(...
7ad917f06868953ff28ca9405a782fe5e4930f714cf7d09571e9aa2f7b44f5d0
MATLAB
5,574
188
function err = save_nifti(hdr,niftifile) % err = save_nifti(hdr,niftifile) % % Pixel data should be in hdr.vol % % Handles data structures with more than 32k cols by setting % hdr.dim(2) = -1 and hdr.glmin = ncols. This is FreeSurfer specific, % for handling surfaces. The exception to this is when the total % number of...
d57743d74d329951c5695e2506275d4dc3c4cb428388c4a3e79a468b1e1698c2
MATLAB
5,587
139
%---------------------------------------------------------------% % This is the main script for CCGP of trajectory phases % % using linear SVMs; Libsvm MATLAB toolbox (V3.22) is needed % % (https://www.csie.ntu.edu.tw/~cjlin/libsvm/). % % -- Wenbo Tang (Jan 07, 2023) ...
d85e25b52bfcd2505d85bf860d6ea9767869daae272aa37c50360365c20446c6
MATLAB
5,595
100
% ClinicalASL toolbox 2023, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 25-05-2023 for the MOYAMOYA study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL analysis, CBF, map smo...
32b54be6aa487f16d93ea8d6dd0b7d9851c2bc1671cf1aa3a176662fed253051
MATLAB
5,617
147
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <filterData: performs a variety of smoothing operations depending on parameter inputs > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License...
5208ad54973ad2d1e0ccd9d747f096f57e12b699d5dd26c4dbe69e1fae0dddbe
MATLAB
5,622
172
clear close all clc figure('Units','normalized','OuterPosition',[.1 .1 .08 .2]) isubplot = 0; prep4fig5D('action_preference',isubplot) isubplot = 1; prep4fig5D('LDA',isubplot) function prep4fig5D(type_of_method,isubplot) %% settings c = lines(7); color_match = c(2,:); marker_size = 2; line_width = 1; color_nonmatc...
83508a13a31985f1b6b5a938a140acc80db7781de7850fb9e67215b34bc8c347
MATLAB
5,624
206
function coef = tdrRegression(data,regpars,plotflag) % tdrRegression linear regression on population responses % % Inputs: % data: population response (sequential or simultaneous) % regpars.regressor: cell array of regressors {nrg 1} % Each entry is a string, corresponding to the name of one of the fields % i...
27d386bd55d77b2d5b0aa5977fe3fb2c11c31cff1df2774ee892745379b0f01c
MATLAB
5,651
94
% ClinicalASL toolbox 2025, JCWSiero %%%%%%%%%%%%%%%%%%%%% ASL Analysis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % written by Jeroen Siero 30-04-2025 for the APRICOT/MOYAMOYA/PXE/STROKE study % includes automatic DICOM file loading, anatomy segmentation and registration, outlier removal, data construction, BASIL anal...