sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8f99d3d4467c6e468ae52a68e57449e51184db4e1f4bb2a86c8e572fca0b5809
MATLAB
11,486
333
function [] = CategoricalScatterplot(X, varargin) % function [] = categoricalscatterplot() % % A replacement for the traditional box and whisker plots provided in % MATLAB (command boxplot). The categorical scatter plots additionally % shows the data points, which is useful the visualize the underlying % distribution (...
6a307f02726e93dcfc6efeac80b1aacfed76bd979983586446adf4d88dd6645b
MATLAB
11,499
294
function total = switchBuffer(duration,varargin) % function total = switchBuffer(duration, ...) % % Never call this function directly, internally called by keyBuffer! % % Usage: total = switchBuffer(duration, varargin) % % INPUTS, INPUTS-OPTIONAL, OUTPUTS % The same as keyBuffer, see help keyBuffer. Only the touchsc...
2ac388c3d0bd2092b384369c905eff0a3cf1e84f162b24bb9847db43f4d77f58
MATLAB
11,501
374
function nvr_record_data(wavfid,nvrfid) % % % This file is the meat and bones of the digital vocalization recording system. % It will read in data from the specified channels at the specified SR, and will % save that data to disk (wavfid)until either the stop button is pressed, or the % total recording time exceeds th...
600f63964890c7e3330973da0cc33cf0207431262bcad16cbb146233ba8d05c9
MATLAB
11,526
277
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NOTE: This script is dependent on graphtest...
8bdcaa5dda2f1680c8c78dc9e40201ff88fbd3ec7bf5092f22e88d331979dfdf
MATLAB
11,540
371
clear all;close all;clc tic % develop for 1 subj cond_num = 2 reg1_name = 'OFC'; reg2_name = 'HC'; subj = '84'; exp_type ='tuning_correct'; lock = 'onset'; cd(['/tmp/yassamri/iEEG/sandra/subj_' subj]) addpath('/tmp/yassamri/iEEG/sandra/analysis_pipeline_final') [cond1,cond2,cond3,cond4, cond5, cond6] = GetCondDa...
fd96c1fa9051d8fb7920977f0a17069b914ad96bb88ff28f7fea7f5099121ae4
MATLAB
11,562
352
clear all close all clc addpath('/gpfs0/tals/projects/Analysis/stavbi_goldfish_2021/Matlab/matlab_functions','-end') %% loading the data load('Inh_data_10_6_2022.mat'); geneid=Inh_geneid; flags=Inh_flags; data=Inh_data; %% normalization + highly variable genes + scaling and log transform exg={'Eif2s3y,Ddx3y,Uty,Kdm5d,...
50246d5da9924502f0d7fc6251770efb8cf0663be81ad7aa50a1dfdddf8331b7
MATLAB
11,578
283
function [] = analyzeCalciumDataCI(nParallel,nBoots,p) % analyzeCalciumDataCI Takes Processed Calcium data and fits pairwise Ratio of Gaussians model %% INPUT % nParallel ( must be > 1) - number of cores to run on parallel % nBoots - number of bootstrap resamples (default 1000) %%% NAME-VALUE INPUTS % ...
43ab6b04eae78541d5b5be2b88dd6c1fb4d3944d0a12dae498e1e64ebd82a092
MATLAB
11,589
275
%% Thomas_Yang_et al, 2023 @Nuo Li lab %% Fig. 4d ALM activity in control and SC photoinhibition trials projected onto the coding dimension clear all close all addpath('../func/') load Figure_4_d_data %% average trajectories along CD across session % Ipsi SC stim proj_R_training_mode1 = []; pro...
8e0d78921600a7157e69015e2bb94898b94d65026c4b41b7ed443eabb67256a8
MATLAB
11,595
262
function startTime = controlSound(soundFile, varargin) % Play, stop or release a sound that was loaded with loadSound. % % Called with the sound handle alone the whole file is played. Optional % arguments repeat it, stop it, stop it after a given time, or give its % audio buffer back to the sound driver. Playing a soun...
4d6052fe7d682f2ede0bc9ebf27bc500ac61c3aba1c529cebfca1a8eada3335f
MATLAB
11,627
373
function [sROI] = ReadImageJROI(cstrFilenames) bOpt_SubPixelResolution = 128; % -- Check arguments if (nargin < 1) disp('*** ReadImageJROI: Incorrect usage'); help ReadImageJROI; return; end % -- Check for a cell array of ROI filenames if (iscell(cstrFilenames)) % - Read each ROI in turn cvsROI = cellfun...
3301a2efa380939fa54d60b9eefb1255297f94c81c50f4e30fddab391fc7779d
MATLAB
11,633
225
% PRE SPIKE TRAIN CIRCULAR SHIFT % Disrupts temporal domain. % INPUT: % decoded_thetaSeq, directional_place_fields - data structs. If empty, loads them % num_shuffles: integer % save_shuffles: 1 or 0. To save shuffled structures % save_option: 'Y' or []. To save function outputs function [PREspike_tra...
adf1b85f9dd387325f688c3b20845ff18fc6a5652408443ac9f581e6f0184ac9
MATLAB
11,664
429
% Plots all the RGC and SC neurons, and allow the user to click on % one of them to see the potential. function inspectPotential(obj,addFlag, SCidx) if(isempty(obj.UAct)) disp('You need to have C and U tables') return end % Whether we do synapse addition or removal energy if(~exist('addFlag')) ...
fd6e50286c82bbbe54751245681a23a74bdd67ee4ae6dafc117545c39bb48c32
MATLAB
11,667
238
%% calculate prediction accuracy within each network. clear all % Add package to read NPY files into matlab addpath('/Users/askeller/Documents/npy-matlab/') % fourth column has the matched_group data_for_ridge=xlsread('/Users/askeller/Documents/Kellernet_PrelimAnalysis/RidgeResults/data_for_ridge_081822.xls'); % Lo...
6c1279178bf6e1361ad2bc9ce1f397fb4495fecb67b433e3cbcfd00ab0303416
MATLAB
11,670
318
function out = spm_dartel_norm_fun(job) % Spatially normalise and smooth fMRI/PET data to MNI space, using Dartel flow fields % FORMAT out = spm_dartel_norm_fun(job) % job - a structure generated by the configuration file % job.template - Dartel template for aligning to MNI space % job.subj(n) - Subject n % ...
53497668edb27934dd91d367702b9d3e1417ab4e70c8d874284c8e5fa1b789a9
MATLAB
11,671
325
function [task] = runSVC(studyArg, subNumArg, waveNumArg, runNumArg) % % RUNSVC.m $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % usage: [ task ] = runSVC( subNumArg, waveNumArg, runNumArg ) % % subNum && runNum are scalar % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
53c50a3980d0c6bfbeafc9875297c9cd00a370aa0f7caab29844f495d9487a7b
MATLAB
11,674
306
function varargout = SaveFMFSettings(varargin) % SAVEFMFSETTINGS M-file for SaveFMFSettings.fig % SAVEFMFSETTINGS, by itself, creates a new SAVEFMFSETTINGS or raises the existing % singleton*. % % H = SAVEFMFSETTINGS returns the handle to a new SAVEFMFSETTINGS or the handle to % the existing singlet...
75b495a930eb05ada01e4eb1c25fc655dc8bf37920d8f9a7462e7442e0cce0d8
MATLAB
11,697
267
function SBJ08b_HFA_plot_corrRT_ANOVA(SBJ, proc_id, an_id, stat_id, plt_id, save_fig, fig_vis, fig_ftype) % Plots ANOVA results % clear all; %close all; % fig_filetype = 'png'; if ischar(save_fig); save_fig = str2num(save_fig); end %% Data Preparation % Set up paths if exist('/home/knight/hoycw/','dir');root_dir='/hom...
ca60c930e161dec33bd7846d1c7d2e1ca96247c633fc9ed126f11b5c473139a4
MATLAB
11,708
269
function [G, CGM, insulinBolus, correctionBolus, insulinBasal, CHO, hypotreatments, mealAnnouncements, vo2, x] = computeGlicemia(mP,data,model,sensors,dss,environment) % function computeGlicemia(mP,data,model,sensors,dss,environment) % Compute the glycemic profile obtained with the ReplayBG physiological % model using...
d0cfb8253892354466ba573535ab2f412ea1f2a930a62cf567790eb56016b101
MATLAB
11,717
278
function SBJ06d_ERP_plot_crRT_mGLM(SBJ, proc_id, an_id, model_id, stat_id, plt_id, save_fig, varargin) %% Plots mass GLM beta time series for ERPs per electrode % INPUTS: % SBJ [str] - ID of subject % proc_id [str] - ID of preprocessing pipeline % an_id [str] - ID of the analysis parameters to use % model_id [s...
118f466afec3274b2d6a80233513ef0c3c0bdc59f424f9f525751ca98f61ba98
MATLAB
11,739
352
clear all close all clc addpath('/gpfs0/tals/projects/Analysis/stavbi_goldfish_2021/Matlab/matlab_functions','-end') %pyenv("ExecutionMode","OutOfProcess"); %run just one time %% loading the data load('nonneurons_data_10_6_2022.mat'); geneid=nonneurons_geneid; flags=nonneurons_flags; data=nonneurons_data; %% normaliza...
7ffae16221c51c6fb7e0d89eb80671586ca701a0834b71bcab8c7ddf200ed242
MATLAB
11,746
338
function [R2, sqErr, yhat, coef] = nc_FitAndEvaluateModels(y, x, model,crossvalidate,bootIter, params) % Calculate R2 using leave one out cross validation for a variety of models % % [R2, sqErr, yhat, coef] = nc_FitAndEvaluateModels(y, x, model,crossvalidate,bootIter, params) % % This function will fit and evaluate a n...
b31a7a5a119c8e2092f6c5d432d60e39fc9a2f8d3707e4010e8562a3b358ad88
MATLAB
11,762
257
% to conduct stats on regional metrics of Suzhou data % Written by ChenXiao % 20220331 %% initialization clear; clc; work_dir = 'working directory'; if ~exist(work_dir, 'dir'); mkdir(work_dir); end data_dir = 'DPABISurf Preprocessing Files'; TemplateDir = 'DPABISurf surf template directory'; HemisphereNameSet = {'lh'...
a9ebbef5b2e28c598ed7fda16d377d1cdfadbcbd9a457dea86cfbcddcb4848ed
MATLAB
11,764
216
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 DCX %vol(ch3, 0, 5000) 568 Sox2 %vol(ch4, 0, 5000) 488 Nestin ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[...
be850aaa5ad7c80a667252ff8ef717ed346ebb40f3968ee26abb25d613625260
MATLAB
11,766
312
%% Imports addpath(genpath('../libraries/phastimate')); addpath('../libraries/neurone_tools_for_matlab_1.1.3.11_mod'); addpath(genpath('../src')); %% Configuration and Setup: LOG_MEP = false; ANTIMEDIAN_MEP = false; offset = 5/1000; % in seconds, this is the offset of the windows from the TMS-pulse: 5ms interpolate =...
bb5e7d361883c11cd08862ff8e8545a4f54fd34d71c04b6117b8cd9caec901aa
MATLAB
11,773
319
function [nn,ctrs] = myhist3(varargin) %HIST3 Three-dimensional histogram of bivariate data. % HIST3(X) bins the elements of the M-by-2 matrix X into a 10-by-10 grid % of equally-spaced containers, and plots a histogram. Each column of X % corresponds to one dimension in the bin grid. % % HIST3(X,NBINS) plots ...
0865f9dae71a36a4e05ac8d20f1c7cb516d645cd99847bc67f6c52877e73f40c
MATLAB
11,786
392
function [suspicious,dataperfly,params] = suspicious_sequences(matname,annname,varargin) [MINERRJUMPFRAC,CLOSELENGTH,MINORIENTCHANGE,MAXMAJORFRAC,MINWALKVEL,MATCHERRCLOSE,... MINANGLEDIFF,MAXDISTCLOSEFRAC] = ... myparse(varargin,'minerrjumpfrac',.2,'closelength',20,'minorientchange',pi/4,... 'maxmajorfrac',2/3,'...
886a21cb718e6135661839d0c3c3ff2d030852ebee208d7dfb37daaf7f015688
MATLAB
11,799
263
%% Calculate Minimum Distances Between Imaris Puncta % Thomas Murphy, UC Riverside, 2021 % % Get x,y,z positions from exported stats for two Imaris spots objects, and calculate minimum % distance between them (i.e., min distance from a Lphn2 spot to nearest vGlut1, and vice versa). % Output tables of distances an...
06b565e8180aa9696d437371bc57321700a2b9ee6710cdc00159f4127b3d750b
MATLAB
11,802
257
%% ----------------------------------------- %% % Note Jan 28 2020: % % Current version of code does FOV correction, grid correction & MIP/AIP % generation, surface finding & profiling, mosacing & blending % % Suggested parallelization method: one slice per thread % % volume stitching is currently in another code % % ...
cddab1c8bec8c6a9abe7d293f48b5816984ce9483d0fd52e829aea8353abbe22
MATLAB
11,832
297
function RATS_population_vector_analysis_figure % POPULATION VECTOR ANALYSIS FOR RATS INDIVIDUALLY cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Population_vector_analysis\figures\PPV_shuffles_RAW-PlField_BAYESIAN' rats8 = openfig('Cummulative frequency distribution RAW BAYESIAN PlFlds -S16_8.fig'...
3ff791aeb82b25a6521310c53f9c6e005609a39e0552aed5a9c4b0396dd45d7f
MATLAB
11,834
279
function tSC_neuron_coupling(mainPath, animal, session, ch, isstim, isshuffle, neuron_n) %TSC_NEURON_COUPLING testing phase coupling to tSCs % TSC_NEURON_FIRINGPROP(MAINPATH, ANIMAL, SESSION, CH, ISSTIM, ISSHUFFLE, % NEURON_N) performs Rayleigh's test for circular uniformity on % temporallyshifted spikes to ...
8e51449a5745f489947b51e083adbccc7f48ff4df065ef6128c93a827e22b8d3
MATLAB
11,854
384
function out = spm_shoot_template(job) % Iteratively compute a template with mean shape and intensities % format spm_shoot_template(job) % Fields of job: % job.images{1} first set of images (eg rc1*.nii) % job.images{2} second set of images (eg rc2*.nii) % etc % % Other settings are defined in spm_shoot_def...
ea52246b89c94bc61dc89c59ca2b7d7b2148447f85c217f7176c34e83d6c9f2c
MATLAB
11,854
292
figure group_plots = 'yes' if strcmp('yes',group_plots) subjLength=1; else subjLength=8; end for iSubj = 1:subjLength% change this for indiv subj line color clearvars -except conda condb condc cond1 cond2 cond3 cond4 cond5 cond5 iSubj group_plots ... reg1_reg2_LureMinus reg1_reg2_LurePlu...
bc1cffbaedf5bb8013627e52e1f618a63ddb913490305d390ae724d255fe1aa7
MATLAB
11,862
361
function [varargout] = spm_uitable(varargin) % WARNING: This feature is not supported in MATLAB % and the API and functionality may change in a future release. % UITABLE creates a two dimensional graphic uitable component in a figure window. % UITABLE creates a 1x1 uitable object using default property values in %...
709bc56158c5ccb3210d645fad29b002253edddff80cbf7988dc569acfb0373b
MATLAB
11,874
418
classdef TreeMapOfMany < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause properties map=[]; useSet=false; end methods ...
276bf974cf09bbb9163dab526a6b34fd4bc5d890b0a82c1e742595531aadcd86
MATLAB
11,885
268
function SBJ08f_HFA_plot_grp_GLM_onsets_wiROI(SBJ_id,proc_id,an_id,model_id,stat_id,roi_id,... plt_id,save_fig,varargin)%gm_thresh,z_thresh, % Load HFA mGLM results to plot onsets of signifcant effects within ROI % Also shows t-test for onset differences between regressors ...
04da9b05bbbd1b5ade3c24ee005da9cc91d0345d4703955006e05b173372edd7
MATLAB
11,892
287
function SBJ01a_import_data(SBJ,proc_id) %% SBJ01a_import_data.m % Extract data with fieldtrip and save out by data type if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end addp...
76c44c2d334e09ecd207a44f83c7dbddf0b1a09d036e6d562d6b09b770826abe
MATLAB
11,896
291
function[]=BaSiC_shading_and_ret_stitch(id,P2path,datapath, ntiles,depth, thickness) % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Mat...
53a83b979a4c305e09be5729e903bd2379dd2cbc6034806a61b2a29b33f1d3c8
MATLAB
11,913
295
function [self] = getDistByTimeSpike(self,condNdx,key,opts,plotFig) % getDistByTimeSpike wrapper function for calculating the transition % probability, turn optimality, and kinematics in the KNN space % % Inputs: self = fly object % condNdx = fly x time matric of the general firing rate regime % ...
d852d419f374b2c30b767a4969eae1f4777464657a874c64e2f7e2cbbd994e49
MATLAB
11,920
374
%plotWesternData_final.m %% section 1 -- plot without outliers clc; clear all; close all; theDir = 'C:\Users\kmfo8\Dropbox\Rutgers\Firestein Lab\MEA papers -- addl experiments\EXP for BDNF dose response\final NEW results from Srini\'; figDir = [theDir,'final_forPaper\']; theFile = ['bdnfWesternData_plotNoOut...
c41bf223679ab90922795f6b2f2f0aef816c6cf200170fb69c6f644bf9a94e22
MATLAB
11,937
346
function varargout = spm_preproc_run(job,action) % Segment a bunch of images % FORMAT spm_preproc_run(job) % job.channel(n).vols{m} % job.channel(n).biasreg % job.channel(n).biasfwhm % job.channel(n).write % job.tissue(k).tpm % job.tissue(k).ngaus % job.tissue(k).native % job.tissue(k).warped % job.warp.mrf % job.warp....
900959d9f8519ea5364859c2af59eecf73d318a3b6b946b7706ce88278412e06
MATLAB
11,945
272
function tSC_neuron_firingprop(mainPath, animal, session, ch, isstim, neuron_n) %TSC_NEURON_FIRINGPROP Main preprocessing of spikes - tSC connection data. % TSC_NEURON_FIRINGPROP(MAINPATH, ANIMAL, SESSION, CH, ISSTIM, NEURON_N) % is calculating mean firing properties for single neuron activities % recorded s...
e71fc4a03a3f735c6e6b3230187a0a266ee47fd65fe7757f4f3f1b4ca167889b
MATLAB
11,960
295
function total = getAnswer(duration,varargin) % Use this function to get access to the user's response keys. It is more % flexible to use than the function keyBuffer. % To be able to define good and bad responses use the helper function % "getKeyValue" to get the appropriate number for each key. % getAnswer allows the ...
d8c028d2b3343671fee30b8f20107dfa8b0f7e26f38efe0cfa93f1340fb01649
MATLAB
11,974
278
% function MAP_fig_1_multi(mname,config) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NO...
0dacea96cadf9256394d3f5814de994a267de6885ce32e4b1b6a3baeef2ab865
MATLAB
11,984
312
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Coherence calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Coherence Code % Coherece is run between paris of electrodes % data needs to be in the EEGLAB format % pathing needs to b...
d3986e1404ee5e3d9ac10bbc30b6565ea4aed85bed62637dc66d16eeafc0acdd
MATLAB
11,993
349
clear all close all clc addpath('/gpfs0/tals/projects/Analysis/stavbi_goldfish_2021/Matlab/matlab_functions','-end') %% loading the data load('Ex_data_10_6_2022.mat'); geneid=Ex_geneid; flags=Ex_flags; data=Ex_data; %% normalization + highly variable genes + scaling and log transform exg={'Eif2s3y,Ddx3y,Uty,Kdm5d,Btg2...
17524f03339bfd9b6b7f0e28b8c9849e0eb0041fb9beb3554340529bda3fed7e
MATLAB
12,017
265
function notNeeded = initSound(devIndex) % Open an audio device and prepare it for playback with loadSound. % % Called without an argument the function searches for the best sound % system this computer offers and opens the first output device it finds. % On Windows it works through ASIO, WASAPI, WDMKS, DirectSound and...
6860a341d26ed3ba582363accbd56a902d3befee262f80a4ac8461df8a1b827c
MATLAB
12,017
262
function myHardwareSetup % This function sets all basic parameters of the hardware in your setup. % This function needs to be stored on each experimental computer. All % required hardware definitions are stored in the global variable SETUP % created by this function. Edit this function when building a new setup. % Desc...
a6a3b75de0ec23cd7cc19bd179324f573a70af516b390fc30813c16ff8f749a4
MATLAB
12,031
272
function showInstructions(source, varargin) % Use this function to display instructions or information to a subject. % The text is read out of a text file or entered directly. The user % has to press a key to continue the program and the screen is cleared % automatically. % % Usage: showInstructions(source, varargin) %...
50b243b62ed3a69065ab124bdc52f9e213fb1cddeb807636740ad2d9cd6e2fe7
MATLAB
12,067
446
function [ZI,f] = spm_eeg_plotScalpData(Z,pos,ChanLabel,in) % Display M/EEG interpolated sensor data on a scalp image % FORMAT [ZI,f] = spm_eeg_plotScalpData(Z,pos,ChanLabel,in) % % INPUT: % Z - the data matrix at the sensors % pos - the positions of the sensors % ChanLabel - the names of the sen...
2615cd8c0c0a55130545a6c3fd4c1cd88be4d432de9ebb3c76b8d675239a5604
MATLAB
12,070
194
function shuffle_population_vector_analysis(bayesian_option,num_shuffles,save_option) % Marta Huelin_February 2020 % Computes population vectors between shuffled matrices for the same type of comparisons used in the population_vector_analysis.m code (meaning, % between same track exposures and between different tracks)...
984ba1f1dc05ea2d865f9d3c92b3d412dad855285a60eed24c83beeba1c17c22
MATLAB
12,084
290
function SBJ08c_HFA_GRP_summary_bar_perc_actv_RT_ANOVA_ROI(SBJs, proc_id, an_id, stat_id, actv_win, roi_id,... plt_id, save_fig, fig_vis, fig_ftype) % Load HFA analysis results for active, RT correlation, and ANOVA epochs % Active- must be significant, and f...
d61936ed5ee9b72d04c4112e50b9ab0b041285cda626e927bc107688972a793f
MATLAB
12,101
351
% script that prompts user for mat, annotation, and movie files, parameters % for computing suspicious frames, then computes suspicious frames, then % brings up the fixerrors gui RUN_UNTRACKED = 0; % run FixErrors with no Ctrax annotation %% set all defaults moviename = '180925_1_3_video.ufmf'; moviepath = pwd; se...
ee9f1fb20243821e57733f19509f6dfcd6df223e0df9a01c9dc81a6969d155e1
MATLAB
12,102
443
%% add paths to plotting packages/data clear all addpath(genpath('/Users/maria/Documents/Matlab/cbrewer')) addpath('/Users/maria/Documents/MATLAB/raacampbell-shadedErrorBar-9b19a7b') EEGpreproc = '/Volumes/crdkData/preprocessedData/behaviour'; % path to behav data all subjs cl = cbrewer('div','RdBu', 12); cl = cl([2...
6c7485795a4af0006b177d6452ba1f75815d18c8dc3c4ea89fbc5a79e6e1ff56
MATLAB
12,105
238
%% calculate prediction accuracy within each network. clear all % Add package to read NPY files into matlab addpath('/Users/askeller/Documents/npy-matlab/') % fourth column has the matched_group data_for_ridge=xlsread('/Users/askeller/Documents/Kellernet_PrelimAnalysis/RevisionAnalyses_PFNsCog/SeparateSamplesCogniti...
061344d95f12459b93d8e0151d09b56e489d88fd5f2598a9da6ea096bfdfe540
MATLAB
12,107
363
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
c20854a26d9bd4b040af792122ed7c961db0e650314eb2e151b00e3a3a76ca03
MATLAB
12,137
260
function [] = fun_updateFigures(handles, slice_idx, figureName) %FUN_UPDATEMATRIXFIGURES Summary of this function goes here % Detailed explanation goes here % Set plotting parameters marker_size = 2; line_width = 2; narrow_ratio = 1; switch figureName case 'G' % update G figure ...
07ac67024121289c9a4418b360e383740b435f1d28e7079e328cfd95fe8ac9e6
MATLAB
12,138
458
function img = feldkamp(cg, ig, proj, varargin) %|function img = feldkamp(cg, ig, proj, varargin) %| %| version modified by james balter and others to try accelereys "jacket" %| UNDER DEVELOPMENT! %| %| FBP reconstruction of cone-beam tomography data collected with %| a circular source trajectory. %| See feldkamp_exa...
9fce4957cf7f1d4516b51306b1229677f6dae9ecf9e5315bc7e2b5d09c9cd0f0
MATLAB
12,138
434
close all clear all clc addpath ../data addpath NIFTI_toolbox load Diffusion_vs_Age_WMlabels_mean_NODDI90_expanded.mat % Labes of metrics analysed lab = {'FA','MSD','MSK','NDI','ODI','F_{iso}'}; Nmes = length(lab); % number of metrics Nsub = size(FA_wm_mat,1); % total number of subjects age = age'; sex = sex'; % c...
6edb793a141a9ca08f92476cc12d569ae35507e1df555d5341b19126cf263f11
MATLAB
12,139
326
%% Script to create output for Fig. 1 - parameter comparisons between Young, healthy Elderly, MCI merged % Andrea Castegnaro, UCL, 2022 uceeaca@ucl.ac.uk % Fits the model on all of the groups and run a two-way Anova % (group*condition) on Young Controls, Elderly Controls and MCI negative % Output: for each parameter f...
daa32246e99a934459c60930062bf438fba091f237e8c1c80ded1de0ee6bf261
MATLAB
12,141
353
classdef SuhSptx < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause properties(Constant) BAD_KLD_FREQ=.0075; LOG=false; end ...
32d0e2bdb33e4a65b8b8c68b9a156d9296a93d7a1ecbd771a03ef46ae67f85dd
MATLAB
12,151
341
% function MAP_fig_1_multi(mname,config) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NO...
ea5b8fa55a8bfb51d881611bb964f63b4c74d9c1dcd42c87cce79f2470d8f9df
MATLAB
12,164
406
% Creates a bis_image data structure % if fname is specifed then this is loaded from this % debug is a flag (0 to 3) which controls how much printing is done % % Key Functions: % load -- loads from a filename (.nii.gz) % save -- saves to a filename (.nii.gz) % getImage -- returns Image Struct...
cb50b0131e932c7d9e6c235745431124507e4226518b302e610173f0a55460ce
MATLAB
12,167
277
%% Thomas_Yang_et al, 2023 @Nuo Li lab %% Fig. 1i, performance with unilateral SC photoactivation with vglut2-ires-cre x Ai32 mice clear all close all load Figure_1_i_data perf_Raw_all = [] n_mice = 0; for i_mice = unique(Session_type_allSession(:,1))' n_mice = n_mice+1; %% --------...
8083a80f414aefb173758a90c9ce8a6cbf8d62d5f68352d868bce364d9730457
MATLAB
12,171
397
clear all % PARAMETERS % ========================================================================= subs_parameters % GET INPUT % ========================================================================= % Ask for input exittask = 0; while true getinput = 1; clc; while getinput subID = input(sprint...
45ed5be6aee336b2e97e3d3ad7056b8374881379aa34149d4faf7037375c887a
MATLAB
12,191
453
function ob = Gtomo_blob(mask, dim_data, varargin) %function ob = Gtomo_blob(mask, dim_data, options) %| %| Construct Gtomo_blob object, for fast forward and backprojection. %| INCOMPLETE, WORK-IN-PROGRESS! %| %| Currently handles 2D parallel and fan-beam cases. %| %| See Gtomo_blob_test.m for example usage. %| %| in ...
67492a5132ee62ed1214488eec23c50280d4c4f6acfeeded294ab136c5c61fa0
MATLAB
12,223
467
function [T, reuse] = Gnufft_gram(ob, W, reuse) %|function [T, reuse] = Gnufft_gram(A, W, reuse) %| %| construct Toeplitz gram matrix object T = A'WA for a Gnufft object %| in %| A [M np] Gnufft object (Fatrix or fatrix2) %| W [M M] W = diag_sp(wi) (often simply "1" or []) %| W = Gdiag() for fatrix2 %| reuse str...
1bfaf867eb781735df669a17d581090d589c66a35520ca7fe3ffe06ee6995fb2
MATLAB
12,227
266
%% Plot preprocessed data for cleaning with Bob % 1) Load preproc data (downsample, highpass, trim, notch) % 2) Plot data to identify bad channels and epochs clear all; %close all; addpath(genpath('/home/knight/hoycw/PRJ_Stroop/scripts/_TOOLBOXES/')); addpath('/home/knight/hoycw/Apps/fieldtrip/'); ft_defaults SBJ...
3d655780df1c5d84d86d957219fca5a2654c0e60a4dafa8d269d8d61713e9df0
MATLAB
12,230
199
% SPIKE COUNT FOR BAYESIAN DECODING FOR THETA SEQUENCES % Method to extract spike count using time bins based on theta phase. % First,extracts theta phase during running and bins it. Then finds spike count for each phase bin. % Finally, converts phase bin edges back to time and calculates spike count used in bayesian ...
e72b9313b6e4295915f00222660aaf86eb5a85a39fc6ea1dbea2c98e95bca76e
MATLAB
12,254
356
% Script to plot Figure 7, calculate statistics reported, and save data to % Excel spreadsheets that are then imported into the Source Data file. % Kit Longden 2023. addpath ../../src/Shared_functions/ % Figure properties % ----------------- fig_h7 = figure(7); set(fig_h7, 'color', 'w','Position',[1500 500 800 1000])...
cfce90d9b22be19dd9a19491e181e7e6d211f99532a6849f99b8eaf158d1102a
MATLAB
12,263
401
function [M0_ml, M0_rls, T2_ml, T2_rls, ml_time, rls_time, cost] ... = mri_spinecho_m0t2map_v3(y, TE, varargin) %function [M0_ml, M0_rls, T2_ml, T2_rls, ml_time, rls_time, cost] ... % = mri_spinecho_m0t2map_v3(y, TE, varargin) %| %| Penalized weighted least-squares T2 mapping from (single) spin-echo %| image datasets...
4b25dbb2a8128f9e1ae0764a8344b35337907a759c2aabe40443493f11844b08
MATLAB
12,275
218
% PLOT DECODING ERROR ACROSS LAPS % Uses information extracted with 'bayesian_decoding_error_exposures.mat' to plot median decoding error for each exposure(compared to same track other exposure or to another track's exposure). % Plots for each rat, for each protocol, and a figure with all protocols overlapped (showing ...
5bc4c0f9628f6526200b0e5467f2bf98765cd9a66646892032efd2d1c8f89d38
MATLAB
12,284
310
function [SPM] = spm_fMRI_design(SPM,save_SPM) % Assembles a design for fMRI studies % FORMAT [SPM] = spm_fMRI_design(SPM) % % 1st level %-------------------------------------------------------------------------- % SPM. % xY: [1x1 struct] - data structure % nscan: [1xs double] - nscan(s) = number of scans in s...
61f6dca39fb0eae34c706532d9e596615421d08afeec1734970e7cf1039d1caf
MATLAB
12,292
328
function create_track_decodingError_figure % CH1: DECODING ERROR - confusion matrices cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Decoding_error\figures\Track decoding error' PORA8 = openfig('P-ORA_Day5_16x8_confusion_matrices.fig'); PORA4 = openfig('P-ORA_Day4_16x4_confusion_matrices.fig'); POR...
8f1bf44084eec9c0510d30301d10f11f55bb0599684b3c6ab41b6aaa5990e55b
MATLAB
12,336
105
function trainOptimize(N) % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior U...
f29931e8c307741e0ee583df7aa70c9b3b206955439f0e325a0aacc9d72364e6
MATLAB
12,349
276
function SBJ08f_HFA_plot_grp_GLM_onsets_ROI(SBJ_id,proc_id,an_id,model_id,stat_id,roi_id,... plt_id,save_fig,varargin)%gm_thresh,z_thresh, % Load HFA mGLM results to plot onsets of signifcant effects per ROI % Also shows t-test for onset differences between ROIs % INPUTS: %...
ac9407580514484d68149b10838b4cd10985a24f43127a8a332b153776d31def
MATLAB
12,381
222
classdef headModelViewer < handle properties hFigure hAxes hmObj hFiducials hLabels hSensors hScalp hSkull hCortexL hCortexR dcmHandle roiLabels = {}; end properties(GetAccess=private,Hidden) DT = []; ...
517161b6091da1130655cde106f78d10a2ebcedf78cbde87ec4b5180c2f56ee3
MATLAB
12,389
246
close all; clear; load('V:\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\Space_bin_filt30Kalman.mat')%no return trajetories from T and goal load('V:\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\GLchc_epoch10.ma...
d430713f2bf1e8bf075f1d51a236a54893e842fce66232c66ec2bc3427c0583d
MATLAB
12,389
304
%% Manually scoring the participants trajectory % In order to the model to fit the data the participant had to demonstrate % a clear intention of completing the triangle. % This did not happen all of the time and therefore we had to exclude some % data. Also we noticed by looking at the tracking data that participants ...
12e2b9e5ad8f7770a80b7aee3f803754ddfcb208cd33c4de9b8238d1c2bfc99d
MATLAB
12,411
458
function varargout = boundedline(varargin) %BOUNDEDLINE Plot a line with shaded error/confidence bounds % % [hl, hp] = boundedline(x, y, b) % [hl, hp] = boundedline(x, y, b, linespec) % [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2) % [hl, hp] = boundedline(..., 'alpha') % [hl, hp] = boundedline(...
8416506ced371acb1bc9f806bea0c0b456af8419f29002809ed50a674e5afc42
MATLAB
12,413
253
%% Run one-sample t-test & extract eigenvariates from ROIs % (c) Carys Evans, UCL % carys.evans@ucl.ac.uk % October 2019 %This script requires SPM12 %Run this script on the smoothed normalised emag files. This script runs a %one-sample t-test on the E-field magnitude images. The script also %extracts the eig...
fb265f6d5efba43c575b44fdb9863c2f2ce661a4f5b6588a87306a795eadac5f
MATLAB
12,413
415
% source code to produce analytical predictions % for 2d fast variance predictions paper for IEEE. % % Empirical and FFT_based predictions are computed and saved % % Copyright by Yingying Zhang-O'Connor, University of Michigan 2006 clear clc % ------------------------------- % set up parameters % --------...
f3eb5b9ee34ec4478c69be8cda8787bef584f5717eb7a826ae7cbf8197aad044
MATLAB
12,437
349
%CREATECALIBRATIONMAP Creates a voltage-position calibration map. % This file creates an artificial calibration map using simulated camera % data. Can be easily enhanced providing real camera images with the % corresponding voltage maps. % program modes: [1, 2, 3] => [acquisition, evaluation, simulation] acquisition =...
7799bda8d90de164fc7eedf1cb2f7b57260c206f69bcb22e9f7da582643dfd95
MATLAB
12,447
273
% CONTROL THETA SEQUENCES: CORRELATION PLOTS function control_correlations data_folder = 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 3\Theta sequence scores'; load([data_folder '\session_thetaseq_scores.mat']) load('X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 3\Theta sequence scores\t...
a12553992471229e4028cfe2ce8b1d2762ce32cb1923287b0b50e8668d8a0f4d
MATLAB
12,453
414
%% addpath(genpath('/home/users/attialex/AlexA_Library')); addpath(genpath('/home/users/attialex/spikes/')); %% find sessions based on table %session_info=readtable('/oak/stanford/groups/giocomo/attialex/NP_DATA/session_summary.xlsx'); session_info=readtable('/oak/stanford/groups/giocomo/attialex/NP_DATA/AA_sess...
6b4c5f02e34b448b56a2071c70d14a0620d71b5fdb97f673942bda43daa17513
MATLAB
12,461
298
function [results,CondTable] = RunStaircase(cueQuint,cueTarg,nrStaircase,nrTrials,nrReversals,ScreenCol,fs,SwitchKbWait) % % Determining detection threshold of gap detection in a stimulus with the Psychtoolbox % % % Input: % cueQuint = standard stimulus of 2 quintets; at each staircase level % cueTarg...
8392444fe7c6acdbe25770330e69f27f8a623a5c548abedb139a474793c6efd6
MATLAB
12,482
366
function [QA] = NWB_QA_graphs(nwbAll,units, is_sternberg) % NWB_QA_graphs Generates behavioral and spike sorting metrics used in the SB % data release. % nwbAll: A cell arrays containing all nwb files in the dataset % units: A units struct created using NWB_SB_extractUnits % is_sternberg: 1 or 0 logical if stern...
29ccf7a7496e1e19eed63ac7c85a477d00ea1577067bc2a0fc95308c21c93a4c
MATLAB
12,484
244
% CHAPTER 1 PIPELINE % Marta Huelin function chapter1_pipeline(section,computer) if isempty(section) section = 1:1:4; end %%%%%%%%%% REMAPPING if any(ismember(section,1)) % Population vector analysis with shuffle for global remapping (there's code for rate remapping shuffle not being used curren...
c40f8f81667a9d6bf2136e8b66737fb11df2e9e082d159ac3fccfcac5cf03b08
MATLAB
12,494
501
function [data, coord, dims] = fld_read(file, varargin) %function [data, coord, dims] = fld_read(file, options) %| Read data from AVS format .fld file. %| %| options %| 'dir' '' prepend file name with this directory (default: '') %| 'raw' 0|1 1: return raw data class (default), 0: return doubles %| 'slice' int specify...
af7fe3261ad6b3527a18fcd070f72b5c712d7144250ed809db67f2bf6b457614
MATLAB
12,501
314
% Script to plot Figure 2, calculate statistics reported, and save data to % Excel spreadsheets that are then imported into the Source Data file. % Kit Longden 2023. addpath ../../src/Shared_functions/ % Figure 2 properties % ------------------- fig_h = figure(2); set(fig_h, 'color', 'w','Position',[1500 500 800 1000]...
379ce01d53a8f9a1b163bda86d6cd863f2737deac66edcef759fa86aca82e0a4
MATLAB
12,510
340
function METriggers_M1(sesDir,rootDir,outDir,wi) %% input: % sesDir session directory % rootDir data root dir % tsDir rootDir of time-stamps % outDir output % wi width of smoothing kernel %% LOAD ME DATA sesDir_raw = strrep(sesDir,'M1_','le_'); ...
edbf194ebc8b33cccb28ea0510db96b7230835560bdf2619ba5b008f7d2dcab1
MATLAB
12,519
310
function [pred_bins, pred_xy, post, px, py, model, R_all, edges_all, gt_bins, gt_xy, gt_x, gt_y, t_mid, x_error, y_error, err_euclid] = decode_position_from_ratemaps( ... Data, CellSel, DecodeWindows, BinSize, x_dim, y_dim, RateMapsIn, varargin) % DECODE_POSITION_FROM_RATEMAPS % Bayesian XY decoding using *ext...
f1e85bd7d08057887904fe8fe131cf97c995f9984f11efbb97ae7d3bc479e0d8
MATLAB
12,522
429
function [age,bestIter] = matchIterationToAgeSegregationExperimentScore(obj) disp('Deprecated, use matchIterationToAgeSegregationExperimentDist.m') assert(false) % We use Dans parameters as starting points for nlinfit [WTfit,B2KOfit,SCsize] = obj.getDanSegregationFits(); % These files are for the AP...
aeb484b1669ec834f47f1ceccf75fe252155754b0841f0f49ce8df9c2808129a
MATLAB
12,528
244
% CHAPTER 1 PIPELINE % Marta Huelin and Masahiro Takigawa, 2023 function place_field_analysis_pipeline(section,computer) if isempty(section) section = 1:1:4; end %%%%%%%%%% REMAPPING if any(ismember(section,1)) % Population vector analysis with shuffle for global remapping (there's code for rate...
04308d58e2547f02bbadc302248472328c4eba4d7892447e4545cf4dd7eb1548
MATLAB
12,563
377
%% Figure 4f % this script rungs additional analysis required for the plots of figure % 4f. %% clear ft_defaults rng('default'); %% - SUBJECTS - %% % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OSL31', 'OSL32', '...
d2e7904ac308262ff3c5e623fe8dd5c3ad27ffa8c7906fb4384dd5cc152cc194
MATLAB
12,572
392
function findArtifacts() [filename,pathname] = uigetfile({'*.tif';'*.TIFF'},'Open file', 'MultiSelect', 'off'); fileName=fullfile(pathname,filename); scrsz=get(0,'ScreenSize'); text_si=18; set(0,'DefaultAxesFontSize',text_si,'DefaultFigureColor','w', 'DefaultAxesTickDir', 'in','DefaultFigureWindowStyle','normal',.....
408b3f048572c2167f41f57a6948fb3d7a47d30c9d6216e9201c0e61927b1017
MATLAB
12,624
444
function wt = Rweights(kappa, offsets, varargin) %|function wt = Rweights(kappa, offsets, [options]) %| %| Build "weights" for roughness penalty for regularized methods. %| Intended to be used internally by roughness penalty object Reg1. %| %| General form of roughness penalty: %| R(x) = sum_{m=1}^M sum_n w[n;m] pote...
7ccd72b083b8f9003c47aa2a5cd7d0a4143740cf9e024809006175f3bc832817
MATLAB
12,631
410
function truesize(varargin) %TRUESIZE Adjust display size of image. % TRUESIZE(FIG,[MROWS NCOLS]) adjusts the display size of an % image. FIG is a figure containing a single image or a single % image with a colorbar. [MROWS NCOLS] is a 1-by-2 vector that % specifies the requested screen area (in pixels) that t...
516b086f58e082380b7ef5627f1a03e8386c3a27037af3d8d13f78ba8a351f3c
MATLAB
12,682
413
function h = c_fig_arrange(varargin) % c_fig_arrange - arrange one or more figures % Makes it easier to quickly visualize data spread across multiple figures with options such as tiling % sets of figures across specified monitors, etc. % % Possible general actions include: 'maximize','tile','show','close','link'. % Ca...
d30b499830cd0afc58f48ae2b43b43e8a53df6dc54cd80fb9da66a35a4afc8fd
MATLAB
12,685
489
% ABC rejection method clear tic n = 1000000; % number of sample parameters from range percenttoaccept = 0.2; % Modes mode = 0; % 0 - average of data points at a certain day % 1 - finds the closest data point % 2 - min of data points at a certain day % 3 - max o...
20eb23af5566b6b566030e04e4fb9224bf27a535800eb61650a66cee56f6dc0b
MATLAB
12,694
468
% This function takes a RetinalMap object and returns the results % from the Willshaw grid analysis % function [results,figHandles,P] = willshawGrid(obj,fakeID,projType) if(~exist('obj')) disp('Did you forget to specify the RetinalMap object?') results = []; figHandles = []; return end if(~ex...