sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3e5439d996d333a0f518d3d3e1be8c0e3a7d530baa1993940b58e31bc7670400
MATLAB
10,043
156
function info = process_Training( subjectName, subjectID, scanNum, currentRun ) % (c) Coraline Rinn Iordan 09/2017, 10/2017, 02/2018, 04/2018 % % This version normalizes w.r.t. the initial 30 TR countdown in the run % Each run has 316 TRs total ; used: 310 TRs ( = number of NIFTI files exported ) if nargin < 4, error(...
64574dd21cdcceb80c9fb19a5e7a1322823a2a91df4f3999effa445c152b1313
MATLAB
10,051
257
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
78ee9dfd443d8f0ba85c64d674a00dac3f932442993c0bcafe84aa2c4bd5bada
MATLAB
10,057
182
function replay_firing_stats= get_firing_stats_replay(folders,method) % calculates firing distributions during replay for cells included in % rate_remapping analysis for each epoch % if epochs are added in remapping struct, need to update this code as well % distributions returned: time between first and last spike in ...
a68cc10e1c1ff32097745bebb2efc578c71eb14b7380cbf0be9be08138de93ed
MATLAB
10,058
266
function [im_hatch,colorlist] = applyhatch_pluscolor(h,patterns,CvBW,Hinvert,colorlist, ... dpi,hatchsc,lw) %APPLYHATCH_PLUSCOLOR Apply hatched patterns to a figure in BW or Color % APPLYHATCH_PLUSCOLOR(H,PATTERNS) creates a new figure from the figure H by % replaci...
e82469188c230395ed5d76b75501cf325c9b4cb288de6803dff2b1a118f920c4
MATLAB
10,059
164
function varargout = processArgs(args,varargin) % Similar to process_options but allows both positional and named arguments % % This function also provides optional enforcement of required inputs, and % optional type checking. Argument names, if used, must start with the '-' % character and not precede any positio...
2d2cc59a6ed366a15a9d0db611199e8b48c19a14f44c3acee19650727cb61ea2
MATLAB
10,060
253
function varargout = DPARSF_FieldMap(varargin) % DPARSF_FIELDMAP MATLAB code for DPARSF_FieldMap.fig % DPARSF_FIELDMAP, by itself, creates a new DPARSF_FIELDMAP or raises the existing % singleton*. % % H = DPARSF_FIELDMAP returns the handle to a new DPARSF_FIELDMAP or the handle to % the existing si...
7c0e1cf01442674945ca6725d3db7bfd324b380ebdfca257e93e7335111e209b
MATLAB
10,062
294
function [out1,out2,out3] = ginput(arg1) %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse. Data points are entered by pressing % a mouse button or any key...
08bcbdad4eda4cf820f9af1ec2ccff32b6abd44077769111a74306cf43c3c1e2
MATLAB
10,066
315
%% Overview % % Here we summarise the results of the HMM inference and compute the % task-evoked GLM statistics config = utils.get_studydetails; % Define colours to use in state plots set1_cols = utils.set1_cols; % Define sample rate sample_rate = 250; %% Load in results from envelope data % Meta data method = 'en...
b19de26abb188a0c1b448b89065329df6ddd0dde13e215d8575ac28cdb3dbf89
MATLAB
10,067
316
function [fh,axh,lh] = plotPlotStruct(axh, pStruct, lineSet, widthSet, symbolSet, colorSet, plotArgs, errArgs, axisArgs, legendArgs, labelArgs, titleArgs) if (nargin < 1) || isempty(axh) fh=figure; axes; axh = gca; else fh = axh.Parent; end if ((nargin < 3) || (isempty(li...
242a3eb3b45186325b62d0885722a8b70f8f2927c2b24c5835cf54fb5a804316
MATLAB
10,071
279
function [xbest, fbest, info, options] = pso(problem, x, options) % Particle swarm optimization (PSO) for derivative-free minimization. % % function [x, cost, info, options] = pso(problem) % function [x, cost, info, options] = pso(problem, x0) % function [x, cost, info, options] = pso(problem, x0, options) % func...
ba313ef3f7906dd3d7ad6132b3172b934437f8c6566ebbeba530ba1dc73f4d34
MATLAB
10,074
263
numClusters = som_dim(1)^2 ; % Inizializzare una matrice per memorizzare le differenze medie per ogni neurone differences = zeros(Nregions, Nregions, numClusters); % Calcolare la matrice di connettività media per ciascun neurone (cluster) mean_matrices = zeros(Nregions, Nregions, numClusters); for k = 1:numC...
47e62b800b5a9e92071ba25f34d6fa563ff20e1bcd0a8ae5bf735ef6c906c47e
MATLAB
10,091
247
% TODO make function? % function [outstruct] = EyeMem_expdesign(phase) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % experimental design (start) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % TEST SETTINGS: 1 runs, 30 trials study, 60 test. 70 minutes % stim_category = {'naturals2'}; % 'fractals','landscapes','naturals1','natura...
5c096cee6c6c6cf4d91b5c8a8d8e481975bf598277d716401db5f6f2d8889adf
MATLAB
10,094
303
function varargout = ginput_ZN(varargin) %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse. Data points are entered by pressing % a mouse button or any key...
a0763747fb0c6aa069996c01e1c3954bb2179c043899f8e50d766192e9c8baa9
MATLAB
10,101
283
function [mri, hdr, cpersist] = read_ctf_mri4(filename) % READ_CTF_MRI reads header and imnage data from CTF format MRI file % % [mri, hdr] = read_ctf_mri(filename) % % See also READ_CTF_MEG4, READ_CTF_RES4 % Copyright (C) 2008 Ivar Clemens % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for...
03ec981894d0bed5b49a53402f0efe97526099e52fbc82befa2e87887810e700
MATLAB
10,103
165
function sPPI_and_gPPI_without_deconv_FIR(stat_path,exp_folder,N,N_ROIs,q_level,ground_truth) % ======================================================================== % Ruslan Masharipov, October, 2023 % email: ruslan.s.masharipov@gmail.com % ======================================================================== ...
088ca60f6d5d741ae2fccbfc6cfbbae5cf6ed25628dbbbfa35bdbfdb8729915e
MATLAB
10,104
171
%% muscle GCaMP imaging % This only works with speicific folder,subfolder arrangement as in % selected_60-30_powdered_ACR1 subFolders = dir(pwd); realSubFolders = subFolders([subFolders.isdir]'); realSubFolders = realSubFolders(~startsWith({realSubFolders.name},{'movies'})); realSubFolders = realSubFolders(~sta...
c0045a4eb55338b4d252c52c98d230c2ade5af9499b930d99cc1831c11a7b833
MATLAB
10,107
318
function [posterior,out] = VBA_groupBMC(L,options) % VB algorithm for group-level Bayesian Model Comparison % function [posterior,out] = VBA_groupBMC(L,options) % IN: % - L: Kxn array of log-model evidences (K models; n subjects) % - options: a structure containing the following fields: % .priors: this variab...
73b250026733b93f9cec4a3bb80b26b1d1edc6f32792db0562148af615466eb5
MATLAB
10,112
364
function stats = rm_anova(x, s, f) % % REPEATED MEASURES ANOVA % REQUIRES STATS TOOLBOX, otherwise can use 'mycombnk' (ask Anne) % % Usage: % >> stats = rm_anova(x, s, f); % x = 1xN vector with data values % s = 1xN vector with subject numbers, or the factor to repeat % meas...
ee4af474833bda7de425eabc61eac288c42a19130c5323a08e2f2907724515b9
MATLAB
10,112
334
function F = srskelf_hybrid(A,x,occ,rank_or_tol,pxyfun,opts) % SRSKELF_HYBRID Strong recursive skeletonization factorization with % hybrid admissibility (symmetric positive definite only). % % F = SRSKELF_HYBRID(A,X,OCC,RANK_OR_TOL,PXYFUN) produces a % factorization F of the interaction matrix A on the points ...
372063d9fdc3c127e3e55a923db505b0d7a09f1b77ce70373d9bb84f209b2f30
MATLAB
10,115
187
function shuffled_track = global_remapped_run_shuffles(shuffle_choice,analysis_type,num_shuffles,decoded_replay_events,place_fields_BAYESIAN,BAYSESIAN_NORMALIZED_ACROSS_TRACKS) % computes shuffles on replay events % shuffle_choice- determines what type of shuffles will be performed, entered as a string % % analysis typ...
2ae2a427bee0a2262d01a37332b6dfed8b58aaa61fa054988c21a0d51cef18c4
MATLAB
10,118
176
function y_ResultsOrganizer(WorkingDir,SubjectID,OutputDir) % FORMAT y_ResultsOrganizer(WorkingDir,SubjectID,OutputDir) % Input: % WorkingDir - the directory contains processed data % SubjectID - the list of subject IDs for organize. n by 1 cell % OutputDir - the directory for saving results % Output: % ...
98ec95b4ddccc81a57cec6064bf7bec3001153c412c0c7105a7a627ce3706b2b
MATLAB
10,126
253
function hText = xticklabel_rotate(XTick,rot,varargin) %hText = xticklabel_rotate(XTick,rot,XTickLabel,varargin) Rotate XTickLabel % % Syntax: xticklabel_rotate % % Input: % {opt} XTick - vector array of XTick positions & values (numeric) % uses current XTick values o...
0dbeb5733859b53303d093a1a6ca9ff9c72e6bd1e5a6d503823e1128a9e2176e
MATLAB
10,127
227
% MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % % Description: % This m-file generates initial morphological parameters for 9 muscle % groups, incluing a and phi % It includes range...
4ed0ae333104fa8fc510eb0dd60abfa53ee5329e637db4187165af9a57a83683
MATLAB
10,127
311
%% CellHCat ("Cellwise Horizonal Concatenation") % Macro to perform universal horizontal concatenation of array elements across a cell (dim 2) % assumes that the 1st dimension is constant across all rows; tranpose if % this assumption is violated. % % % Potential Inputs and Behaviors: % --------------- % 1xN cell arr...
c506ef6d18f40831156c282d593ae0312adda60175b18c617ee3be882d85a02c
MATLAB
10,136
254
function [Final_Spikes] = FP_SPIKECOUNT(DF_DEBLEACHED,Threshold, Ts,Fs, Hold_Constant, ZERO_RULE) %% By David Estrin & David Barker for the Barker Laboratory % Code is written for ____ et al., 2020 % The purpose of this code is to take debleached calcium signal previously % calculated in FP_DEBBLEACHED.m function a...
8e65fd50c90cc20c1ef4c44169ca68bee8aeceac1add8749de731dbca5a2b546
MATLAB
10,137
302
%epa_4points Analyzes responses using 4 points per participant % % This script analyzes data from the endogenously driven % pro/antisaccade task. It uses results generated by epa_win_pc, which % computes, for each participant and each experiment, the probability % of a correct pro or a correct anti choice for all ...
48f4b0b74046a0dab66fb9e02722cea4bffa1ebf3a4f6c04f28cc3ae2f403fe4
MATLAB
10,144
221
function [u,r,GAMMA,g] = GNblock_ur(u,r,nt,dt,par,tag_str) %% Created by Xinan Chen in Dec 2021 %% This function is the main function to optimize on the velocity field u and time-space dependent relative source r %% if nargin < 6 tag_str = ''; end [Gamma,Gamma1,Gamma2,Gamma3] = get_Gamma(par.drho0...
0d572e1252084aa72e24eee19c9c66a9860f6c16684080a5f49d501e2e2b8e55
MATLAB
10,148
232
% Written by: Tianyin Xu % Edited by: Qiuting Wen, Adam Wright % Last modified: 20241007 -- AMW % Inputs: % fMRI_path -- the scans path -- this path must include the following % files: % - SSS_mask_fmri.nii.gz (Transformed SSS MNI atlas into fMRI space) % - R2mean_100trial_wholeBrain.nii.gz (generated from alig...
1716c8b9443d5378931fafe9333dc313e027a00c88a5956127e167147bf5c945
MATLAB
10,151
309
%SPTENSOR Class for sparse tensors. % %SPTENSOR Methods: % and - Logical AND (&) for sptensors. % collapse - Collapse sparse tensor along specified dimensions. % contract - Contract sparse tensor along two dimensions (array trace). % ctranspose - is not defined for sparse tensors. % disp - Co...
0366f1e395b484af10625146e1c2eb449b75bbdbf485bb61f45bf667030b8343
MATLAB
10,161
264
% demo_flickering_gratings % add repository path to MATLAB path addpath(genpath('..\subunit_grid_model')) %% % set experiment folder expfolder = '20220301_60MEA_marmoset_left_s1'; % load data from selected experiment expdata = load(fullfile('..\subunit_grid_model', expfolder, 'expdata.mat')); % grating flicker...
166c4df4af36d13ad36f25f0a2e3f114e6a14cc21ffde87284e0649e81b3a22f
MATLAB
10,162
240
% create_mice_all_randomMotorizedTreadmill.m % Sarah West % 11/30/21 % Creates and saves the lists of data you'll use for the given experiement % (mouse names and days of data collected). % Each row of the structure is a different mouse. %% Parameters for directories clear all; experiment_name='Random Motorized ...
ffce0991d01e04fe43eb99cb67601557548170b30b45b0f15d7eebc364081546
MATLAB
10,162
210
% Writes all features of the ImageJ (IJ) binary roi file format (*.roi) as specified by ij.io.RoiDecoder. % matlabpathcoors - an ordered list of coordinate pairs that describe a single ROI boundary. Coordinates assumed to be (y,x) order (where y is vertical image axis and x horizontal image axis) and follow the Ma...
b1fcd661f2bc28c0ed285c4306997cd688a4becd76d1de6de712b4070db53c1d
MATLAB
10,168
287
function [mri, hdr, cpersist] = read_ctf_mri4(filename) % READ_CTF_MRI reads header and imnage data from CTF format MRI file % % [mri, hdr] = read_ctf_mri(filename) % % See also READ_CTF_MEG4, READ_CTF_RES4 % Copyright (C) 2008 Ivar Clemens % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for...
fd0848bc5674938e889fb18c5a644ab3a634fbe404983adab8881e55edde8401
MATLAB
10,169
193
%% Create manuscript table % _________________________________________________________________________ % % Robert Dahnke & Polona Kalc % Structural Brain Mapping Group (https://neuro-jena.github.io) % Departments of Neurology and Psychiatry % Jena University Hospital % __________________________________________________...
d3c8b39fb7d68c9c8c6ccf063a0d9fda54a82de49d252568f8a39632c37df4c9
MATLAB
10,172
278
%% Plot cortical sources for NeVRo study % Project the spatial patterns from SSD, CSP, and SPoC into source space % by using eLORETA. % % Launch this script from top level of the NeVRo repository. % BEFORE RUNNING: % - Download the "New York Head" Leadfield from https://www.parralab.org/nyhead/ % - make sure the file...
b7523ca70721a5a89d2181d33b7af0b8d4966cb89139db9626a4d6b0b0f8cb2b
MATLAB
10,175
290
function [data] = ft_datatype_raw(data, varargin) % FT_DATATYPE_RAW describes the FieldTrip MATLAB structure for raw data % % The raw datatype represents sensor-level time-domain data typically % obtained after calling FT_DEFINETRIAL and FT_PREPROCESSING. It contains % one or multiple segments of data, each represente...
aac77793f7ecd8c322831b1794a100f5c6f60d431dcbbbabaab968c70c21f3b8
MATLAB
10,184
205
function y_MixedEffectsAnalysis_Image(DependentDir,OutputName,MaskFile,CovariateDirs,OtherCovariates, PALMSettings) % y_MixedEffectsAnalysis_Image(DependentDir,BetweenSubjectFactor,WithinSubjectFactor,OutputName,MaskFile,CovariateDirs,OtherCovariates) % Perform mixed effect analysis: one between subject factor, one wit...
db57779d56721fa793d4d1127fa4b269660b024cbcac46027a0d962753b2dd38
MATLAB
10,195
390
% Copyright (c) 2008 INRIA - Asclepios Project. All rights reserved. function [A,h]=loadinr(name,slice) %Load INR format image % [A,H] = LOADINR(NAME,SLICE) % Input arguments: % NAME filename % SLICE slice numbers, optional, [first slice ,last slice] % % Output arguments: % A im...
37fe66f4bfd5d66ac80c09e3d3084f610bc8da2b55182dd6983a1a6addea90e2
MATLAB
10,196
260
function [p_Brain, F_Brain, Header] = y_CWAS(DataUpDir, SubID, AResultFilename, AMaskFilename, Regressor, iter, IsNeedDetrend, Band, TR) % [p_Brain, F_Brain, Header] = y_CWAS(DataUpDir, SubID, AResultFilename, AMaskFilename, Regressor, iter, IsNeedDetrend, Band, TR) % Perform CWAS % Input: % DataUpDir The direct...
b7e21f16a8bafa8038e559f4f6cc07ac698607f4f5e9020afcfe7b87d36663cf
MATLAB
10,197
394
function [varargout] = eig_geap(A,B,varargin) %EIG_GEAP Shifted power method for generalized tensor eigenproblem. % % [LAMBDA,X] = EIG_GEAP(A,B) finds an eigenvalue (LAMBDA) and eigenvector % (X) for the real tensor A and the positive definite tensor B such that % Ax^{m-1} = lambda * Bx^{m-1}. % % [LAMBDA,X] =...
87a27fddc7a479c2b13307cdc101a18a32c77961aa308429f93cd35eb80cedcc
MATLAB
10,208
274
%% Multiplying tensors %% Tensor times vector (ttv for tensor) % Compute a tensor times a vector (or vectors) in one (or more) modes. rand('state',0); X = tenrand([5,3,4,2]); %<-- Create a dense tensor. A = rand(5,1); B = rand(3,1); C = rand(4,1); D = rand(2,1); %<-- Some vectors. %% Y = ttv(X, A, 1) %<-- X times A in...
86313cf4a3138532a72f4e469a890542e3143eb4def34c8e9bb9baec993ff206
MATLAB
10,212
370
%% All trials ERPAC addpath([DIRscript, '/PAC']); addpath([DIRscript, '/ERPAC']); DIRspectro=[DIRresults, '/ERPAC/']; mkdir(DIRspectro) [PAC_value, PAC_z, PAC_sig] = erpac_corr(LFPRawAll(good_chan(26),:), DecFS, ... task_data(:,3), [-100 900], 2, 8, 70, 190, 100); figure subplot(3,1,1) plot(PAC_value) xlabel('T...
6394ad0ccfaefa917ae08acb406a9321774de726cb438b284b24da74eff516ea
MATLAB
10,227
366
classdef TreeNode < handle % Seems to be a general handle class for representing a rooted tree, where % each node can have some data associated with it. -- ALT, 2025-02-04 properties Data Children % vector of TreeNodes end methods function obj = TreeNode(dat,isjsonstruct,varargin) ...
9bc6d378704febc3a5de6709dfa26ea3677888603698024a41d5bd503812f869
MATLAB
10,228
166
function sPPI_and_gPPI_without_deconv_no_centering_FIR(stat_path,exp_folder,N,N_ROIs,q_level,ground_truth) % ======================================================================== % Ruslan Masharipov, July, 2024 % email: ruslan.s.masharipov@gmail.com % ================================================================...
34e3d4fee72fd61f011689494cc217ad9ffb870b9f47fd68bff91b9a2174bf69
MATLAB
10,231
255
function CrossDecodeAnalysisAction(AllTrialData,Labels,DecodeLabels,TimeWindow,OutDir,Tag,varargin) % Train on dim 1 to classify dim 2, test on how well it generalizes. % e.g. train on nancy to diff bp, test how well bp diff'd in Tyson. [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh','fdr'); % [~,NIter] ...
8b46f5d86c4ad96d7d8f7f4c84415e2abbb17bd88c5579faf168bce061955f4a
MATLAB
10,233
283
function [x, cost, info, options] = neldermead(problem, x, options) % Nelder Mead optimization algorithm for derivative-free minimization. % % function [x, cost, info, options] = neldermead(problem) % function [x, cost, info, options] = neldermead(problem, x0) % function [x, cost, info, options] = neldermead(probl...
5721161515c7ee19576b40664ea3ad91c91065aea8d3266b829d8637ed686657
MATLAB
10,242
355
% LIP single-trial decision variable analyses %% General setting % Always need to run this section global mLoc mLoc = 'My\code\location\m-files'; cd(mLoc) dat_path = 'My\data\location\single trial_data'; global saveLoc saveLoc = fullfile(dat_path, 'All Sessions'); if exist(saveLoc) == 0 mkdir(save...
c0a11100366ff855c7cfdebd23cc815dc355cf133b14d36f39d8f76319b089e1
MATLAB
10,242
328
% MediatedModeration clc; clear all; close all; timelock = 'readyBS'; load(sprintf('TrioEEGAnalyseByTrials_%s.mat',timelock), 'meanAmplTrials','meanAmplTrialsPost'); %% load('TrioEEGBehAnalysis.mat','trialTab'); %% trialTab.erp1 = col(meanAmplTrials(:,:,:,:,30,:)); % early ERP -Cz trialTab.erp2 = col(meanAmplTrialsPos...
1a443b6f9dde74daa56044c35640091643056be28d75e8fb38c6a81a842628a7
MATLAB
10,246
359
function [C,Ceq] = Constraint_Function (xopt) NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat'); NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial; G = 8; % Muscle Group Number (G = 1 to 9) x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.a1; x0(2)...
7a67a866f264f44e7156104136a392b38803c2e13a924fc982aa53c8def7806b
MATLAB
10,247
362
function [C,Ceq] = Constraint_Function (xopt) NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat'); NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial; G = 1; % Muscle Group Number (G = 1 to 9) x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.a1; x0(2)...
e7436bdf261e4663206646a9fc704a7633d8741281b338c770523bf3996a7e1d
MATLAB
10,247
293
function [ output_args ] = PlotSingleUnitERAs(AllTrialData,PlotConds,Phases,TimeWindows,OutDir,varargin) %PLOTSINGLEUNITERAS Plots ERAs for specified units and conditions. % Units: Matrix of unit IDs (e.g. ASF). All by default % PlotConds: Cell array containing subselection criteria use for % extracting s...
7b290673a32c72e8e1f7592a76b8a639b8db5d663c58bd060a68b8544ab0f54e
MATLAB
10,249
247
function [acc, loss] = CBIG_KRR_innerloop_cv_allparams( test_fold, sub_fold, num_inner_folds, ... data_dir, y_resid_stem, with_bias, ker_param, lambda_set, threshold_set, metric ) % [acc, acc_concat] = CBIG_KRR_innerloop_cv_allparams( test_fold, num_inner_folds, ... % outdir, y_resid, ker_param, lambda_set, th...
ba3ea76e40f37b9deba393deee1584774225b66eaf657036041318350a3c5f85
MATLAB
10,253
293
function [ output_args ] = PlotSingleUnitERAsAction(AllTrialData,PlotConds,Phases,TimeWindows,OutDir,varargin) %PLOTSINGLEUNITERAS Plots ERAs for specified units and conditions. % Units: Matrix of unit IDs (e.g. ASF). All by default % PlotConds: Cell array containing subselection criteria use for % extrac...
067b319bf70a9398a90bbc7ddadde6ddc46fe4944b9cd85ffea4799f3a9b092a
MATLAB
10,259
290
function [dipout] = beamformer_sam(dip, sens, headmodel, dat, all_cov, varargin) % BEAMFORMER_SAM scans on pre-defined dipole locations with a single % dipole and returns the CTF Synthetic Aperture Magnetometry (SAM) % beamformer estimates. location. Dipole locations that are outside % the head will return a NaN value...
5070b655c9add4028e0a0a094288c375e00d583e16f37de579b8a068d6b39f17
MATLAB
10,263
286
function ConvertKilosort2Neurosuite_KSW(rez) % Converts KiloSort templates Klusta into klusters-compatible % fet,res,clu,spk files. Works on a single shank of a recording, assumes a % 16bit .dat and an .xml file is present in "basepath" (home folder) and % that they are named basename.dat and basename.xml. % % In...
9153471d5068ff2f075add20f1d1e438d8eed82c609a21e6f868c0715d925e45
MATLAB
10,263
209
function [cfg, artifact] = ft_artifact_tms(cfg, data) % FT_ARTIFACT_TMS reads the data segments of interest from file and identifies artefacts in % EEG recordings that were done during TMS stimulation. % % Use as % [cfg, artifact] = ft_artifact_tms(cfg) % with the configuration options % cfg.dataset = string w...
3f0bdda9d79af6477651f566b1f4e71f6d15d0e08f62bec446132b6eff715d00
MATLAB
10,267
211
% This is performed through the BrainVoyager 20.6 scripting platform, along with NeuroElf v1.1 % (after running the preprocessing pipeline script) % % Each subject directory should contain VMR (anatomical) and FMR (functional) files % In addition, you need to copy the relevant PRT (experiment protocol) files to the...
aee9783f6ae724e4608450f068ee929d2bce47ca26b9c39e2c360362e0806ba9
MATLAB
10,271
276
function [fet clu spktimes wav]= ConvertKlusta2Matlab(shank,basepath,... basename,wvformExtract,saveFiles,numCores,keepMUA) % USAGE % % [fet clu spktimes wav]= ConvertKlusta2Matlab(shank,basepath,basename,wvformExtract,saveFiles,numCores) % % INPUTS % % shank - the shank number (as a number, not text) equalling the...
7d0e3d1cba9ac3518a05eabfe2e0480c80ece3ef141bdfd93e6c44eed31b644b
MATLAB
10,278
227
function h_getCurrentImg3(handles) global h_img3 % tic [redData, greenData, blueData] = h_getZFilteredData(handles);%this has to be done before below because it may change h_img3; % toc [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); siz = currentStruct.image.data.size; cur...
3aa9008b8011c0ec389582368e568ee748b3943dcee631c91edc3dd3e7514bd1
MATLAB
10,285
225
function [beh, behMap, behView] = reformBehav(par, dd) % reformBehav reformat behavioral indicators per trial into structures for % different trial types % Inputs % par = structure defining file locations and a few additional % paprameters % dd = structure including behavioral indicators per...
ab7b4d43bf31e83509bb95347d95c7ff6e353a50c46e010485e5923b4ea478fc
MATLAB
10,286
294
% HIFIE2_BASE Dispatch for HIFIE2 and HIFIE2X. function F = hifie2_base(A,x,occ,rank_or_tol,idfun,pxyfun,opts) % set default parameters if nargin < 6, pxyfun = []; end if nargin < 7, opts = []; end if ~isfield(opts,'lvlmax'), opts.lvlmax = Inf; end if ~isfield(opts,'ext'), opts.ext = []; end if ~isfield(...
8acbf418ccd777ad0ae99ebc980db923a15b6d1dd1c2ae3f6af8e7309ee1a8e2
MATLAB
10,290
277
% RSKEL Recursive skeletonization. % % The recursive skeletonization algorithm approximates a hierarchically rank- % structured matrix A as a multilevel low-rank perturbation A = D + U*S*V', % where D is a block diagonal submatrix of A, U and V are block diagonal and % rectangular, and S is a submatrix of ...
3969933f3d2a55d99f5bd6af7acc285c02a1ab5048959414ce3e4e4999f85dc4
MATLAB
10,296
366
% Field Trip-related test scripts - Synthetic FT data - Calculation % % % Includes. % FIXME - Assume init has already been called. % % % Get event results for the "chosen" threshold values. disp('-- Selecting event lists with chosen thresholds.'); detectft_mag_selected = detectft_mag{1}; detectft_freq_selected...
b67f7f6c6ca53c614ad9695ea2578d09c8cccb72ec22c5ad359c02d697e6cd3f
MATLAB
10,299
278
%__________________________________________________________________________ % violin.m - Simple violin plot using matlab default kernel density estimation % % Updates: % v2: extended for accepting also cells of different length % v3: % - changed varargin to parameter - value list % - specification of x-ax...
d6ec50799c2cfbc860e88fc78b0364d19d0a892b7d9a550d0a84bbb22e58c3a0
MATLAB
10,303
288
function [scd] = ft_scalpcurrentdensity(cfg, data) % FT_SCALPCURRENTDENSITY computes an estimate of the SCD using the % second-order derivative (the surface Laplacian) of the EEG potential % distribution % % The relation between the surface Laplacian and the SCD is explained % in more detail on http://tinyurl.com/ptov...
29f8dce0b01f581a05905efe90e60efa59eb9c20acdb4cfdef13ae5c30672f34
MATLAB
10,304
322
classdef ViewConfig properties (Constant) GAMMA_CORRECT_CMAP_LEN = 256; end % A ViewConfig is essentially the .View substructure of a project % configuration. It contains: % * FigurePos % * XLim, YLim (if present => .X/YLimMode='manual', otherwise 'auto') % * XDir, YDir % * CLim % * Gamma co...
023bfe5007d506bc27ea77d6ed24e27f52bd3e0974d81a24691ec9be5f21e0d1
MATLAB
10,306
235
function TSimporteventcodes(filename,inter) % TSIMPORTEVENTCODES Imports event codes to the Experiment from a textfile. % TSimporteventcodes(filename) imports codes from an ascii textfile. This % can be a file made with TSexporteventcodes or made in a text editor. % This codeset will overwrite whatever codes were...
7e24f0ffd51017c4f5182908b0d7fb855d0b901b5178027bb7e76338efac4ca8
MATLAB
10,307
266
function [J,data] = jacobian_DCS(mesh,tau_DCS,varargin) % JACOBIAN_DCS Calculates spatial distributions of sensitivity of % normalized autocorrelation registerd on the mesh boundary (detector) to % changes of flow per mesh node. % % SYNTAX: % [J,DATA] = JACOBIAN_DCS(MESH,TAU_DCS) % [J,DATA] = JACOBIAN_DCS(MESH,TA...
511abe490e6dc1b1c12ff260734f7c259f8426d5410d337d7362e04e815a2643
MATLAB
10,310
258
classdef planarEdgeDetector < surfaceDetection.planarDetector % planarDetector Extract a surface point cloud from a planar data stack % % As opposed to other detectors, the detected surface is % represented not only by a PointCloud object but also by an image % surfaceMatrix, containing z values for...
6157eb2fbd502b7c245d039a787676756984b221baa02292a3d66c74fa18110b
MATLAB
10,312
308
function [specslope,spec] = bz_PowerSpectrumSlope(lfp,winsize,dt,varargin) %[specslope,spec] = bz_PowerSpectrumSlope(lfp,winsize,dt) calculates the %slope of the power spectrum, a metric of cortical state and E/I balance %see Gao, Peterson, Voytek 2016; Waston, Ding, Buzsaki 2017 % %INPUTS % lfp a buzcode-fo...
a9e15cf284d1aa96abc846edca086bf7da6cd8b1277a03a8f39f87caa4d1341e
MATLAB
10,312
227
function varargout = DPABIFiber(varargin) % DPABIFIBER MATLAB code for DPABIFiber.fig % DPABIFIBER, by itself, creates a new DPABIFIBER or raises the existing % singleton*. % % H = DPABIFIBER returns the handle to a new DPABIFIBER or the handle to % the existing singleton*. % % DPABIFIB...
1c7d3f8c1ee0f4d4fcb9ca0b2f1326ea195b0a6ba04c589bbc40da143a91eb47
MATLAB
10,314
306
function save_mesh(mesh,fn) % SAVE_MESH Saves a FEM mesh in NIRFAST format into ASCII files. % % SYNTAX: % SAVE_MESH(MESH,FN) % SAVE_MESH(FN,MESH) % % SAVE_MESH(MESH,FN) Saves the MESH structure of FEM mesh in NIRFAST % format into MATLAB *.mat file or ASCII files. % FN - the root filename of the mesh (with no...
80560d6b94eaa8cca642f0c948b3c16790428270888dcb8abaabd1e5e485926b
MATLAB
10,329
319
function demo_designOptimization () % // VBA toolbox ////////////////////////////////////////////////////////// % % [posterior, out] = demo_designOptimization () % demo of off-line and online design optimisation % % This demo simulates a psychophysics paradigm similar to a signal % detection task, whereby the detection...
94e7f1c2be4d1d3278f616f4432fa2dd0dfcec0cd51a0c70acfb28621a3c7b67
MATLAB
10,332
209
function [cfg, artifact] = ft_artifact_tms(cfg, data) % FT_ARTIFACT_TMS reads the data segments of interest from file and identifies artefacts in % EEG recordings that were done during TMS stimulation. % % Use as % [cfg, artifact] = ft_artifact_tms(cfg) % with the configuration options % cfg.dataset = string w...
1aa41871885841712ffcc0864b9bcb82f001f6f7e671a6175c51562072ec2cf9
MATLAB
10,335
301
function [type, dimord] = ft_datatype(data, desired) % FT_DATATYPE determines the type of data represented in a FieldTrip data % structure and returns a string with raw, freq, timelock source, comp, % spike, source, volume, dip, montage, event. % % Use as % [type, dimord] = ft_datatype(data) % [status] = ft_...
233d80d521e56f1d02694f411e9601bfd0803972efe9f69d78d8760bd91c9507
MATLAB
10,338
196
%% Create manuscript-revision table % _________________________________________________________________________ % % Robert Dahnke & Polona Kalc % Structural Brain Mapping Group (https://neuro-jena.github.io) % Departments of Neurology and Psychiatry % Jena University Hospital % _________________________________________...
31643be981e8441a9cc543aeb2848372e7825d263360f51d5533d47c6e57075b
MATLAB
10,338
310
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-2016 The MathWorks, Inc. % $Revision: 1602 $ $Date: 2018-05-01 10:23:15 +0100 (Tue,...
1765cb5abb94b44300ede2b9effdf5420e8fe9bc283c02c821cf45d56e1f6f3b
MATLAB
10,345
262
function [event] = read_trigger(filename, varargin) % READ_TRIGGER extracts the events from a continuous trigger channel % This function is a helper function to read_event and can be used for all % dataformats that have one or multiple continuously sampled TTL channels % in the data. % % This is a helper function for ...
95a0555e47b1887b647bdd8c6f75d12fd63576e50c9f8d225b6ab112f9a380e8
MATLAB
10,358
441
function GLAN = erp_stata_group(GLAN,cfg) % % REALIZA ESTADISTICA NOPARAMETRICA A ERP % % cfg. % subject = [{}{}{};{}{}{}] % comp = 1; % INDEX OF THE CONDITION TO COMPARED , ONLY TWO!!! % alpha =0.05; % s ='d'; OR ='i' % RELATIONSHEAP TO THE SAMPLES 'i'NDEPENDENT OR 'd'EPENDET % bl =[ 0 0.4]; % BASELINE % ...
5649d364f6b66de8b2ac1677ed6c79744737c5f144cf20b9df57b3d4de0b6ce7
MATLAB
10,359
324
function PlotClusters_AM(spkDat, clustList, varargin) % convert waveform data from int16 to double-precision floating point spkDat.waves = double(spkDat.waves); maxScale = Inf; refWave = []; sameScale = false; showMean = true; convertToVolt = true; quantiles = []; minIsi = 1; % in milliseconds nSampTarget = 500; rate...
37b4c301ce936cb82657d2403b14c03433098b9ace53d619425081d7bb9eaf6f
MATLAB
10,360
199
%Step 3 of CBIG Kong2019 Brain Parc Pipeline % %To run: 1. Open Matlab using salloc (ex: `salloc --mem-per-cpu 6G --time 2:00:00 --x11`) % 2. source your config file containing the $CBIG_CODE_DIR variable % 3. `cd` to the $CBIG_CODE_DIR/stable_projects/brain_parcellation/Kong2019_MSHBM/step3... folder % 4. `cp` thi...
30beffca1e6a2e05e5cb107620aab96a6005ac81e80cf65eec086bcd2cb60f7f
MATLAB
10,361
352
function lan_setref_micromed(LAN) % <*LAN)<] toolbox % v.0.0.3 % % Pablo Billeke % Francisco Zamorano % 09.10.2012 % 06.09.2012 % 03.09.2012 % 31.08.2012 global nameLAN global h global ref global h2 global ifview global ifsmp_cr %global LAN nameLAN = inputname(1); ifview = 2; ifsmp_cr = false; %LAN ...
aef07145a76c649fb14c684c012fc3ff759b0366c636822cfe75bcf75cb7fc28
MATLAB
10,367
288
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
648481044544ef7d68c23212282a3b8d6d0d164bc10bc5cb0b5602e646742c2f
MATLAB
10,370
289
function [outputs] = OEvent_Neymotin_v1(signal, srate, plot_on_off) outputs = []; minimum_cycles = 2; %% % [psd,f] = pwelch(signal,[],srate/2,1:srate/2,srate); % % figure(); % plot(f,log10(psd)); % xlim([0 40]); %% % cycles = 1; % freq = 6; % [ filtered_data ] = wavelet_single_freq_filtering_v2(signal, srate, freq,...
1516e2e82cf8e68dd1192231970d07a9922eee8307d99e6faf21627a82cee43b
MATLAB
10,371
249
function [filePathNetwork,filePathRegion,filePathLabel,filePathLink] = CircosDataOrganize(workingDir,CircosStruct) % FORMAT [filePathNetwork,filePathRegion,filePathLabel,filePathLink] = CircosDataOrganize(workingDir,CircosStruct) % Data organization for Circos plot via the format of txt % % Input: % workingDir - work...
862eb0f1ca324dd640187048abc5a6d8a24a6b6461fba892cfa3ee27a066ddda
MATLAB
10,381
226
function [parameters] = DatasetPrep(parameters) MessageToUser('Prepping ' , parameters); % Find the location & value of the comparison iterator in % parameters.values iterator_location = find(cellfun(@strcmp, parameters.keywords, repmat({'comparison_iterator'}, size(parameters.keywords)))); comp...
79689ea2e2c5f7561b1ab19f7668429a93b1868e3bcf114dc07370ba9da7d690
MATLAB
10,382
294
function varargout = optimize_mesh_gui(varargin) % OPTIMIZE_MESH_GUI MATLAB code for optimize_mesh_gui.fig % OPTIMIZE_MESH_GUI by itself, creates a new OPTIMIZE_MESH_GUI or raises the % existing singleton*. % % H = OPTIMIZE_MESH_GUI returns the handle to a new OPTIMIZE_MESH_GUI or the handle to % th...
7d330702e622555420212c69950b507cca89cfd5c010aa33fd2380494a0fd0b2
MATLAB
10,389
262
function [] = plot_ground_truth_subtract_global_remapped(folders,method,option) total_number{1}(1:3) = 0; total_number{2}(1:3) = 0; for nfolder = 1:5 for nshuffle = 1:2 cd(folders{nfolder}) if nshuffle == 2 cd 100_global_remapped_shuffles number_of_global_...
d7a78e75f185adf3ba05efae93a0dc5209a7037fe7a98b94667797d3fb536dc2
MATLAB
10,412
367
function show_vc_tri(vc,points,para); % plots volume conductor/cortex as surfaces % eventually plus sources/dipoles % usage show_vc_tri(vc,points,para); % % % vc is a structure with two fields: % vc.tri is Nx3 matrix of integers where each % column denotes the indices of three points % forming a ...
0554ebf47d0702fbd994b62f416c846f7d0f0f97f12f0e10a8af1a2fa5aa4c13
MATLAB
10,414
318
function [ CF ] = Cost_Function (xopt) NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat'); NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial; G = 7; % Muscle Group Number (G = 1 to 9) x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.OW.a1OW; x0(2) = N...
14a25a9ce2edbd0e210585fbfb28861571cadb80f5625ab4c088b3896e662293
MATLAB
10,420
308
% Rough estimates for principal point and focal length: fg = [1009.661057548567 1009.706970843858 ]'; cg = [ 1031.688786545889 1288.395050759215]'; kg = [-0.054285891395760 -0.026812583950935 0 0]'; %fg = [ 139.77712 139.61650 ]'; %cg = [ 319.62550 258.16616 ]'; %kg = [ 0.02859 -0.01812 0.00839 -0.00182...
fc767034c3bb61ae5ee7d5102018db9cbcc4dd2f80faac64934718b2fb83c869
MATLAB
10,425
257
function seizureInfo = getSeizureTimingInfo_EP(seizurePath, seizureCell, params) % This function reads a seizure's mat file and extracts information about % the baseline times, seizure times, postictal times, recovery times, and % control times. It also extracts information about lick and click times. % INPUTS: % - ...
881e4cfd349b9cad36cef11557234d270c95a4b2f07ca793cb94a8090a2a1b55
MATLAB
10,429
337
function fieldtrip2fiff(filename, data) % FIELDTRIP2FIFF saves a FieldTrip raw data structure as a fiff-file, allowing it % to be further analyzed by the Neuromag/Elekta software, or in the MNE suite % software. % % Use as % fieldtrip2fiff(filename, data) % where filename is the name of the output file, and data is ...
75ec8e4f5537206371edb13dc5b5b6343b412fccfdcd2542123b656808971004
MATLAB
10,448
276
% Address the basic question, when x is the salient category, what % percentage of units are tuned to x. function PlotAnalysisThroughTimeGroup(config,varargin) [varargin,DateName] = Utilities.ProcVarargin(varargin,'DateName',[]); if strcmp(mfilename,'') || nargin==0 opts=Analyze.Libet.Config_Basi...
2ec540793e0f917b1531f35e9c166e0d04c927bfc3cb1fe7f7dbb4f388a3b5ed
MATLAB
10,457
300
function [type, dimord] = ft_datatype(data, desired) % FT_DATATYPE determines the type of data represented in a FieldTrip data % structure and returns a string with raw, freq, timelock source, comp, % spike, source, volume, dip, montage, event. % % Use as % [type, dimord] = ft_datatype(data) % [status] = ft_...
503b1192497eabc2ce37784bba0f9dc5c6e0781fed95b8f68067abba91039c6d
MATLAB
10,458
328
function mono_res = bz_MonoSynConvClick (spikeIDs,spiketimes,varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%% %%% INPUTS %%% %%% spikeIDs = Nx3 matrix. N = # spikes. %%% col1 = shank ID, col2 = cluID on shanke, col3 = unit ID %%% %%% spikestimes = Nx1 matrix aligned with spikeIDs where each row is a %%% time stamp ...
7062c62817e227decfa74e5311ed63743f30bd05416f10bfdc0c839c65561d4a
MATLAB
10,459
293
function [varargout]=gscatter3(x,y,z,g,clr,mrksle,mrksze,mrkfclr,leg,legloc) %------------------------------HELP START---------------------------------- % gscatter3 - 3D scatter plot by group % % Ussage: % gscatter3(x,y,z,g); % gscatter3(x,y,z,g,opt_param); % opt_param - optional parameters such a...
9f96ac04cfd644f54c07515487cca4607ff4a9b3bcedcc71908f8f9088edd99d
MATLAB
10,465
207
%% Code for additional analyses %% creating and analysing randomised dataset clear all workingDir = 'P:\ground_truth_replay_analysis\Dropbo_data8'; cd(workingDir) folders = {'2019-06-20_09-55-42' 'N-BLU_Day7_Ctrl-16x30_no_reexp' 'N-BLU_Day8_Ctrl-15-NoRest-15' 'Q-BLU_Day2_RateRemap' 'Q-BLU_Day3_RateRemap'... 'RAT1...
8c7e75aaaba3483c0ce6f3b1ca8eb3b82af9fcf79f6084444604a09fd780ee7b
MATLAB
10,467
269
function [dataout] = ft_denoise_dssp(cfg, datain) % FT_DENOISE_DSSP implements a dual signal subspace projection algorithm % to suppress interference outside a predefined source region of % interest. It is based on: Sekihara et al. J. Neural Eng. 2016 13(3), and % Sekihara et al. J. Neural Eng. 2018 15(3). % % Use as ...
11a3a4ad2d6adb815120421a78f154a1157682fcdbc0b492f4578b5954da90dd
MATLAB
10,469
263
function convertBinaryToSurface(fov_path,im2plot_path,subdir,subj,region,labelbase,outdir,max_ecc,dpp,inRetinalSpace,binary,force) %{ This function takes in images of foveal location and some shape with position relative to the fovea and converts them to surface space on the subject's hemispheres. For this function, yo...