sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
01b73f62ed60c467f951f85985d5616ecd7b12f8e58bae648e31dfa950521882
MATLAB
8,861
202
% Function for calculating smoothed estimates of firing rate by optimised kernel density smoothing. Wrapped up to run on Blue Crystal once for each of HP and PFC brain areas. Also contains a block of code to calculate FR for error trials. % % (c) 2014 Daniel Durstewitz, Bernstein Center for Computational Neuroscience...
69fb7bf7a128bc0bfefba3f94a119580dd2909685847f9d518043453b977b09b
MATLAB
8,862
301
% PURPOSE: Creates a .xls version of the ERPLAB's EVENTLIST structure % % FORMAT: % % [EEG EVENTLIST] = f_creaeventlist_excel(EEG, EVENTLIST, lfname, wf) % % Inputs: % % EEG - input dataset % EVENTLIST - ERPLAB's EVENTLIST structure % lfname - full filename of EventList file to save (*.txt) % wf ...
3ab86d757124a83322ce6f37617b17c0d400fe9daf13f9b25e5e6b7bf29a6541
MATLAB
8,910
282
% %%%%%% PREAMBLE %%%%%% clear Delays_ = {'Short','Medium','Long'}; Target = 'LONG'; Areas = {'PFC','HP','Joint'}; bw=0.05; tlimsAll = [-5 5]; tbAll = tlimsAll(1):bw:tlimsAll(2); maxRange=20; % Upper limit of assembly size to explore noTrials = 5; % How many trials to consider simultanrously nReps = ...
a98daae8aebbc7c50f02a9c975537b412aff65f2afd1054f308d3fd32601957b
MATLAB
8,915
223
classdef ( Hidden, Sealed ) ChildObserver < handle %uix.ChildObserver Child observer % % co = uix.ChildObserver(o) creates a child observer for the graphics % object o. A child observer raises events when objects are added to % and removed from the property Children of o. % % Se...
63ec265bee5c40a14ef550f904b7cbc4a5c420907fdae8d4a575789d14a99b98
MATLAB
8,924
218
function homog_problem = homogeniseFull2DProblem(problem, Ax, Ay, boundary_type) % This function takes an input problem, then uses block homogenisation to % reduce its number of mesh points. Ax and Ay are the number of smaller % elements (in each direction) to absorb into the larger elements. In the % current code, Ax ...
697cee91f03c9dcf412769dcf1350ce7274869fc2abc2e93afda5f950a2fafce
MATLAB
8,944
359
function Example_dynamics % Script recreates figure 2 from the manuscript. This provides example dynamics to 2 % subjects using simulations obtained from applying the SOEA20, SOEA45, % MOEA20 and MOEA45 to resting control EEG data. %% FS1 = 7; % fontsize M1 = 13; % define subject1 to analyse M2 = 4; % ...
be37163052ea453eea6dd3b504e7781bdbed2c47adcb746fb343485f29f962e7
MATLAB
8,954
213
%% Convert "continuous" data from OH/OHA/TOH/TOHA into events and objects. % By going through the frames that have been captured at 200 Hz, this % function extracts the relevant events and objects to reduce file size % while allowing all the necessary analysis. % Copyright (C) 2022 Richard Hugh Moulton % % This p...
5374b02e6c26c6e2c14628347e05205357bf3e790f671176c33549c02e6a7224
MATLAB
8,957
284
% PURPOSE : Export EEG eventlist to text file % % FORMAT : % % EEG = pop_exporteegeventlist( EEG, elname ) % % % INPUTS : % % EEG - eeglab dataset % Elname - file output % % OUTPUTS : % % .txt - Text file 'elname.txt' % % % EXAMPLE : % % EEG = pop_exporteegeventlist( EEG, '/Users/etfoo/...
68608b240887245bb62e7b9aafa830b77e0c1fb59bde98e5e63ef0af4e5a3ef1
MATLAB
8,974
275
% PURPOSE : Reads an event list from a text file and creates an EVENTLIST structure. % The EVENTLIST structure is attached to the EEG structure. % % FORMAT : % % EEG = pop_importeegeventlist(EEG, ELfullname, repEL) % % INPUTS : % % EEG - eeglab dataset % ELfullname - name of eventlist ...
ba2e3589a7dcc75bb18cba1aa3670483a63ec141d9a07adc30650ea3323a4a40
MATLAB
8,979
347
function f = DB_FRA_Analysis_GUI(a,~,c) if nargin == 0 || (nargin == 3 && isempty(c)) unit_id = getpref('DB_BROWSER_SELECTION','units'); end if nargin == 1 && ~isempty(a) unit_id = a; end if nargin == 3 && ~isempty(c) unit_id = c; end h = DrawGUI; h.unit_id = unit_id; h.spiketimes = DB_GetSpiketimes(un...
d0fa11c95c7efd6952a68cd9c0985dce3873a9cfb88afc5cad35d5615a695e93
MATLAB
8,980
273
% PURPOSE: pop_editdatachanlocs.m is to edit the channel locations % % % FORMAT : % % pop_editdatachanlocs(ALLEEG, CURRENTSET, parameters); % % ALLEEG - structure array of ALLEEG/ERP structures % CURRENTSET - Index for current EEGset/ERPset % The available parameters are as follows: % %ChanArray ...
e96cc4837972a71b86ee3e087b8bb6aa704b208aa47072a4f1f67402670f5fd1
MATLAB
9,033
223
% fdr_bh() - Executes the Benjamini & Hochberg (1995) and the Benjamini & % Yekutieli (2001) procedure for controlling the false discovery % rate (FDR) of a family of hypothesis tests. FDR is the expected % proportion of rejected hypotheses that are mistakenly rejected % ...
edf38d7384a5cdef12ac664cbac9c2a2d527ee5af4ebd5e459c1083fc7216021
MATLAB
9,033
201
function p = logLikelihood(data,options,alpha,beta,lambda,gamma,varscale) % the core function to evaluate the logLikelihood of the data %function p=logLikelihood(data,options,alpha,beta,lambda,gamma,varscale) % Calculates the logLikelihood of the given data with given parameter % values. It is fully vectorized and cont...
2289f2e0d9ea73919b19fcd134caba63423ff9bc3a55b76c4cc0dd1562034096
MATLAB
9,056
240
function ve_edit(varargin) %% ONLY FOLLOW THROUGH IF THE CURRENTOBJ IS NOT ESPACING OR EPOSITION... % Get the figure and axis userdata... udf=get(gcf,'userdata'); uda=get(gca,'userdata'); h_eegaxis=findobj('tag','eegaxis','parent',gcf); h_espacing=findobj('tag','ESpacing','parent',gcf); h_eposition=findobj('tag','EP...
ceaac233d515ee0e1bfa70a0d1de75d6897a590d471729dabd582d9cc98a91c3
MATLAB
9,071
254
% PURPOSE : To recover bin descriptor file from EEG or ERP % % FORMAT : % % pop_bdfrecovery(data) % % EXAMPLE : % % pop_bdfrecovery(EEG) (save as GUI will appear) % % Or % % pop_bdfrecovery(ERP) (save as GUI will appear) % % INPUTS : % % Data - EEG- if recovering bin descriptor fil...
f536df514344da6036f4f82657865b16e0e7bdfe04a5636014fe3e723171a790
MATLAB
9,077
248
function plot_cross_variable(model, epi, endo, electrode, activeSites, iActiveSites, fibers, variable, args) arguments model, epi, endo, electrode, activeSites, iActiveSites, fibers, variable, args.?CrossPlotProps; end args = CrossPlotProps(args); log = model.getLogger('general'); figure; hold...
0d6d7b7001074f7662ce192e96904cfa9637297a4b24ba5f69dafca47e6adb2f
MATLAB
9,081
193
% % Script that aggregates data into one output file, containing: % - participants details (name, session, runs, age) % - electrode information with destrieux labels % - detected N1 responses % - Freesurfer labels for stimulation and recording pair % % Note: the subjects and runs that will be includ...
ae87c652f0578c3305ccfacb081a46fa7f196f7bae06e65b1b2eed3b97ae9210
MATLAB
9,085
194
% quality control for factor analysis detected assemblies % % Aleksander PF Domanski PhD UoB 2015 % aleks.domanski@bristol.ac.uk clear all close all target= 'PreSleep'; if ispc home = 'C:\'; % [getenv('HOMEDRIVE') getenv('HOMEPATH')]; pat = [home 'Analysis\AssemblyAnalysis\Sleep']; separator='\'...
e2ff1c64dcafdf3f14ee62f2acf1be3277e987b2ed3d301a5a93e940e3bf4c23
MATLAB
9,085
319
function [stats,st] = SStat_mass_CoxStratPH(X,z,d,t,Y,maskvtx,prs,e) % [stats,st] = SStat_mass_CoxStratPH(X,z,d,t,Y,maskvtx,prs,e) % % Vertex/voxel-wise parameter estimation for the Stratified Cox proportional % hazards model. Survival time ties are handled using Efron's method. % % Input % X: Design Matrix with the t...
3c1b4037efa4b18e59fa33d4a512a88ef07cd51f900978bdf6297e6f736666e6
MATLAB
9,115
317
function plot_gc_synthetic_vs_lag % For synthetic data with true underlying interaction network, % we ask the question, how does the time lag used in the GC analysis % change the resulting network. % This is to plot figure 2.FGH in the manuscript. %% 1. Initialize the network nNodes = 10; maxLags = 3; params.maxLags =...
6f5435a7b5ef10dfe6c61a8ed455d21e27c080d0e179f6f1ad0a59796f579081
MATLAB
9,120
222
function varargout = ResultsGUI(varargin) % RESULTSGUI MATLAB code for ResultsGUI.fig % RESULTSGUI, by itself, creates a new RESULTSGUI or raises the existing % singleton*. % % H = RESULTSGUI returns the handle to a new RESULTSGUI or the handle to % the existing singleton*. % % RESULTSGUI('CALL...
3e94e773d4ad493b959a9c4965df75078081f4d0b786ca0c46a0d94e0021dc4b
MATLAB
9,153
281
% Main script to filter data, calculate optical flow, find patterns, and % view results % % This will probably be changed to a function later, but is currently a % script for ease of testing. % % Required variables: % - LFPs: X x Y x TIME x REPETITION matrix representing some % oscillatory recording data. If dat...
2212942c7e62827b14b553f17a21d82f3dd8b79a7cc345b1bf18dcac0560de14
MATLAB
9,157
302
classdef Container < handle %uix.mixin.Container Container mixin % % uix.mixin.Container is a mixin class used by containers to provide % various properties and template methods. % Copyright 2009-2024 The MathWorks, Inc. properties( Dependent, Access = public ) Contents % ...
c599c04bfc1731d06e02a50878fe61b1c4934b1a2f369e5e290d4f43f9b97b34
MATLAB
9,169
278
% %%%%%% PREAMBLE %%%%%% clear Delays_ = {'Short','Medium','Long'}; Target = 'LONG'; Areas = {'PFC','HP','Joint'}; bw=0.05; tlimsAll = [-5 5]; tbAll = tlimsAll(1):bw:tlimsAll(2); maxRange = 20; % Upper limit of assembly size to explore noTrials = 5; % How many trials to consider simultanrously nReps ...
5f29c64e0c6ece85c94a5b36571628dfd8a4f619cee12a9a557e838335cf426b
MATLAB
9,195
141
%%This function is to create ERP Tab % Author: Guanghui Zhang & Steve J. Luck % Center for Mind and Brain % University of California, Davis % Davis, CA % 2024 function EStudio_gui_erp_totl = EStudio_decode_Tab(EStudio_gui_erp_totl,ColorB_def) global observe_DECODE; addlistener(observe_DECODE,'Reset_best_panel_chan...
a8237322974cba78dd72d2b3a9ed3b289ade18e502804977f6d5ca042a8cc22b
MATLAB
9,207
312
%%this function is used to call back the parameters for plotting ERP wave % *** This function is part of EStudio Toolbox *** % Author: Guanghui Zhang & Steven Luck % Center for Mind and Brain % University of California, Davis, % Davis, CA % Nov. 2023 function OutputViewerparerp = f_preparms_mtviewer_erptab(ERP,matla...
4ea8ff716dd146df13287bd29dde4dab820282b4aa340571bf9214adf39d1394
MATLAB
9,209
304
% fresh start clearvars close all %% run config config_file='config_mammals_1.m'; addpath(strcat(pwd,'/config')) run(config_file); %% setup vars thr_vals = [ 0 0.05 0.1 0.15 ] ; filename = [ DD_INTERM '/' OUTSTR '_divergences_n_outlierdetect.mat' ] ; divo = load(filename) ; ff = [ PROJ_DIR '/reports/lab_meeting/...
331e612f1f9fbd73f21533cd251140358362d9d45e198ab84b6ca9f562dda08a
MATLAB
9,217
314
% Fig7_fg % Code to generate SUA examples to optogenetic stimulation and V6 % from Monkey D % load data addpath data load('Fig7_fg_data','tr', 'cfg', 'clu','wfm', 'templates', 'winv', 'timeLEDe', 'ledSignal') cfg.stimTime = 0.25; %% unwhiten all waveform templates and calculate amplitudes and depths templatesUnW = zer...
349cbe02a6099100710246a9f93e17b56cbe19bc1cd5a19d4e8289cf45a6f0d6
MATLAB
9,229
244
function varargout=sigstar(groups,stats,nosort) %% This function has been adopted and edited from a matlab file exchange function. The original function is freely avalibale at the following: "https://www.mathworks.com/matlabcentral/fileexchange/39696-raacampbell-sigstar". % sigstar - Add significance stars ...
82ac254ba634e5d841f82574943326b1015d3bf436d0e12605c26e7c5857ba4f
MATLAB
9,234
205
function [n1_peak_sample,n1_peak_amplitude] = ccep_detect_n1peak_ECoG(average_ccep,good_channels,params) % Function for detecting the the N1 peaks of CCEPs % INPUTS: % - average_ccep % array with averaged signals % - amplitude_thresh % Threshold factor that needs to be exceeded to detect a peak as % significant...
4c04984ccc41e031e461e1d321929e795e3db9b0fa8cf19d201cd16a77015fc8
MATLAB
9,281
262
function varargout = savemyeindicesGUI(varargin) % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @savemyeindicesGUI_OpeningFcn, ... 'gui_Output...
5c72c3110cd995efacf9614b75b9b3153fa129daad436fb8addeb1c2b90d5075
MATLAB
9,321
308
% Script to find all patterns in a sequence of velocity vector fields and % display some of their properties %% Fig 4a % plot vfs in certain space interval=1; %raw rawmatrix=zeros(size(cortexMask,1),size(cortexMask,2)); for i=1:interval+1:size(cortexMask,1) rawmatrix(i,:)=1; end %figure;imagesc(rawmatrix) %colum...
7f2ec78e0ce3a227d9baf62923be16c92a28e816a1c1ef7d469dd0cff779c337
MATLAB
9,322
286
%write trial information to .text or .xls file function eegcom = pop_eeg_save_trial_information(ALLEEG, varargin) eegcom = ''; if nargin<1 help pop_eeg_save_trial_information return end if nargin==1 if isempty(ALLEEG) msgboxText = ['pop_eeg_save_trial_information: ALLEEG is empty!']; ...
28c303f703195434b4a29ae0c89e9edc5b157a45fc76e5f814f39af50be31c25
MATLAB
9,346
268
function [outputEEG, commandHistory] = pop_erplabInterpolateElectrodes( EEG, varargin ) %pop_erplabInterpolateElectrodes In EEG data, replace specific channels through interpolation with the option to ignore specific channels % % FORMAT % % EEG = pop_erplabInterpolateElectrodes(EEG, replace_elecs, ignore_elecs) % % ...
2c52a64573600331a465b44952a06f43b69c68ec95f676f9986924f854ae251a
MATLAB
9,372
116
% 1 POTENTIAL ISSUE- SEE CAPITALIZED COMMENT % % CALL_TO_NIDAQ(app,command,varargin) % % Function that is called whenever the computer needs to interact with the % NIDAQ. The call to the NIDAQ may be: generating an (audio-visual) signal, % or some command (such as initializing the NIDAQ, stopping the current % signal, ...
e8b34c5058fb363b9c74a0405616d44dc4a86c10799dc89f5d0f6f292e95c330
MATLAB
9,377
404
function SaveBehaviorSessionData %---Script that analyzes behavior data from AM Rate Discrimination Task. %Created 12/01/2017 JDY. %1) Click Run ("Play" button) clear all close all clc %---Load Data---% [f,p] = uigetfile; file = [p f]; session = inputdlg('Session #'); Session =...
94cd83a7eee38328b613ad2a85352cf34f32e41effb87e231799edd0a7732055
MATLAB
9,390
262
function [NextTrialID,LastTrialID,Next_trial_type,varargout] = ... select_trial_SanesLab(initial_random_pick,nogo_indices,go_indices,... LastTrialID,remind_row,trial_type_ind,TRIALS,varargin) %[NextTrialID,LastTrialID,Next_trial_type,varargout] = ... % select_trial_SanesLab(initial_random_pick,nogo_indices,go...
d87eb174acf71369028b059a4a94318f5f21972f14acaa02bc54b5dd6443ea63
MATLAB
9,398
236
% PURPOSE : Get the legend and bindata and binerror data for single and mutiple ERPsets % % FORMAT : % f_geterpdata(ALLERP,ERPsetArray,orgpar); % % % INPUTS : % % ALLERP - structure array of ERP structures (ERPsets) % To read the ERPset from a list in a text file, % replace ...
b47c3dffd043c36e9047e3b442fc12c3a507bee3776d175afb3205ce938fd26e
MATLAB
9,399
314
% % Author: Javier Lopez-Calderon & Steven Luck & Guanghui Zhang % Center for Mind and Brain % University of California, Davis, % Davis, CA % 2009 & 2022 & 2023 %b8d3721ed219e65100184c6b95db209bb8d3721ed219e65100184c6b95db209b % % Copyright (C) 2008 Javier Lopez-Calderon & Steven Luck, % Center for Mind and Brain...
df2fcd70c6574348af3f695befd3a5a802b32d2f7208464df2197190e760ffe6
MATLAB
9,400
290
%write trial information to .text or .xls file function erpcom = pop_ERP_save_trial_information(ALLERP, varargin) erpcom = ''; if nargin<1 help pop_ERP_save_trial_information return end if nargin==1 if isempty(ALLERP) msgboxText = ['pop_ERP_save_trial_information: ALLERP is empty!']; ...
badaed464855524ced340a5c6e5b6b0de81f9282aaa437ba91e4e7cf57e4d7c9
MATLAB
9,409
328
clc; clear; close all Fig2b=figure(); %spike-triggered average %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% yline(0,'-k','Linewidth',2) hold on xline(0,'-k','Linewidth',2) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %parameters (see Model_Learning.m ) N_...
363c2e9d68edbf262cc7663a3c1eb978e3487dbea7003dc451d0b4ba8fdd5da0
MATLAB
9,413
256
% PURPOSE : Taking N separate ERPsets, systematically computes grand averages on subsamples of N-1 ERPsets. % This means, each grand average has ommited 1 (different) ERPset. % % FORMAT : % % ERP = pop_gaverager( ALLERP , Parameters); % % % INPUTS : % % ALLERP - structure array of ERP structu...
d6b0e448682a3923e6902c2a1267e667bcbbfa418a758968724e77485f896c75
MATLAB
9,413
348
%% rootdir = getpref('ICA_GROUPCORR','rootdir',pwd); if ~isempty(rootdir), setpref('ICA_GROUPCORR','rootdir',rootdir); end mask = 'C:\MATLAB\work\Plugins\MRI\spm12\canonical\cat_brain_mask.nii'; Psa = spm_select([1 inf],'image','GroupA: ICA components for Group A...', ... {},rootdir,'.*sub.*component_ica.*.nii'); ...
6d59a23a064c1a54d967e0a9ab01208b3e60b905a4d82e1352319e2172dccbcb
MATLAB
9,420
309
% Fig7_de % Code to generate SUA examples to optogenetic stimulation and V6 % from Monkey A % load data addpath data load('Fig7_de_data','tr', 'cfg', 'clu','wfm', 'templates', 'winv', 'timeLEDe', 'ledSignal') %% unwhiten all waveform templates and calculate amplitudes and depths templatesUnW = zeros(size(tem...
e88bf7e128086cd3b0bd3f2a6dc66bea094f8660144dfb91f74176abd909ad38
MATLAB
9,442
211
% 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...
90ea9a9b467377b30ec273525f901ed1fd5fc9ffdac143308c1b81e0359bd5eb
MATLAB
9,443
273
function varargout = eventlist2erpGUI(varargin) % EVENTLIST2ERPGUI M-file for eventlist2erpGUI.fig % EVENTLIST2ERPGUI, by itself, creates a new EVENTLIST2ERPGUI or raises the existing % singleton*. % % H = EVENTLIST2ERPGUI returns the handle to a new EVENTLIST2ERPGUI or the handle to % the existing ...
71fd5ee055e7ad51c51464b000e255cac6b9fef6cb6efc0e562433cc8049c458
MATLAB
9,459
246
function recruitment_bipolar(model, cathode, anode) format longeng; simStart = tic; log = model.getLogger('recruitment'); %% Parameters MRG = model.load_MRG_coeff(); nbNod = model.params.nbNod; nbSeg = model.params.nbSeg; start = model.params.start; stimDur = model.params.stimDur; deltaQnC = model.params.de...
cc6c62c2ecd4032373cd3b51baf0a713058e6be893b0272b6638e0ae402c65e8
MATLAB
9,474
275
%% A quick and dirty diagnotistic script to check log likelihood derivatives to make sure the optimized CUDA code is actually working. Runs through a bunch of setup scenarios. % I've occasionally noticed failures that are due to a random dataset/parameters being numerically unstable (exploding values). This doesn't mea...
07de2d67248982eac162c58cd15c780669baf125b891bcb816f17d523bb450b2
MATLAB
9,525
248
function artifactscantool_plot_layout(layout, varargin) % FT_PLOT_LAYOUT plots a two-dimensional channel layout % % Use as % ft_plot_layout(layout, ...) % where the layout is a FieldTrip structure obtained from FT_PREPARE_LAYOUT. % % Additional options should be specified in key-value pairs and can be % 'chanindx'...
67d0ad4e05c268c686a5222cc13dfb2f62cff9e04d6be56252d5f725f368eb2f
MATLAB
9,560
237
function RUNTIME = ep_TimerFcn_RunTime_TwoInterval_SanesLab(RUNTIME, AX) % RUNTIME = ep_TimerFcn_RunTime_SanesLab(RUNTIME, RP) % RUNTIME = ep_TimerFcn_RunTime_SanesLab(RUNTIME, DA) % % SanesLab RunTime timer function % % Daniel.Stolzberg@gmail.com 2014. Updated by ML Caras 2015 % Updated by JD Yao 2016 global GUI_HA...
6d3fa1c44e3c4ddc741200dfacce971c04df0a7803c4e630741dff0425fa0ff9
MATLAB
9,564
234
function tplinescandriftexplorer (varargin) % TPLINESCANDRIFTEXPLORER - Explore the effect of XY drift on linescans % % TPLINESCANDRIFTEXPLORER('DIRNAME', DIRNAME,... % 'RASTERIMAGE', RASTERIMAGE, ... % 'LINESCANPOINTS', LINESCANPOINTS, ... % 'UNCORRECTEDLINESCANIMAGE',UNCORRECTEDLINESCANIMAGE, % 'DEFAUL...
9b6a465e0a6f1cc73e55ad33fde50858f1026226ea1057f769ef28e417afc7f6
MATLAB
9,595
261
%% demo_004: Priors % This demo covers how we set the priors for different situations. % This gives you effective control over which parameters of the % psychometric function are considered for fitting and all confidence % statements. % There is no way to do Bayesian statistics without a prior. %% Staying with the sta...
2bf31b1721acda5a0da06952dfcd783de775e9cd48e091212bdecfd1bd5c4ac7
MATLAB
9,634
297
function [] = plot_heatmap(fig_name, x_vec, y_vec, all_data, cmap, ... label_str, y_label, x_label, varargin) % Display a colormap. % used in TSL_fit_on_ratings. clim_val = NaN ; % for the heatmap (+ hc if hc_lim not specified) hc_lim = NaN ; % for the hc only filename = NaN ; map_opt = ...
d0dc17ce4d3aca0587a4bfb827e6a54280bc85f5b6f50448c6d12d02f93d6c4c
MATLAB
9,634
306
function [stats,st] = lme_mass_fit_Rgw(X,Zcols,Y,ni,Th0,Rgs,Surf,fname,... Dtype,sptm,prs,e) % [stats,st] = lme_mass_fit_Rgw(X,Zcols,Y,ni,Th0,Rgs,Surf,fname,Dtype,sptm,prs,e) % % Region-wise linear mi...
d29a6cba4a790d48460bb48aad3f47eb00f4a1829f0d6a5b1d6aadfe191c63dd
MATLAB
9,649
386
Test1XZ = [ 0 0 -.5; -1 0 .5; 1 0 .5;] Test1XY = [0 -.5 0; -1 .5 0; 1 .5 0;]; Test2XZ = [6 0 -1; 4 0 1; 8 0 1]; Test2XY = [5 -1 1; 3 1 0; 7 1 0;]; Test3XZ = [6 0 -1; ...
98c74ef2a9d0360d1e1b0653d54ef995c06ea39b5caf012a4dafb864a57c5542
MATLAB
9,660
300
% PURPOSE : Combine bins within a BEST file. Outputs BEST file with % combined bin appended at the end of BESTset. % % FORMAT : % % >> [ALLBEST] = pop_combineBESTbins(ALLBEST,parameters); % % INPUTS : % % ALLBEST - input ALLBEST dataset % BESTArray - index(es) of selected best...
6bab47e1381e2a5782d0594dbefb2b6f17e49cdee334d184394b208b1dc6a699
MATLAB
9,662
229
clear Targets = {'SHORT','MEDIUM','LONG'}; Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; Dirs = {'Left','Right'}; bw=0.05; pat = 'C:\Analysis\AssemblyAnalysis\raw'; cd(pat) fileList=dir('allTimestamps\*LONG*.mat'); Areas = {'HP','PFC'}; tlimsSample = [-5 5]; tlimsChoice = [-5 5]; ...
d0bbc91a457fc7aaafaa4edfede86674d78bb3c347c7e1dd47d71c16b4c9b7e4
MATLAB
9,683
262
function NextTrialID = TrialFcn_AversiveAnimalTrig_TrainTest(TRIALS) % NextTrialID = TrialFcn_AversiveAnimalTrig_TrainTest(TRIALS) % % June 2015 RosenLab % This is a modified trialfcn designed to run with FwdMask_AnimalTrig_ExpReady.prot % It uses the custom boxfig GUI CondAversiveGUI.m, which has buttons to % speci...
f928741238fb12ee66920eec996c5ead83cfa726d5da8eb4d1117138408630a2
MATLAB
9,686
195
function [QUIQI,Folders]=PrepAnalysis(Subject_Details_All,lambda,DataTypes,Subregions,AnalType) % Compiles into QUIQI and Folders structures all information required for % subsequent analysis. % Also, edits cohort details if necessary (e.g. for Exclusion or Specificity analyses) % and computes an explicit mask for...
2419628a1b5f57e778c447e2720564fc613075689f4e75ea859870c15391a588
MATLAB
9,702
236
function [K, M, mesh] = encodeProblem(occ_map, D_tensor, Vfrac, grid, alpha) % This function calculates the stiffness and mass matrices associated with % the input information regarding the mesh (including what sites are % occupied, and the diffusivities and volume fractions) %%% LOTS OF SETUP % Read out the individ...
8c4dad5aaf9b759d36019587e5083819e5c96c5c54020dda699f83407e8c2eb9
MATLAB
9,711
273
clear Delays_ = {'Short','Medium','Long'}; tlimsPoke = [-5 5]; bw=0.05; warning ('off') pat = 'C:\Analysis\AssemblyAnalysis\raw'; cd(pat) %%%%% fileList=dir('allTimestamps\*.mat'); iFile =6; Areas = {'HP','PFC'}; iArea =2 %%%%% fname=strtok(fileList(iFile).name,'_'); load(sprintf('%s\\allTimestamps\\%...
981bb3f174fa2b81f65a1cab075b39938acfafc49424b9915c7a2525d42e12c9
MATLAB
9,711
253
function [MVPC, serror, msgboxText] = mvpcaverager(ALLMVPC, lista, optioni, mvpcset, nfile, stderror,warnon) %Only averages across decoding accuracy per subject (SVM 1vall). %Does not yet average across SMV (1v1) and Crossnobis Distance. serror = 0 ; msgboxText = ''; %Reads in the correct ALLMVPC set ds = 1;...
f6d8be4e46b3649591eb7290bce94491eabfd3d243e49576771007ab432cfcda
MATLAB
9,715
270
%% %%%%%% PREAMBLE %%%%%% clear Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; Target = 'LONG'; tlimsAll = [-5 5]; tlimsShort=[-4 10]; tlimsMedium=[-8 10]; tlimsLong=[-16 10]; tlimsANOVA = [-4 4]; shift = 0; plotOnline = false; bw=0.05; Nbs = 500; tbShort=tlimsShort(1):bw:tlimsShort(2); tbMedi...
21ccb8e78325153306df7364825e8c899aa9ce245d7aa334a9153ed9ba2d2b20
MATLAB
9,718
210
function BurstDetection (peakfolder, end_folder1, end_folder2, end_folder3, nspikes, ISImax, min_mbr, cwin, fs, check) % Function for producing the Burst Detection files % INPUT % % OUTPUT % % by Michela Chiappalone (17 Marzo 2006, 12 Gennaio 2007) % modified by Luca Leonardo Bologna (10 June 2007) in order to handle m...
53152c80cdfed0a33d6d6908b0b4a13ec64d130b54f606977f0a51c3315a3a5c
MATLAB
9,736
244
function conds = eda_conditions(eda, fs, xconds, edr, latency_range, opendlg) % EDA_CONDITIONS Event related EDR and EDL % conds = EDA_CONDITIONS(eda, fs, xconds, edr, latency_range, opendlg) % % Required input arguments: % eda - 1-by-n vector of EDA samples % fs - sampling frequency (Hz) % xco...
edbf22e6343ed41fb48255ef6a31f659833bc06a03e2e268dde25e895a2be719
MATLAB
9,742
195
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Analysis of vigilance state architecture % Script written: Lukas B Krone 2021 based on previous scripts from the Vyazovskiy lab % % INPUT: % - "-VSspec" files for one EEG channel for each date with a different injection condition (sa...
b0c80effe594b2d693f9d81964c40856bf0a8ef63267fcda1c04a3e70e22c8e1
MATLAB
9,743
333
% PURPOSE: pop_resamplerp.m % resample ERPsets % % FORMAT: % [ERP, erpcom] = pop_resamplerp( ERP, 'Freq2resamp',Freq2resamp, 'TimeRange',TimeRange,... % 'Saveas', 'off', 'History', 'gui'); % Inputs: % %ERP -ERP structure %Freq2resamp -new sampling rate e.g., 200 Hz %TimeRange -new t...
ca2da7bee96d7f85d0dfbaaa5861c8848e60c8d7f39e732cf0e0079cc38f8f15
MATLAB
9,757
249
% Wrapper code: factor analysis assembly detection % % (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 % % Iterates across all animals/files % runs FAassem_ to make FA models, then BSc...
94fda9626d1cd9fe2077b433a14d2bf7920298e0706516afde9b389915c7d7a4
MATLAB
9,758
262
function NextTrialID = TrialFcn_AversiveAnimalTrig_TrainTest(TRIALS) % NextTrialID = TrialFcn_AversiveAnimalTrig_TrainTest(TRIALS) % % June 2015 RosenLab % This is a modified trialfcn designed to run with FwdMask_AnimalTrig_ExpReady.prot % It uses the custom boxfig GUI CondAversiveGUI.m, which has buttons to % speci...
ee6d4a51dc3e13a27492e6422cc1a1c08a3ccc0c5f7a83a47b12ae7ad623e26a
MATLAB
9,765
228
DA_trans = cumsum(TNC_CreateGaussian(700,100,1000,1)).*3; figure(4); plot(DA_trans); hold on; %% activity = zeros(1,3000) back_p = exp(([1:numel(activity)]-numel(activity)-3)./25); figure(900); plot(back_p); hold on %% % load ~/'Dropbox (Personal)'/finallatdat.mat % final_latency.data = final_latency_data...
f76fa56e183795a3dc879efc29ac446e4eaf8fafe8e4e69c0aa4b57b5438734a
MATLAB
9,817
227
% PURPOSE : subroutine of pop_exporterplabfigure.m % % FORMAT : % % ERP = erplabfig2pdf(ERP, figtag, saveasmode, filepath, fileformat, resolution) % % INPUTS : NOTE: The plotted figure from ERPLAB must be open. % % ERP - input ERPset % figtag - string. Figure's tag to be included for exporting...
8fb6e59f552452f15c39eec8e0fd7a0fb237ba464405058aef4e51cd7efa8207
MATLAB
9,832
211
% Function for calculating smoothed estimates of firing rate by optimised kernel density smoothing. Wrapped up to run on as a single Blue Crystal job for each of HP and PFC brain areas. Uses Save-parfor to save interim data on each unit as it finishes, rather than waiting until all are finished. % % (c) 2014 Daniel D...
d26c02f9a57f5a6e729b9cd14be7bb9bff3f1e46ae1b682e76a3799174bb7b24
MATLAB
9,858
304
function varargout = f_ERP_save_single_file(varargin) % F_ERP_SAVE_SINGLE_FILE MATLAB code for f_ERP_save_single_file.fig % F_ERP_SAVE_SINGLE_FILE, by itself, creates a new F_ERP_SAVE_SINGLE_FILE or raises the existing % singleton*. % % H = F_ERP_SAVE_SINGLE_FILE returns the handle to a new F_ERP_SAVE_SI...
309d1ff2bc5eca09e631c42f1e4ee7e7811538cb0958adb44a0861265baebb34
MATLAB
9,859
317
% PURPOSE : Removes epoched EEG baseline % % FORMAT : % % EEG = pop_blceeg(EEG, 'Baseline', blc) % % EEG - EEGLAB structure % blc - window for baseline correction in msec, or one of the keywords % listed under INPUTS below % % Example : % >> EEG = pop_blceeg( EEG , 'Baseline', [-100 0]); % >> EEG =...
1607c1030b7f1b2c34b82ca8b4dd1a0801dea7acd22bad33eaf42b933e68680b
MATLAB
9,863
226
function [t_new] = ieeg_labelElectrodesDestrieux(FSdir,electrodes_tsv_name,saveNew,circleradius) % % this script labels electrodes based on the Destrieux Atlas from % Freesurfer % % requires vistasoft in the path % %%% Preperation step: % % Tn the terminal go to the subjects freesurfer folder and type: % % mri_conve...
51bcd6388fc828a680ef83ce1739b060bdc73df07c2a3887a38f44b5cfb51e65
MATLAB
9,876
204
function [Dtissue,K_lte,K_ste,sigTissue,sigCSF] = estKurt(sigVals_lte,sigVals_ste,bVals_lte,bVals_ste,D_CSF,sigTissue0,sigCSF0,opt) % % Estimate signal fractions of CSF and tissue assuming b-tensor kurtosis model with 2 compartments. % i.e., free water elimination % % sigVals_lte: [N_bval_lte * Nx * Ny * ...
34b3657353bde9ce16ef6350e505ae32834b2a1cac906af672cab8c37e347298
MATLAB
9,895
251
function [rGamma, rAlpha, rBeta, JumpPost, Trans] = ForwardBackward_MarkovJump(s, pJ, pgrid, Alpha0, Pass) % Forward-Backward algorithm to solve a hidden markov model, in which the % hidden states are non-stationary transition probabilities controlling % the observed outcome s. % % Given that s is a sequence of binary ...
24fb4c75afd9de5970b47a7f9c7e8258184433a7278f8f729bb63bdf21bfc766
MATLAB
9,905
211
function options = NoRMCorreSetParms(varargin) % Struct for setting the NoRMCorre algorithm parameters. Any parameter that is % not set gets a default value % Author: Eftychios A. Pnevmatikakis % Simons Foundation, 2016 Names = [ % dataset info 'd1 ' % number of rows 'd2 ...
c1b51b4f27f52d2fa2e6fadc83840af58f9d10ddfc2f3cbd9011f0882cf6aa4c
MATLAB
9,956
419
clearvars setUpPaths dataPath=[dataPath '/Anaesthesia']; cd(dataPath); fileNames = dir('*-SaveEpochedNew.mat'); %% for len=1:length(fileNames) processDataAnaesthesia %% fs=29.133; clear ExpectMeaned Sig fano ExpectSE clear pStore for expect =1:ExpCond NewTime = -1/fs*60:1/fs:1/fs*100; ...
15626b0830c14bc9065e6c1ed5392babe0c8faf4c9fe1327e4c8ca11f4264c71
MATLAB
9,984
426
function varargout = DB_QuickPlot(varargin) % DB_QUICKPLOT MATLAB code for DB_QuickPlot.fig % Edit the above text to modify the response to help DB_QuickPlot % Last Modified by GUIDE v2.5 16-May-2013 12:42:17 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename,...
6b989c4f8245bb13670b72b258ba1fc388f3b3ef3fa41a243815535e4c5cb555
MATLAB
9,989
357
% PURPOSE : Save BEST (.mat) file. % % FORMAT : % % >> [BEST] = pop_savemybest(BEST, parameters); % % INPUTS : % % BEST - Bin-Epoched Single Trial (BEST) structure % % The available input parameters are as follows: % 'bestname' - BESTname to be saved % 'filename' - ...
e4ca523f8ffc2e55ab50d628ac15ee3230a8a5318fffc55736a07e9d436203d8
MATLAB
10,001
278
function [] = plotGMLMFit(TaskInfo, paramStruct, bases, R_sample_stim, R_sample_stim_dirOnly, R_sample_stim_catOnly) if(isempty(which('hosvd'))) error('Requires tensor_toolbox to be in MATLAB path! (for the hosvd function)'); end for jj = 1:numel(paramStruct.Groups) if(strcmpi(paramStruct.Groups(jj).name, 'sti...
ffbcc37de5fe80494e7ecca5be02b4a18068668c51d69291d529874369b55875
MATLAB
10,004
204
function [populations] = extractPop(endos, multPop, fascID, ratioR, ratioD) % EXTRACTREGIONPOP Extract the region where to place the fibers acording to % the population type and the endoneurium cross-section area % %[section_pop] = extractPop(endos, ratioR, ratioD) % % Inputs: - endos: cell of matrixes of x, ...
c85c7b315a5949c215988f3712d183fd09300f488f7201e08a35cc3a5ede76e0
MATLAB
10,021
295
function [EEG, commandHistory] = pop_erplabShiftEventCodes( EEG, varargin ) %POP_ERPLABSHIFTEVENTCODES In EEG data, shift the timing of user-specified event codes. % % FORMAT % % EEG = pop_erplabShiftEventCodes(inEEG, eventcodes, timeshift) % % INPUT: % % inEEG - EEGLAB EEG dataset % Eventcodes ...
67067e4e5e4cdb420dea233eed1b0df4e764c50ab61b346b13fc65768fc32473
MATLAB
10,032
269
% PURPOSE : Sends ERPset(s) (from ERPset menu) by email % % FORMAT : % % pop_senderpbymail(ALLERP, erpindex, mailto, subject, message, attach) % % % INPUTS : % % ALLERP - structure array of ERP structures (ERPsets) % erpindex - index(ices) of ERPset(s) to be attached. % ...
14e38bdf351e5446f0269c5590fd718e4af81679ddb3285864fea129a212c8fd
MATLAB
10,035
305
function varargout = f_EEG_save_single_file(varargin) % F_EEG_SAVE_SINGLE_FILE MATLAB code for f_EEG_save_single_file.fig % F_EEG_SAVE_SINGLE_FILE, by itself, creates a new F_EEG_SAVE_SINGLE_FILE or raises the existing % singleton*. % % H = F_EEG_SAVE_SINGLE_FILE returns the handle to a new F_EEG_SAVE_SI...
c2fe59b25f5a37fa09a2ced84961d6bbe6c9a9c75d42665f98f40856c6b83907
MATLAB
10,036
210
% no delay % % TTL code % 9 sample left % 18 sample right % 6144 press sample or 6176? % 32 maglight % 8219 initiate poke % 16420 press correct % -32768 press incorrect % 32 = reward delivery signal % 0 reward consumption (Beambreak, triggers lights of...
5bd041372bc1c15dd53a78e918c716cf7ad16fb8b897762458d4182c3a10b1c8
MATLAB
10,049
245
function spikes = ss_detect( data, spikes ) % UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/2010 % % ss_detect - Detection of spikes in multi-channel data over multiple trials % % Usage: % spikes = ss_detect( data, spikes ) % % Description: % SPIKES = SS_DETECT_SPIKES(data, params) takes a m...
17c94ded53f94afa1b16cc35520b750f8de7af32261c726419dec573546ebbe2
MATLAB
10,057
219
function fibers = project_fibers_inv_square(fibers, ... cross_z, idCross, idCross_prev, section, section_prev, BranchIndex, fibp, minFiberDist) % PROJECT_FIBERS Porject the fiber center distribution to the % next layer in every case % % [fiberPop, fiberPos_cur] = project_fibers(fiberPop, ... % fiber...
714554b89cbc202274991f631e2e3dd512ecf6298097eaaf2a184ff105e38e92
MATLAB
10,065
241
%% Preamble clear Delays_ = {'Short','Medium','Long'}; Delays__ = {'4s','8s','16s'}; Targets={'LONG','CP55940','AM251','URB597','physostigmine','scopolamine'}; %,'URB597' Targets_={'Control','CP55940','AM251','URB597','physostigmine','scopolamine'}; %,'URB597' Areas = {'PFC','HP','Joint'}; color_={'b','r',...
4afe06fbcec554ae9dfbfe844dce0d086e117e54f5ba9c0c6656fa7dfeac41e5
MATLAB
10,112
316
% % Author: Javier Lopez-Calderon & Steven Luck % Center for Mind and Brain % University of California, Davis, % Davis, CA % 2009 %b8d3721ed219e65100184c6b95db209bb8d3721ed219e65100184c6b95db209b % % Copyright (C) 2008 Javier Lopez-Calderon & Steven Luck, % Center for Mind and Brain, University of California, Davi...
56ccdfd05f70b343bd84e5b0ae9fcf984d47ce45ff2cf04bdf57e6ec80d16d11
MATLAB
10,118
307
function [uFA,Kiso,Klin,D,sf, uFA_noFWE,Klin_noFWE,Kiso_noFWE,D_noFWE] = uFA_fwe(file, bvals, isIso, maskfile, D_CSF, opt) % % Estimate microscopic fractional anisotropy and related parameters with a % free water elimination approach. % % INPUTS % file: path to NIFTI file containing raw image data % bv...
bb509948ddf43b9a3cbcbfe510e9bcca614d99035bbf75befb3d561136c51f23
MATLAB
10,125
266
function [data, t,frametimes, roidata] = tpreaddata(dirname, intervals, pixelinds, mode, channel) % TPREADDATA - Reads twophon data % % [DATA, T] = TPREADDATA(DIRNAME, INTERVALS, PIXELINDS, MODE) % % Reads data blocks from PrairieView record. TPREADDATA % allows the user to request data in specific time intervals ...
7cb2c0b539aa779c93ef53507af3b950d650d4850188ca4f0d9ba8ee56144154
MATLAB
10,147
291
function output = fft_registration(buf1ft,buf2ft,usfac,min_shift,max_shift) % Efficient subpixel image registration by crosscorrelation. This code % gives the same precision as the FFT upsampled cross correlation in a % small fraction of the computation time and with reduced memory % requirements. It obtains an initi...
7c12748a20659849d3e507fa87cd4dd80b3e095895472eb32c75965a8a29c6e7
MATLAB
10,170
196
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Analysis of absolute EEG spectra % Script written: Lukas B Krone 2021 based on previous script % % INPUT: % - "-VSspec" files for one EEG channel for each date with a different injection condition (saline, 1mg/kg CNO, 5mg/kg CNO, 10mg...
244301554c03ca2f3e68475935df9dae09725fa90cc70e1abec11c6e57f2e0e5
MATLAB
10,182
255
function [model,invariants,varargout] = qtiplus_fit(data,btensors,varargin) % function [model,invariants,varargout] = qtiplus_fit(data, btensors) % % This function computes the non-diffusion weighted signal S0, the mean % diffusivity tensor D, and the covariance tensor C as implied by the QTI % framework. During t...
93cc180bd27cd485bc775f1cd97291fa2a66f7f2de9ec57076e3c36e63af6d95
MATLAB
10,193
327
function varargout = f_ERP_meas_format_path(varargin) % F_ERP_MEAS_FORMAT_PATH MATLAB code for f_ERP_meas_format_path.fig % F_ERP_MEAS_FORMAT_PATH, by itself, creates a new F_ERP_MEAS_FORMAT_PATH or raises the existing % singleton*. % % H = F_ERP_MEAS_FORMAT_PATH returns the handle to a new F_ERP_MEAS_FO...
3e9b58eb1740c9e6ac2942b12c7c077621b05801ae473fcd7cebed34cd4292ea
MATLAB
10,209
236
function [p_values, h_mask, p_values_new_n, h_mask_new_n, conf_intervals, ... test_statistic, cohend] = ... compute_significance_matrix(all_data, alpha_level, new_n, ... paired_tests, mean_H0, always_t_test, two_sided, cell_pairwise_comp, ... angles_in_rad) % Compute all the paired-significances ...
510087e4e21e1e0a6c974e39f7e55d4b420a0b153198f0fe0183b51d0295bb44
MATLAB
10,228
222
% % This script collects the metadata, extracts the average CCEPs and detects N1s for all the subjects % % Jaap van der Aar, Giulio Castegnaro, Dora Hermes, Dorien van Blooijs, Max van den Boom, 2022 % %% % Configure clc clear warning('on'); warning('backtrace', 'off') myDataPath = setLocalDataPath(1); % check fi...
3d99b4a922049efacdd330ab3f77f2272e6664f8a80071ca291b7608a388ab4c
MATLAB
10,236
309
function Iccs = Iccs_op_me(A, Pjoint) % calculate redundancy as from pointwise common change in surprise % use maximum entropy subejct to pairwise predictor-target marginal % and all predictor marginal constraints % A - cell array of elements % Pjoint - full joint distribution s = size(Pjoint); Sm = s(end); % number o...