sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6b9dcd6ca49c1a4d25f84d410a7d470e99e3fac4fa970050c0595828aa07adc6
MATLAB
4,061
119
function params=tpreadconfig( tpdirname ) %TPREADCONFIG read twophoton experiment config file - TiffStack % % PARAMS = TPREADCONFIG(TPDIRNAME) % % Reads parameters for a generic TiffStack directory. % % There must be a text file with the extension .tiffstack % This file should contain the following lines: % parameter...
4ede9ec9329984576b49ee342198c5dfcd5abe46a078c5c5072509fd5aceebdd
MATLAB
4,067
147
function [Theta0,Re0] = lme_mass_fit_init(X,Zcols,Y,ni,maskvtx,prs) % [Theta0,Re0] = lme_mass_fit_init(X,Zcols,Y,ni,maskvtx,prs) % % Starting values at each location for the linear mixed-effects iterative % estimation. These starting values are based on the ordinary least squares % estimators (OLS). % % Input % X: O...
f93425064d8be8fd093eaa1ec12032366a5479b6424e7d56a61e2679e04e3f53
MATLAB
4,068
152
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% read in proc spreadsheet filename = [ DD_PROC '/MamiNum_corrected_proc.txt' ] ; ssheet = readtable(filename,'Delimiter','\t') ; animal_names = regexprep(ssheet.file_prefix,'_FF3_all...
2e028fb6b03939ead8174b62db25de6376d529be8bdbbc9bb0dcc5f8081c264c
MATLAB
4,072
175
function varargout = ep_AddSubject_SanesLab(varargin) %S = ep_AddSubject_SanesLab.m % %Custom function for adding a new subject for a Sanes Lab experiment. % %Created by ML Caras Jun 9 2015 % % Last Modified by GUIDE v2.5 09-Jun-2015 14:45:49 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = str...
1ac5ff92bd7756b2109f8e0cabd0bffbbe66fbc6627f3a2b88431964a634a115
MATLAB
4,074
104
function [epi, cross_pl] = import_epi_geom(direpi, fepi) % IMPORT_ENDO_GEOM Imports the nerve's epineuriums contour. % The code import the .STL files of the nerve's epineuriums and convert % the geometry file in a tomogrpaphy representation of the 3D scapes of the % epineurium % All the imported contours are giv...
93505cb4c75b6158490651d214fc5944a8b930b452dd491ffe49515d84e842cf
MATLAB
4,076
119
function C = voxelCoverage(Pstat,threshold,Patlas,Tareas,verbose) % C = voxelCoverage(Pstat,[threshold],[Patlas],[Tareas],[verbose]) % % Inputs: % Pstat ... Filepath to statistical .nii volume % threshold ... Statistical threshold values. If a single value is % specified, then a negative ...
9a64bd05caf4ed247c7e30d8a9e63380b496e917e4d6e373a631d6d7b12385d3
MATLAB
4,081
89
%%% To plot Arnold tongues of the sine circle map (potentially with %%% dithering) based on data generated using code in the folder SCM_genData %%% 26-01-23 first commit close all clearvars dataDirToLoad = ['..' filesep 'SCM_genData' filesep 'test']; %directory with data to load alphaOutsideTongues ...
d5ff676022129c33ed8fe1fab4c34550948ec6fb1993fdfe9ab290f8ce772b4c
MATLAB
4,081
146
function cm_data = my_bwr( m ) % Copy of PiYG from matplotlib (diverging colormap). % From %https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py cm = [... 0.007843 0.007843 1.000000; 0.023529 0.023529 1.000000; 0.039216 0.039216 1.000000; 0.054902 0.054902 1.000000; 0.070588 0.070588 1...
597e165d25465e21b42d24cd4d0a00cb4869baea84ef66398f94e2d9704e15f4
MATLAB
4,085
146
function cm_data = my_seismic( m ) % Copy of PiYG from matplotlib (diverging colormap). % From %https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py cm = [... 0.000000 0.000000 0.310980; 0.000000 0.000000 0.332941; 0.000000 0.000000 0.354902; 0.000000 0.000000 0.376863; 0.000000 0.0000...
0fe4af95bf03f9111bd4a843557185ac106a5326d78705f166db25680ee7668f
MATLAB
4,086
146
function cm_data = my_coolwarm( m ) % Copy of PiYG from matplotlib (diverging colormap). % From %https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py cm = [... 0.234377 0.305542 0.759680; 0.243520 0.319189 0.771672; 0.252663 0.332837 0.783665; 0.261805 0.346484 0.795658; 0.271104 0.360...
24894c6c3d6a124466d18b56a410a9f2cd602f4451dafcde7b7109a666d29560
MATLAB
4,087
100
function Out = DeepInsight_train_norm_CAM(XTrain,YTrain,XValidation,YValidation,Parm) % Out = DeepInsight_train_norm_CAM(XTrain,YTrain,XValidation,YValidation,Parm) if nargin <5 Parm.UsePreviousModel = 0; end if Parm.UsePreviousModel == 0 % change parameters as desired if Parm.MaxObj>1 if Parm....
dd8da8571e7afe6eac7cf6b22baba72865b42bc0a14e7b805ca0ff828d748912
MATLAB
4,092
141
function Spike_wave_discharge % Script recreates figure 12 from the manuscript. This plots an example fit % to a spike wave discharge rhythm, recovered from applying each of the % SOEA20, SOEA45, MOEA20 and MOEA45 to data. We note that the data segment % contain an SWD rhythm is not loaded here. See paper for det...
c5b4b53b2835369e3a46d534abbbac469829f2f262730391edec7aa5626f67c5
MATLAB
4,095
116
function [h] = plot_index(study_name, comparison, params, mre) % PLOT_INDEX plot the indexes for boundaries condition confrontation % % [h] = plot_index(study_name, comparison, params, mre) % % Input: - study_name: name of the study % - comparison: structure containing the indexes % ...
97a8344eab74017bd7ee865e658215daf2e61bd8bd9ba0ad81bdf74a0161c796
MATLAB
4,099
123
function CreateLabeledVideos(self, varargin) p = inputParser; p.KeepUnmatched=true; addOptional(p, 'PlaybackSpeed', 1); addOptional(p, 'Scale', 1); addOptional(p, 'FontSize', 18); parse(p,varargin{:}); playbackSpeed = p.Results.PlaybackSpeed; scale = p.Results.Scale; fontSize = p.Results.FontSize; outFolder = fullf...
73ff6019b828f2bdcbfda9b1ded29ed64898b82a22cd6900ff8f6f5bf43cdfe0
MATLAB
4,107
123
%% regularized Horseshoe prior for rank reduction and shrinkage % Combining ideas from % % Chakraborty, Antik, Anirban Bhattacharya, and Bani K. Mallick. "Bayesian sparse multiple regression for simultaneous rank reduction and variable selection." Biometrika 107.1 (2020): 205-221. % % Piironen, Juho, and Aki Vehta...
b8ba89abde4c560343cab9cca4f8243a2f0cd33a0878656ed203b3eeeb3e09a0
MATLAB
4,109
117
function step3h_validation_rsa_behaviour(bids_dir, toolbox_dir, varargin) %% RSA between the behavioural similarity matrix and the MEG pairwise decoding accuracies % % % @ Lina Teichmann, 2022 % % Usage: % step3h_validation_rsa_behaviour(bids_dir, ...) % % Inputs: % bids_dir ...
52b2e1f47f6ede8edecb853a1cdc1c322bc6eacf854e4bc561a00488ddbef28a
MATLAB
4,111
141
% Screen('Preference','SkipSyncTests', true); win = 2; w = Screen('OpenWindow',win, 128); ScreenRect=Screen('Rect',w); black = BlackIndex(w); white = WhiteIndex(w); vbl = []; % Get the size of the on screen window in pixels [screenXpixels, screenYpixels] = Screen('WindowSize', w...
b2cc85ed65f727e19cd2b319857eac8f5ade3dcc579feb72733b9661595ee39b
MATLAB
4,112
177
%BLP_PhotometryFreezing %di %cd('.\Data\981024FC\video\') %folderN='981024FC'; %cd('.\Data\981024Test\video\') %folderN='981024Test'; %cd('.\Data\981025FC\video\') %folderN='981025FC'; %cd('.\Data\981025Test\video\') %folderN='981025Test'; %cd('.\Data\996403FC\video\') %folderN='996403FC'; %cd('.\Data\99640...
9a6e58816430645a7df3441ba0a646f946f9a6d29dea395f7898235d15596fa9
MATLAB
4,114
121
function [hubs,hubprob,hubdarea,susceptind] = ... hub_sweep(mat,distmat,hubmethod,Nreps,proprand,altdist) % from Gollo2018, get measures of hub fagility and measure the volatility % of the hub distance embedding % % INPUTS: % mat: connectivity data % distmat: distance data % ...
ed9eba5dc1641efd822c56deed9783e5ac4d220930d6cb30f9c4656f8402b3c2
MATLAB
4,114
167
% PURPOSE: pop_duplicatmvpc.m % duplicate MVPCsets % % FORMAT: % [ALLMVPC, MVPCcom] = pop_duplicatmvpc( ALLMVPC, 'MVPCArray',MVPCArray,... % 'Saveas', 'off', 'History', 'gui'); % Inputs: % %ALLMVPC -ALLMVPC structure %MVPCArray -index(es) of MVPCArray % *** This function is part of ERPLAB ...
c68a093d9af819527efa7a8120ee39416bab6bb5652b371b63049756453ab554
MATLAB
4,124
86
% arbWeibull Evaluation of an arbritrary function; based on Weibull % funciton. only accepts positive values of alpha. % % syntax: y = arbWeibull(params, x, threshPerformance) % % threshPerformance = the performance at which you wish to hold performance % % y = arbWeibull(params, x, threshPerformance), where 'p...
11e23961a9dfdc5a08b7bf255530cb441c930aa24c237d9857f30aa84609aca9
MATLAB
4,125
153
function [thresh, reject] = calculate_thresholds( Phys, segment_length_s ) % [thresh, reject] = calculate_thresholds( Phys, trial_length_s ) % Called by pp_sort_session. Launches a gui in which a random trial is % selected and filtered Phys data is displayed for 4 channels at a time. % Waits for user input, t...
d24e6aa9f28bf2847823826f7323610e288a15891128aa7d893d4b78771a1fe4
MATLAB
4,125
127
function varargout = UMSLoadingEngine(fn,varargin ) % [t,wv] = UMSLoadingEngine(fn) % [t,wv] = UMSLoadingEngine(fn,records_to_get,record_units) % % Modified version of the OpenEphysLoadingEngine % %MClust Loading engine for reading in tetrode data collected with %Open Ephys GUI software (http://open-ephys.org...
3093671b92e0d8151eaedb73448842d93fd15ee5e2a91a6431b67c5106c536fd
MATLAB
4,127
133
function DB_UpdateUnitProps(unit_id,P,groupid,verbose,conn) % DB_UpdateUnitProps(unit_id,P,groupid) % DB_UpdateUnitProps(unit_id,P,groupid,verbose) % DB_UpdateUnitProps(unit_id,P,groupid,verbose,conn) % % Updates unit_properties table of currently selected database. % % Accepts a unit_id (from units table) and P...
88058a8457923227c79ed508fea1b35e9f4c42522eb0aa4e321e3e301f177903
MATLAB
4,136
126
function mni_coords = ieeg_mni305ThroughFsSphere(elecmatrix,hemi,FSdir,FSsubjectsdir) % % Convert electrodes in native space to MNI through surface based % registration (through Freesurfer sphere). Since it is surface based, % it should ony be used for ECoG. % % Input: % elecmatrix: nElec x 3 in the original T1 space...
9818cbd91def31735d40f23f9f3eb03de015578886c2ec342a1969885c01361e
MATLAB
4,147
173
function plotContinuous_SanesLab(timestamps,TTL,ax,clr,xmin,xmax,varargin) %plotContinuous_SanesLab(timestamps,TTL,ax,clr,xmin,xmax,varargin) % %Custom function for SanesLab epsych % %This function plots TTL data in realtime as a continuous, scrolling plot. %Using the MATLAB plot feature each time the graph must update...
a9f00758588c13fbc001faded865cf7c04abc20ed596aea446f7a9b6263dffda
MATLAB
4,147
97
function slope = getSlopePC(result, pCorrect, unscaled) % function slope = getSlope(result, pCorrect, unscaled) % This function finds the slope of the psychometric function at a given % performance level in percent correct. % % result is a result struct from psignifit. % % pCorrect is the percent correct where to evalu...
4a4cefcb7b88e95d971c7bbbbb6bd33bf5ea2bd36ccddcafa3dd34d1938fd54b
MATLAB
4,160
143
function C = textscanu(filename, encoding, del_sym, eol_sym, wb) % C = textscanu(filename, encoding) reads Unicode % strings from a file and outputs a cell array of strings. % % Syntax: % ------- % filename - string with the file's name and extension % example: 'unicode.txt' % encoding - en...
3f2a69f358dccd83f1fa174e10dcfc4b34b28e64fd5f6c08ccc684a05726e878
MATLAB
4,162
69
% Code for Stress Analysis of CNS from 2D velocity data % Reads data in Set.DispFile. Datafile *.mat in the folder contains: *File % inside folder contains: % XEul(:,i) = list of x positions in pixels at time i where velocity is read (Eulerian coorindates, fixed in space) % YEul(:,i) = list of y positions in pi...
a1543677fdf69f9d3126c28e770d309178bd5f43d0bc19ce070e55e9caaf3cf2
MATLAB
4,162
110
function [ out, tr ] = recalcFalseAlarms( tr ) %% script to recalculate actual false alarm rate % based on using the timing from all available Go trials and checking if % for any catch trial the monkey would have done a false alarm or not %% Calculate the time limits for every Go trial, defined after stimOn (t=0) fo...
5c9be533c553bfe968969487be123261a94664cdf8fd104e0e53fbb0c6f399b3
MATLAB
4,163
61
% TwoPhotonUserInit -a user-editable file to customize the TwoPhoton library's operation % % TWOPHOTONUSERINIT % % Users can edit this file to add any features specific to your particular user % needs % analyzetpstack_active_draw_devices('add','import_imagejrois','import_imagejrois',struct('default_filename','R...
2a711bd1c9a3afd393bcb38ad82f8ecc1c879e2311c12c8d61a7adeb32250f80
MATLAB
4,166
114
function [pos_peaks, neg_peaks, empty_regions, water_regions] = classify_regions(region_mask) % CLASSIFY_REGIONS Classifies signal regions into peak types, water, and empty regions. % % Inputs: % region_mask - Mask of the same length as signal containing values: % 1 = Positive Trend % ...
8764e55e99cbf98ece95cd236fe810ebc9db04872ca0825b70efe0d184c8ac6d
MATLAB
4,175
102
function [results] = scaleDWB5(results, params, spkHistPrior_setup, addPriorForWB, couplingGroup, precomputedPortion) % i.i.d non-mean Gaussian over spike history coefficients & constant K = size(params.B,1); K2 = K/2; w_mu_idx = 1; w_sig_idx = 2; H = double(params.H); %w_mu = H(w_mu_idx); log_w_sig = H(w_sig_i...
db61433bb5f077695b77349582ef11f2901576931eff4f8c0d9dac6e1bf71569
MATLAB
4,176
123
function [avgFR,seFR,Ft2,Rt2,Ft2ciL,Ft2ciH]=DecodeStatsMultiOutcome(FR,reg) % Fisher F-test based classifier/decoder for multi-way comparisons (>2 Outcomes) % Aleksander PF Domanski PhD UoB 2017 % aleks.domanski@bristol.ac.uk % % Input Variables: % FR: Firing rate matrix [time x no. Units] % evt0: Event catego...
585ef7373db853fc5a25476f442979149f96c0e9b882e4b164164e3fa0c271a9
MATLAB
4,178
134
function He = lme_Hessian(X,Zcols,W,CBhat,L,phi,re,ni) % He = lme_Hessian(X,Zcols,W,CBhat,L,phi,re,ni) % % Hessian matrix of the restricted log-likelihood. % % Input % X: Ordered design Matrix (according to time for each subject). % Zcols: Vector with the indices of the colums of X that will be considered % as random ...
688413d6358576506610717e94cc40f1a6487e4a953690e1057ee7b2a6969fe7
MATLAB
4,179
106
function varargout = guideApp(varargin) % GUIDEAPP MATLAB code for guideApp.fig % GUIDEAPP, by itself, creates a new GUIDEAPP or raises the existing % singleton*. % % H = GUIDEAPP returns the handle to a new GUIDEAPP or the handle to % the existing singleton*. % % GUIDEAPP('CALLBACK',hO...
68bb32452993062eb5c050b438b35e8df1a715797317a948bf315c08f3b92bd2
MATLAB
4,181
112
%% Setup % This script combines sessions from different tastes to make a combined % connectivity matrix between the hemispheres util.clearAll; % stimuli outdir = fullfile(util.get_paths().figs,'combine_tastes'); util.mkdir(outdir) %% load the data and combine betas % Get the beta tables from matfiles taste_str = util....
7c61ab03339e30a3f2fda20c8304ee57dd0b2a346ac7cc1227b2a66db12f08ff
MATLAB
4,189
114
function analyzetpstack_analyzerawall(fig, channel, dsarg, stacknamearg) % ANALYZETPSTACK_ANALYZERAWALL - Analyze raw F from an analyzetpstack stack % % ANALYZETPSTACK_ANALYZERAWALL(FIG, CHANNEL) % or % ANALYZETPSTACK_ANALYZERAWALL([], CHANNEL, DS, STACKNAME) % % Inputs: FIG - the figure number of the analyze...
24cecb36bff84df4808246d9c8ca90171a5cd1cae148d85ea05ed6096b6c87f9
MATLAB
4,190
114
function params=tpreadconfig( tpdirname ) %TPREADCONFIG read twophoton experiment config file - TiffStack % % PARAMS = TPREADCONFIG(TPDIRNAME) % % Reads parameters for a generic TiffStack directory. % % There must be a text file with the extension .tiffstack % This file should contain the following lines: % ...
0b44642e6560412e1f57af296307876e768d11369ca9ad8cf614f8ad3f73892e
MATLAB
4,196
137
load(fullfile(preprocFolder,sprintf('granularLayerBounds_ephys%s',what2Load))); granBound = granBoundManual; %% Save the cell's location for k = 1:P.nMice shankPos = ceil(db(k).C.XPos/200); shanks = unique(shankPos); db(k).C.Layer = ones(1,numel(db(k).C.Depth))*2; for s = 1:numel(shanks) if ~...
4301e118a6486e1545aba51c585dad3b05eb51b2e8078038e48d7a675bd37b5e
MATLAB
4,196
175
% PURPOSE: pop_renambest.m % rename ALLBESTset % % FORMAT: % [ALLBEST, bestcom] = pop_renambest( ALLBEST, 'bestnames',bestnames,... % 'Saveas', 'off', 'History', 'gui'); % Inputs: % %ALLBEST -ALLBEST structure %bestnames -strings for bestsets % *** This function is part of ERPLAB ...
6402b1eda4b3d966a6af34e2db30fa582fa429cb529d251a7079af96aae8f875
MATLAB
4,196
131
function [w,ytest,ytrain,ytest_pred,ytrain_pred,RRRdim] = makePred_paper(y,X,idxfold,model) % y is the data you want to predict (timepoint x components) % X is the set of predictors you want to predict with (timepoint x % predictors) % idxfold are the timepoints you want to leave out in the test set % model is a struc...
0eaa10360e8fcc0d6c44d2135270775bed370cf05e17e0aa37943a76a14d87d4
MATLAB
4,200
130
% PURPOSE: saves new ERPset (and its pointer at ERPset menu) in Matlab workspace. Also, redraws and updates the ERPset menu % including the new ERPset. % % FORMAT % % erp2memory(ERP, indx) % % INPUTS: % % ERP - new ERPset % indx - ERPset's index or pointer (according to the ERPset menu and ALLERP) % % % A...
65b9634ea5b3c07e60ee1a0e76cca3b207b2cbb8b033b0be3fa23252f8f7d4aa
MATLAB
4,205
111
%% Calculate basic statistics for an OH/OHA/TOH/TOHA trial % For a single trial, calculate the frames where targets and distractors % are created and the frames where hits, misses, drops (successfully % missed distractors), and crashes (unsuccessfully avoided distractors) % occur. % Copyright (C) 2022 Richard Hug...
caba253f763af2153678febe3563f5cbdc83ecaf1ed0e4d568e73d7598156bae
MATLAB
4,206
108
% PURPOSE: subroutine for % reseting flags (user and artifact ones) % % FORMAT: % % EEG = resetflag(EEG, flag); % % INPUT % % EEG - epoched dataset % flag - binario converted to decimal. % indexEL - EVENTLIST index (in case of multiple EVENTLISTs) % % ERPLAB's flags are ...
00c3bf48691a709856f97785971725a272371775cbe2b205e05b08c64614da09
MATLAB
4,208
175
% PURPOSE: pop_renamemvpc.m % rename ALLMVPCset % % FORMAT: % [ALLMVPC, mvpccom] = pop_renamemvpc( ALLMVPC, 'mvpcnames',mvpcnames,... % 'Saveas', 'off', 'History', 'gui'); % Inputs: % %ALLMVPC -ALLMVPC structure %mmvpcnames -strings for mvpcsets % *** This function is part of ERPL...
0a17c77a1cda8378104d6a4125a33cae58eab61080b2289ac13403d805ca0dc1
MATLAB
4,211
132
function [cfx,cfreqso] = morletWaveletTransform(x, fs, cfreqs, morletParam, dim, plotFlag) % Takes the complex Morlet wavelet transform of time series data and plots % spectrogram % % ARGUMENTS: % x -- 1xT vector time series or multi-dimensional vector with time % specified in dimension DIM % fs ...
b5cb235f9a9272d4316cb665df71d421e3b99029205d1bff8955a3c1e4fd272b
MATLAB
4,211
132
function [cfx,cfreqso] = morletWaveletTransform(x, fs, cfreqs, morletParam, dim, plotFlag) % Takes the complex Morlet wavelet transform of time series data and plots % spectrogram % % ARGUMENTS: % x -- 1xT vector time series or multi-dimensional vector with time % specified in dimension DIM % fs ...
3f5711cb75984190ff49d293bfd71291e7b4b1c77a7be33ee2017330bf878d23
MATLAB
4,213
135
function motifs = temporalMotif(symbolSeries, lengths, weightFlag, removeCycleFlag) % TEMPORALMOTIF finds temporal motifs in the array SYMBOLSERIES containing % integers 0 to n representing different behaviours in a time series. % % Method taken from "The Motif Tracking Algorithm. Wilson, Birkin and % Aickelin, 2007". ...
62beade12aa75bff5d9c22ee788780e8b9f2921abe83313a55dc9ccf1e77d8a4
MATLAB
4,217
116
% Plot individual/population assembly decoding performance % % Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk clear all; close all % start in directory holding decoding results bw=0.05; iFRtyp='iFR'; load(['ASSEMPopDecodeStats_' iFRtyp num2str(bw*1e3)]); % load([pat 'ErrTrDecodeStats_' iFR...
ba2c3bf3162aa657f5b72e88a3f294187b8844afe97778ba2e7c8851ca749b83
MATLAB
4,217
112
function EEG=reject2marks(EEG) if ~isfield(EEG,'marks'); if isempty(EEG.icaweights); EEG.marks=marks_init(size(EEG.data)); else EEG.marks=marks_init(size(EEG.data),min(size(EEG.icaweights))); end end %CREATE MARKS.TIME_INFO INSTANCES FROM REJECT STRUCTURE FIELDS... if ~isempty(find(EEG.rej...
d9d2b99b7e81db9af33e5093cb64607a3431d9e89b70cb13ad43b863d0f49dcf
MATLAB
4,227
122
function [mappedX, mapping] = npe(X, no_dims, k, eig_impl) %NPE Perform the Neighborhood Preserving Embedding algorithm % % [mappedX, mapping] = npe(X, no_dims, k) % [mappedX, mapping] = npe(X, no_dims, k, eig_impl) % % Runs the Neighborhood Preserving Embedding algorithm on dataset X to % reduce i...
b2ac051ad9340027bf6433378c13892b94c634c32ab337a9583d223c1c485e35
MATLAB
4,229
175
%function FM_sweep_testing() % close all; % Define RCX file handles.RPfile = 'C:\gits\epsych\UserFiles\SanesLab\RPVdsCircuits\Sandbox\KP\AM_jitter_Macro_DurTest.rcx'; % handles.RPfile = 'C:\gits\epsych\UserFiles\SanesLab\RPVdsCircuits\Sandbox\KP\AM_jitter_Macro_DurTest_180shft.rcx'; %Load in speaker calibration fi...
8b6ac2925cf15a147957464a99ec1161ad88a1879b1a3f05da15e3b9fb6feb4d
MATLAB
4,237
135
%% runs an HMC step with a diagonal M matrix (M should be a column) % % I had previously programmed up HMC for the GMLM to try geodesic Monte Carlo, but I found no benefit. % I wound it back to the simple HMC step. % % Takes in a negative log posterior function (return [nlpost, dnlpost] given vector of parameters) % ...
5584ae0f8123258be30af100fec51413dbbab82899e271de11a223d8a820149b
MATLAB
4,238
127
% % % This code is used to the plot for Figure 1C and Figure 3A - the normalized CCEPs of all patients in order of age, % % %% % Load the ccepData and ccepAverages from the derivatives clear close all warning('on'); warning('backtrace', 'off') myDataPath = setLocalDataPath(1); track_path = fullfile(myDataPa...
913dd848123206452dfeeeea3ec64c4bf1762f5b307431ec0ea1ca52369bbb46
MATLAB
4,238
154
function varargout = makedatatip(hObj,index) %MAKEDATATIP Adds data tips to specified data points of graphical objects. % % MAKEDATATIP(HOBJ,INDEX) adds a datatip to the graphical object HOBJ at % the data point defined by INDEX. % % HOUT = MAKEDATATIP(...) returns handles to the created datatips. % % If HOBJ is 1...
d6e74b1a2190fd5e2b5031323e6f4fa1683556348ae5365a2d2279c1c9d0ec77
MATLAB
4,239
167
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% read in proc spreadsheet % filename = [ DD_PROC '/MamiNum_corrected_proc.txt' ] ; % ssheet = readtable(filename,'Delimiter','\t') ; % % animal_names = regexprep(ssheet.file_prefix,'...
4caaee60f1b8b52865f600488e7708b1ab578ff11c972cf9bd79ffe67e081760
MATLAB
4,244
141
function handles = initializeCalibration_SanesLab(handles) %handles = initializeCalibration_SanesLab(handles) % %Custom function for SanesLab epsych % %This function prompts user to select and load a calibration file, and sets %the normalization value correctly in the RPVds circuit. If an incorrect %calibration file is...
039d258c4f2fd0f9200b57384dabbfecbeba83f57e12e873b4e2ddbd50d99d83
MATLAB
4,250
110
% ---------------------------------------------------------------------- % RF=update_arbitrary_pf(RF,amplitude,response,threshPerformance) % ---------------------------------------------------------------------- % Purpose: Update an arbitrary psychometric function (PF). % The PF is arbitrary to the extent t...
d3dabf2ced126c367b30bfd08bd3e4cbf49bd48b61387725a1e5731f8d3578d9
MATLAB
4,264
157
function vprintf(verbose_level,varargin) % vprintf(verbose_level,[red],msg,[moreinputs]) % % Prints timestamp and text to the command window based on the current % value of the global variable GVerbosity. GVerbosity is a scalar % integer value between -1 and 3: % -1 log message, but do not print to screen % 0 suppr...
cbf24268b6aa147e501af594e00807784a1b0e7899898cdc8a5bc70550ac78ac
MATLAB
4,268
106
% Prototype wrapper code for calculating smoothed estimates of firing rate by optimised kernel density smoothing. % % (c) 2014 Daniel Durstewitz, Bernstein Center for Computational Neuroscience, CIMH/ Heidelberg University % Edited by Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk % % % For ...
ff134ec3cda06ad87c714e6bbb5b849abba60a449570cef3f9a37b369cf21e39
MATLAB
4,270
140
function ieeg_elAdd_sizable(els,r2,varargin) % function ieeg_elAdd_sizable(els,r2) % % els: rows = electrodes, columns = xyz % r2: for size % % ieeg_elAdd_sizable(els,r2,maxr2,max_elsize) % % optional inputs maxr2 and max_elsize % maxr2 (varargin{1}) maximum for scale (if {''} absmax) % example: ...
20ef03e388c89647b745cc02fbf1ea8c9dd342786cdea8ee7615e13fbc0c05e3
MATLAB
4,272
141
function eda_save_text(eda, fs, edr, conds, ftxt) % EDA_SAVE_TEXT Save EDA results in text file format % EDA_SAVE_TEXT(eda, fs, edr, conds, ftxt) % % Required input arguments: % eda - 1-by-n vector of EDA samples % fs - sampling rate (Hz) % edr - structure array of electrodermal response (EDR) (s...
6f441cd0e2ab3e8f2a2bf87f4ad21c39e7fe5dae460dbe423fe90f54952224b2
MATLAB
4,274
127
function mni_coords = ccep_mni305ThroughFsSphere(elecmatrix,hemi,FSdir,FSsubjectsdir) % % Convert electrodes in native space to MNI through surface based % registration (through Freesurfer sphere). Since it is surface based, % it should ony be used for ECoG. % % Input: % elecmatrix: nElec x 3 in the original T1 space...
8911688ee38f67a86ccc7b98a4a084bfc48c45d92688a37ca2c399e25d761e47
MATLAB
4,279
168
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% read in proc spreadsheet % filename = [ DD_PROC '/MamiNum_corrected_proc.txt' ] ; % ssheet = readtable(filename,'Delimiter','\t') ; % % animal_names = regexprep(ssheet.file_prefix,'...
7c3391bf43c5133dfddd453645d85e7fcad4ddc8fec3bbbfcebb46cf921f2647
MATLAB
4,286
87
function [I_ion, S, Sinf, invtau, b] = processReaction(V, S, Sinf_old, invtau_old, b_old, dt, I_stim, I_stim_old, cell_models, model_assignments, mesh, second_order, extra_params) % This function applies Rush-Larsen integration to process a timestep of % length dt, according to the cell model specified in input variabl...
e021300995527a3efaf09797690ab3257eac6fdad80cfa9ba964354e0da4ff74
MATLAB
4,288
103
% CHECK IF CORRECT (ADDED VARARGIN TO BE ABLE TO PRODUCE 10S OF SOUND) % % POTENTIAL ISSUES FOR PRODUCING WHITE NOISE, BUT NOT USING WHITE NOISE FOR % NOW. % % sound_signal = GENERATE_1S_SOUND(sound_frequency,sample_rate) % % Generates data for 1s of sound, of given sound_frequency and at a given % sample_rate. % % % ...
504aaa3c7385d2013338cc0d7d5bafdf1bda15dc5314ae4ab3723986d17ed697
MATLAB
4,297
127
function crop_static_3d(cropped_size, overlap, static_path, save_path, save_all, pixel_threshold, var_threshold, bitdepth) %%% crop small 3-D stacks into training data %clear % path(path, '_utils') % cropped_size = [176, 176, 31]; % overlap = [0.5, 0.5, 0.]; % pixel_threshold = 1e5; % var_threshold = 1e0; % % % save...
edfbf8dcaedd260c0bab191b2128bee5b58e9cbc1fd6062fbb410dd872721287
MATLAB
4,298
142
%% Script to calculate the phase-synchronization measures corrected with the surrogates %This script calculates phase synchronization measures to study brain %dynamics. The goal here is to describe the synchornization dynamics based %on phase statistics. The present script computes four basic measures; %integration, s...
0a825acd53ce1683675feca86158812b0e27927e4e9829ba1ef9b78511bfbc84
MATLAB
4,299
146
function Vfrac = boundaryAccessible(occ) % This function takes as input a matrix of logical values, 1's % corresponding to obstruction and 0's to conductive material (pore space), % then determines what proportion of the material is accessible from the % boundaries. This gives a "true" volume fraction, that ignores...
f16020afeea383f4a3195254b59f5e841a7a22f611705fda041aa5a74488e9e8
MATLAB
4,301
135
clc;clear all;close all; %% Setting Directory % input='../Input/final/Phantom/'; input_image1= './Input/allabdomen/train/skin_train2019/'; input_mask1= './Input/allabdomen/train/annotations/'; input_image = imageDatastore(input_image1,'IncludeSubfolders',true,'LabelSource','foldernames'); input_mask = imageDatastore(in...
165035c0e9ffc17916ae418527840de1d8de59bf520254a48adcf7064c01a1e7
MATLAB
4,304
132
function ax = plot_cluster_tree( spikes, clust) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/2010 % % plot_cluster_tree - plots color coded aggregation tree for a single cluster % % Usage: % ax = plot_cluster_tree( spikes, clust) % % Description: % Plots color coded aggregation tree for a ...
1ec554530791cd1c584fe5deee94fe5e16f5d2082f8c7a0993bbfa87718ddfd9
MATLAB
4,305
171
[x, y] = organizeData(Headtracker,Data); %%Showing the azimuthal movements during each trial % x2 = x((x(:,2)==1),:); for i = 1:length(y) x3 = x2((x2(:,1)==i),:); scatter(x3(:,4),x3(:,5),15); pause(0.5); end %Look at all trials on one plot % x2 = x((x(:,2)==1),:); colorArray = jet(13); for i = 1:l...
5723ded093d2994bd1b8aaa9fa91c43028848ab2895c36713aca35c2715644cc
MATLAB
4,307
134
function self = SetUpClassifier(self, varargin) p = inputParser; p.KeepUnmatched=true; addOptional(p, 'showplot', true); parse(p,varargin{:}); verboseLevl = self.VerboseLevel; trnOpts = self.ConfigFile.GetParams('TrainingOptions'); netOpts = self.ConfigFile.GetParams('Network'); if verboseLevl > 0 fprintf('Set...
77e46b5c3a4a6986f2bb7600063a098599721304ec4e6d396ac0f76c2442cf94
MATLAB
4,309
177
function params_ = readprairieviewxml(filename) % params_ = readprairieviewxml(filename) % A fast tool for reading the prairieview xml file and extracting % relevant params. % % % This function does not read the old format (.pcf files). % Use READPRAIRIECONFIG to open either format. % % MM 2/07 fid = fopen(filen...
59a170fe58e2cad328be7f4e22c22ae5357a976b13096c127ac877998ea12019
MATLAB
4,317
118
function [ DOM ] = WriteColladaGeometry( DOM, Name, materialID, Verts, Faces, Normals) %WRITECOLLADAGEOMETRY Summary of this function goes here % Detailed explanation goes here DOMNode = DOM.getDocumentElement; GeoLibList = DOMNode.getElementsByTagName('library_geometries'); GeoLibNode = []; if...
a0281b8f6b6ba380743e15d308df0d713a0838fd325d782400c5d7a4dba672f7
MATLAB
4,317
235
% Examples for manuscript % "The Partial Entropy Decomposition: Decomposing multivariate entropy via % pointwise common surprisal" %% Dyadic PED Pxyz = zeros(4,4,4); p = 1/8; Pxyz(1,1,1) = p; Pxyz(1,3,2) = p; Pxyz(2,1,3) = p; Pxyz(2,3,4) = p; Pxyz(3,2,1) = p; Pxyz(3,4,2) = p; Pxyz(4,2,3) = p; Pxyz(4,4,4) = p; lat = ...
1d67b364973b9870755d1c84e455a4da6c71a32da26b61f6563b6821b0bd25c1
MATLAB
4,328
121
function [Out,Norm] = DeepInsight_train_CAM(Parm,Norm) % [Out,Norm] = DeepInsight_train_CAM(Parm); % % dset is a data struct (dset.Xtrain, dset.XValidation,...) % % Out is the output in struct format %fprintf(Parm.fid,'\nDataset: %s\n',dset.Set); %fprintf('\nDataset: %s\n',dset.Set); if nargin<2 dset = load('Out1.m...
53215572f757c096bd50d22eea01c5845ce903d8a4475c18feeb049bb01b7ba0
MATLAB
4,328
126
function [CVE,... time-dependent mean decoding score [No. Timepoints x 1] Score,... Time-averaged/Peak decoding score, depending on InfoCriteria [1 x 1] Score_Shuffled,... Median Time-averaged decoding score from shuffled trials, [1 x 1] Score_ShuffledCIL,... 5 percentile...
463fe2c61b48ff8099c6cce8c72fda8e7bca2fe75f6f2b70016787fb8dcf045c
MATLAB
4,340
112
function [] = fit_simulated_data() % Compute the quality of fit on simulated data computed in % simulate_behavior.m. % ======================================================================= % % ===*=== General parameters % ======================================================================= % model_type ...
c3f20a73f7c5bcc09934268f4306cfaf2e8f17aa51bee11f96d2fc816729f44e
MATLAB
4,341
155
function Total_control_and_fe_simulations % Script recreates figure 10 from the manuscript. This compares the PSD and % wHVG distribution from data and model simulations for control and FE % subjects. % Load simulation results FS1 = 7; % fontsize sims = 100; subjects = 20; % load controls load('Total_...
eb9bd586ba882ad834b264c11c0e96a4c3031edbd1cae97df7c88b7605ccdf1d
MATLAB
4,341
107
%% Example to reproduce partial results from Herberthosn et al. 2021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This script guides through the replication of part of the results % % presented in Herberthson et al. 2021. To run this script it is necessary% % to download the data...
de9dcc9f761b094e97c9278e9a2809cb725626e7956f8ac173acd332e3ba0256
MATLAB
4,346
144
function Batchify(analysisfcn,blockid) % Batchify(analysisfcn) % Batchify(analysisfcn,blockid) % % % Daniel.Stolzberg@gmail.com 2013 global KILLBATCH KILLBATCH = false; assert(nargin == 1 || nargin == 2,'Function requires 1 or 2 inputs'); if nargin == 1 blockid = getpref('DB_BROWSER_SELECTION','bl...
470507d6f3463464b4ce8aef49998218ac093fa487254115aa55d976ea05b59d
MATLAB
4,350
165
function PLX2TDT(plxfilename,varargin) % PLX2TDT(plxfilename) % PLX2TDT(plxfilename,'Parameter','Value',...) % % Convert plx file generated from sorting data with Plexon Offline Sorter % and update appropriate TDT tank. % % IMPORTANT NOTE: When sorting spike waveforms using Plexon Offline Sorter, % ensure the ...
9d967b7b55b3ebbd61cc6fe605b30e76bc9f260d32579960b8c6ee84125342e5
MATLAB
4,353
130
function [c, matches] = strsplit(str, aDelim, varargin) %STRSPLIT Split string at delimiter % C = STRSPLIT(S) splits the string S at whitespace into the cell array % of strings C. % % C = STRSPLIT(S, DELIMITER) splits S at DELIMITER into C. DELIMITER can % be a string or a cell array of strings. If DELIMITER i...
2d687cf555f3723d315d98798c315be54f1d9422dec84131288d281d8a5a5dad
MATLAB
4,356
121
% PURPOSE : Plot/export temporal generalization matrix from MVPC data % See also: pop_plotempgenerMatrix % *** This function is part of ERPLAB Toolbox *** % Author: Guanghui Zhang % Center for Mind and Brain % University of California, Davis, % Davis, CA % 2026 function f_exportfile_TemporalGeneral...
10add8874a531dac407d7efe579c79637ac46fa3adc1256e48112c90f90e37d1
MATLAB
4,358
166
% PURPOSE: pop_erp_eventlist_view.m % display eventlist % FORMAT: % [ALLERP, erpcom] = pop_erp_eventlist_view( ALLERP, 'ERPArray',ERPArray,... % 'Saveas', 'off', 'History', 'gui'); % Inputs: % %ALLERP -ALLERP structure %ERPArray -index(es) of eegsets % *** This function is part...
ef21811d97bfa01a2e0bf301a747c965d71f813527cb4266fab9d2bc9ddf5329
MATLAB
4,358
149
function [] = test_l1_linear_svm() clc; clear; close all; %% Set algorithms if 0 algorithms = gd_solver_list('ALL'); else %algorithms = {'PG-BKT', 'PG-TFOCS-BKT', 'APG-BKT', 'APG-TFOCS-BKT', 'Newton-CHOLESKY', 'NCG-BKT','L-BFGS-TFOCS'}; algorithms = {'APG-BK...
7e0308bd2a86f2198bd8a782b3eb90da973b4d0bb9be63ae8b306aa5f026918c
MATLAB
4,360
156
function Stim = pp_make_stim_struct( epData, block, behavior ) % % pp_make_stim_struct( epData, block ) % Sub-routine called by pp_prepare_format. % % Creates matlab struct with number of elements equal to number of % trials, and fields with stimulus information for each trial. % % This function ...
2551265c591872fac10b46c8c49b0ee2ac114b997b4276c8b6f7a4027add86ba
MATLAB
4,364
165
function plot_w_vs_tau_ca_motoneuron (dt_info) % Simulate zebrafish embryonic motoneurons' calcium transients % with empirically observed statistics of the data % % Compute the directional preference W_{IR} and W_{RC} as a function of % calciumd decay time scale tau_{ca}, at the information propagation time % scale, t...
6d67230e58c7a46559b0ab239cfe9b6cceb9c2d840f249d58de2fb9222e5de94
MATLAB
4,368
141
function varargout = eda_filt(edain, fs, filtin, opendlg, plotOK) % EDA_FILT Electrodermal Activity (EDA) filters % [edaout filtout] = EDA_FILT(edain, fs, filtin, plotOK) % % Required input arguments: % edain - 1-by-n vector of EDA samples % fs - samplig frequency (Hz) % % Optional input arguments: ...
4f63d1e909ea6af339efbc270b5dd9e9c6ddba4b3fc21e4abb25c08bfa3e6601
MATLAB
4,371
120
function [P, hw, win_width, Fb] = my_stft_with_conv(x, f, win_width, Fb, fs, plot_cwt) % Estimate the PSD of x using short-time Fourier transform (STFT). % % Inputs % 'x' the original data samples. % 'f' the discrete frequency samples (normalized). % 'win_width' window width, in number of samp...
5b7830624405f2907c5de3ad262779d97c8fcdfc25ddf36b9d6dd13b8f39e817
MATLAB
4,371
175
%function FM_sweep_testing() % close all; handles.RPfile = 'C:\gits\epsych\UserFiles\SanesLab\RPVdsCircuits\KP\FM_sweep_test.rcx'; %Load in speaker calibration file % [fn,pn,fidx] = uigetfile('C:\gits\epsych\UserFiles\SanesLab\SpeakerCalibrations\*.cal','Select speaker calibration file'); fidx=1; pn = 'C:\gits\epsy...
ca817fddd18cd951353e9c435d09ea8272c813d9cbe8d2905c805422ca7457de
MATLAB
4,371
146
function ModCircleCapture( hFig, hAxes ) %CircleCapture: Spin the target in a circle taking pictures FrameNumber = 0; NumFrames = 360; tilt = 0; angle = 0; step = 1; %Figure out where the camera should be when circling the target view(0,90); camva('auto'); view(0,90...
952860d6a405f1765e91bc12384d8dfb88863636f9df46a44dd982e9a80d6b23
MATLAB
4,373
99
function epsych_printBanner(banneridx) % ep_printBanner % % Print text EPsych banner and a link to the online manual % % daniel.stolzberg@gmail.com 8/2016 m{1} = [... ' _____ ____ _ '; ... ' | ____|| _ \ ___ _ _ ___ | |__ '; ... ' | _| | |_) |/ __|| | | | / __|| ''_ \ '; ... ' | |...
4012b8f128f43f7bd861b5dbda7e5c93c396669db9888ed697476a9cef6aa007
MATLAB
4,377
118
function step3aa_plot_validation_size_animacy(bids_dir, varargin) %% Function that plots the results of the animacy & size validation analysis % % @ Lina Teichmann, 2022 % % Usage: % step3aa_plot_validation_size_animacy(bids_dir, ...) % % Inputs: % bids_dir path to the bids...
abeb86819e5dff71677997a0874a5708e4b886b6db97a637849fde74e76f5707
MATLAB
4,377
106
% Package GMLM_dmc for dimensionality reduction of neural data. % % References % Kenneth Latimer & David Freeedman (2021). Low-dimensional encoding of % decisions in parietal cortex reflects long-term training history. % bioRxiv % % Copyright (c) 2021 Kenneth Latimer % % This software is distributed unde...
b656c9ea60185aa1ace5910ba74455dc1477194a0ed82a293e85ec10cb27e2b3
MATLAB
4,379
151
% PURPOSE : This function is to examine if the parameters are the same across different MVPCsets % FORMAT : % % [serror, msgwrng] = f_checkmvpc(ALLMVPC,MVPCArray) % % INPUTS: % % ALLMVPC - structure array of MVPC structures (MVPCsets) % MVPCArray - index(es) of MVPCset(s) e.g. 1:5 % Au...
df23aaf79f3a95c674a6936c7d47ace7b578fdc51f98278d1046d956376b5599
MATLAB
4,382
93
function [RTs, RTsBaseline] = PPSData(patient, filenames) RTs = []; RTsBaseline = []; numberConditions = 2; delimiterIn = ' '; tmax = 1.5; % max time over which RTs are considered inconsistent data SDlimit = 2; % number of SD with respect to mean after which a data is considered outlier ...
46dfdc32adfa24a1aab76f99e6a3b5773c2053234fd67419d891e477a9e35f16
MATLAB
4,384
158
function model = qtip_data2fit_SDPdcm(model,signal,bten,varargin) % function qtip_data2fit_SDPdcm() % % flag is for define output size: % flag = 1 -> m is [nvox*28,1] (default); % flag = 0 -> m is [28,nvox] nmeas = size(bten,1); % retrieve opt...