sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
642690fa8172f139145f2e9c4a70a4b40a3f814ce4af0269b1ded5e3693a2409
MATLAB
13,967
491
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
bd9730249383d1ff6d8dba05c320bb998a473db602e292190bd74ba27cc8ae42
MATLAB
13,972
301
function [] = plot_ground_truth_multitracks_event_combined(folders,option,method) total_number = 0; for nfolder = 1:length(folders) cd(folders{nfolder}) load decoded_replay_events total_number = total_number + length(decoded_replay_events(1).replay_events); % For cell id shuffles, get cd .. end inde...
5f7297692145bcd270ccbaa8df0a0b91c7ec84cafdf21fc9d0cfdb1102e6d660
MATLAB
13,980
493
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
c736888f1bff3e10882e0282eda0e5eeab5da3f21d2aaafe0d01ab3d69396168
MATLAB
13,983
512
function draw_figure5GH(p,encRes) % % This code is for drawing figure 5GH % % %% settings % prepare colors clear col col{1}=[10, 168, 247]/255; % col{2}=[18, 94, 240]/255; % col{3}=[235, 1, 22]/255; % nSbj = length(p.sbjID); for sbjitr = 1:nSbj pgPath = sprintf('%s%s/pringrad/%s_pringrad_values.mat',p.fmridir,p....
b4cc6ecfb6efe10f7cce6079b8d4b08566184957a144eed6a5dd2896c9a7b73f
MATLAB
13,995
259
function shuffled_track = randomised_data_run_shuffles(shuffle_choice,analysis_type,dataset_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 % %...
0210f110a48fb45e7546664400f6ea88edfb52f3acd26d649014f61bde884f66
MATLAB
14,005
490
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
cbcc8aec620bded7163371a2886e69725d0d3f89d600edf5e48da4353de75749
MATLAB
14,010
426
function [A, D, selectedChannels, I, B] = meg_runAnalysis(expt, sessionDir, user) % function [A, D, selectedChannels, I, B] = meg_runAnalysis(exptName, sessionDir, [user]) % % Loads behavioral data, loads MEG data, rejects trials, selects % channels, slices MEG data by condition, does analysis (ERF, TF, ITPC, % decodi...
46fbcb6ba7e7d85f9360aca7ed8622042a1926de43f7f5d4b3de921e76505e23
MATLAB
14,012
412
function avw_img_write(avw, fileprefix, IMGorient, machine, verbose) % avw_img_write - write Analyze image files (*.img) % % avw_img_write(avw,fileprefix,[IMGorient],[machine],[verbose]) % % avw.img - a 3D matrix of image data (double precision). % avw.hdr - a struct with image data parameters. If % ...
cf5e58be6ed677cd279296aad1540f0f83ca44aa45daefaef6fba9c9acca4739
MATLAB
14,015
493
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
425e7497982454c6354fbcc1a4fbb516655c3c506ec64f5289654c87ae131714
MATLAB
14,023
495
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
1a4524460292f548e5960b0b47f8d0ca7f84514ff21691c2c1d99782655f6e8f
MATLAB
14,024
339
classdef ProcSortStats < handle % This class is designed to support analyses revolving around the sorting % statisitics. This includes: % Reurning unit statistics from a set of converted data files (across days) % and saving out the file using the subselect data. % % Ability to take ...
f1a679452fc6cbdcd03af518e758914157038842331ba39db0c49d4aaae82582
MATLAB
14,057
332
function CBIG_KRR_workflow_LITE( setup_file, save_setup, varargin ) % CBIG_KRR_workflow_LITE( setup_file, save_setup, varargin ) % % This function runs the whole workflow of kernel ridge regression % algorithm to predict some target variables. This is a lite version of % `CBIG_KRR_workflow.m`. In this version, the ke...
50afa067d77a1adb5081c031e2c0a48ddb0f91e8b71698ae51ec5d12328318bc
MATLAB
14,074
500
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
4d36af294c09657470518f1e9f5da1551bfd4e7cb4173888cb20a7dce802e197
MATLAB
14,081
497
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
1da8c79f6763f522ca9fa18e8f3ecf68b632dbfe0b1849e60b7358ecee28b327
MATLAB
14,082
219
function get_corr_tracks(folders,varargin) p= inputParser; addParameter(p,'epoch','first_second_half',@ischar); addParameter(p,'method','pop_vector',@ischar); parse(p,varargin{:}); parameters= list_of_parameters; master_folder= pwd; for this_folder= 1:length(folders) cd([master_folder '\' folders{this_folder}]);...
6af0417072b5306c3c96db6ad9da8356b015b3e60c4bc2037867c4af27b34a80
MATLAB
14,086
378
function [neighbours, cfg] = ft_prepare_neighbours(cfg, data) % FT_PREPARE_NEIGHBOURS finds the channel neighbours for spatial clustering or % interpolation of bad channels. Using the 'distance' method, neighbours are based on % a minimum neighbourhood distance (in cfg.neighbourdist). Using the 'triangulation' % metho...
f350c98bcdbaad4a76976b3370b2e900ab787e91b22540522933f2c33c9952cd
MATLAB
14,088
518
% [BOUNDX,BOUNDY] = LABEL_EDGES(RGBI) % % Input: RGBI is a RGB image we want to label edges in. % This program allows the user to input any number of closed % edges. Here is the interactive usage: % label_edges commands: % LEFT CLICK with the mouse to add a new point. % RIGHT CLICK with the mouse to add a new point on...
2b5d8e71cf850185a08b0da642c387299010418f048a3401de2ed33ec01514e1
MATLAB
14,089
342
function [data, header] = ReadRhdFile(rhdFile, varargin) dataType = 'amp'; % This reads "traditional format" Intan *.rhd files that contain an % embedded header and multiple channels per file (NOT the % single-channel-per-file format with its separate "rhdInfo" file). The % file is opened for reading only. The loads ...
8c73d53093781a7fb2eeb39926b35a910b72351a771f2d9651decb1a2b6fdb93
MATLAB
14,090
280
function headVideo = loadStephensTrainingData16032016() % % Reformats all Stephen's digitization of head position in fly videos into % one big struct called headVideo. % % fields of headVideo: % % headVideo(n).frames = frame numbers (starts at 1) of video where have % clicked on head % %headVideo(n).kineDataFname = or...
54216f60b8e3fad981adcd86f068f1a13bc60b0dbf6591228dff2db3b6ea540f
MATLAB
14,091
496
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
5925f1a2b40d073b01da01c2e7aa88365f7d7b93e94a61c9e4295bc68fdfd77a
MATLAB
14,092
462
function [CMAP,LEV,WID,CLIM] = cmjoin(varargin) %CMJOIN Joins colormaps at certain levels. % % SYNTAX: % cmjoin(CMAPS) % cmjoin(CMAPS,LEV) % cmjoin(CMAPS,LEV,WID) % cmjoin(CMAPS,LEV,WID,CLIM) % ...
f731af422e1c5baa6e91e5fb7317080c63ec8ac45fa236d34bb8728dce7333b3
MATLAB
14,092
412
function out = spm_run_fmri_spec(job) % Setting up the general linear model for fMRI time-series % SPM job execution function % takes a harvested job data structure and call SPM functions to perform % computations on the data. % Input: % job - harvested job data structure (see matlabbatch help) % Output: % out - ...
70a254cd354ab0a67781c50e7ec730cc598c42b21b138131a32d0d01f8335f27
MATLAB
14,099
257
% 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 script calculates and summarizes the mechanical properties of 9 muscle groups based on clustering results. It a...
f0b54498722f835fc45fa3fc4baf573d7d11b2f0356572fb9454272e75786632
MATLAB
14,103
387
function varargout = w_OverlayConfig(varargin) % W_OVERLAYCONFIG M-file for w_OverlayConfig.fig % W_OVERLAYCONFIG, by itself, creates a new W_OVERLAYCONFIG or raises the existing % singleton*. % % H = W_OVERLAYCONFIG returns the handle to a new W_OVERLAYCONFIG or the handle to % the existing singlet...
d517c21eca5e36b8f0d0a595e59fc2fa7e95099d2a49d466ef9080f27b023511
MATLAB
14,112
363
function [data,stats] = PhasePrecession(positions,spikes,phases,varargin) %PhasePrecession - Compute spike phase precession. % % Compute spike phase precession using the methods of O'Keefe and Recce (1993), % i.e. spike phase vs position, and Harris et al. (2002), i.e. spike phase vs % spike rate. Single-lap phase pre...
ddca7ab6500d9c50f7b7909715c4d05c4fc85482f99c8102f722e56d3b8d1b24
MATLAB
14,112
490
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
fcd97906f8688dc295b378425541473dbd2bcefd84bef5990b5a89c8eb528837
MATLAB
14,116
493
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
f3aa22021d6477ee1ed7262c7c42919d44682162594c01e9ed0e1fadf57151f0
MATLAB
14,146
15
function cm_data = coolwarm(m) %cm = readtable('CoolWarmFloat257.csv'); %cm = cm{:, 2:end}; cm = [0.229805700000000,0.298717966000000,0.753683153000000;0.234299935000000,0.305559204000000,0.759874796000000;0.238810063000000,0.312388385000000,0.766005866000000;0.243336663000000,0.319205292000000,0.772075394000000;0.24...
a8e8e92812ce860bce58c7925f4c59a6b6da4fba2e09d1b461de254c987ca316
MATLAB
14,148
518
% [BOUNDX,BOUNDY] = LABEL_OPEN_EDGES(RGBI) % % Input: RGBI is a RGB image we want to label edges in. % This program allows the user to input any number of open % edges. Here is the interactive usage: % label_open_edges commands: % LEFT CLICK with the mouse to add a new point. % RIGHT CLICK with the mouse to add a new ...
26d7e2801b4993ea8262b2454119ff020eba1561dc535861001e6e6334db1dfd
MATLAB
14,152
242
%% Defining working directories and getting subjects' directories names subjects_output_data_dir = 'F:\Scales_of_space_project\Preprocessed_data\'; % the directory where subjects' preprocessed data will be saved % getting subjects' directories names subject_names = dir(subjects_output_data_dir); subject_names = ...
21d7c00d062e6d6e21350cc75ff05019d9c161df316f881d7a53dd92bcdf8900
MATLAB
14,153
490
function [varargout] = ft_notification(varargin) % FT_NOTIFICATION works mostly like the WARNING and ERROR commands in MATLAB and % is called by FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG. Note that you % should not call this function directly. % % Some examples: % ft_info on % ft_info on msgId % ft_info of...
7a4be6baa4d7216e37b4e6894b4f040f117a1a1af34c79d225a6f4fe665c3f03
MATLAB
14,154
261
function pout = HumanOdorRep_myBinomTest(s,n,p,Sided) %function pout = HumanOdorRep_myBinomTest(s,n,p,Sided) % % Performs a binomial test of the number of successes given a total number % of outcomes and a probability of success. Can be one or two-sided. % % Inputs: % s- (Scalar or Array) The observe...
98d9ec548a6a418dc9e979b23423c74d4af236051709ff9bec1919c9b8f06426
MATLAB
14,167
385
function [P, Tx, Ty, Tz] = dTrilinears3d(T,x,y,z,hx,hy,hz,bc) %function [P, Tx, Ty, Tz] = dTrilinears(T,x,y,z,hx,hy,hz,bc) % Rena 02/20/2017: allows mass to enter/leave through boundaries so mass is % not necessarily conserved. % Use linear interpolation to evaluate (approximate) the values of T in the % grid (x,y,z) %...
b2417c6217b9277e3419ff04d21d46464c1ceda6c58e64920a4fc673eff23fab
MATLAB
14,176
361
clearvars; close all force; clc; addpath('C:\Users\Santiago\Ephys Mauthner\Code') files = dir('C:\Users\Santiago\Ephys Mauthner\Data\**\*.abf'); SR = 25000; %in Hz ROI = 0.012; %in secs delayPostTectal = 0.0007; %in secs tonicDepolarizationShift = 0.004; tonicDepROIwidth = 0.001; %For detecting tectal sti...
6bb2d4ff32fd9ad3a3b5d578928de0c132488f92820f9115443eea62c0302022
MATLAB
14,179
401
% Matlab script for creating ROI timeseries % % Download/clone to "bas_dir" below: % 1. "AgeingHRF" from https://github.com/RikHenson/AgeingHRF/ % % Link to local SPM12 directory, or install from % https://www.fil.ion.ucl.ac.uk/spm/software/spm12/ % % rik.henson@mrc-cbu.cam.ac.uk, Jan 2023 %% Finish...
3cfab3d421944d4ef4062306281afc0739c3d15e783215f074b63e6207d193da
MATLAB
14,182
487
function [varargout] = ft_notification(varargin) % FT_NOTIFICATION works mostly like the WARNING and ERROR commands in MATLAB and % is called by FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO and FT_DEBUG. Please note % that you should not call this function directly. % % Some examples: % ft_info on % ft_info on msgId % ...
6aad35dad767af2803ccbe0b2362c53d7b6dff8eafcf1da7f6a5a4730847028b
MATLAB
14,187
473
%% 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 = 'em...
4daab892d1f1cad99f65e774cdc93184816a255bd24428c49e17e9228ed4f137
MATLAB
14,189
369
function varargout = TSbrowserbuttoneditor(varargin) % TSBROWSERBUTTONEDITOR M-file for TSbrowserbuttoneditor.fig % TSBROWSERBUTTONEDITOR, by itself, creates a new TSBROWSERBUTTONEDITOR or raises the existing % singleton*. % % H = TSBROWSERBUTTONEDITOR returns the handle to a new TSBROWSERBUTTONEDIT...
372061e102d6f5945bd237aee53fbfca31659fbe7d3747ac323745e8c19159d6
MATLAB
14,192
384
function spikes = bz_GetSpikes(varargin) % bz_getSpikes - Get spike timestamps. % if loading from clu/res/fet/spk files - must be formatted as: % baseName.clu.shankNum % % USAGE % % spikes = bz_getSpikes(varargin) % % INPUTS % % spikeGroups -vector subset of shank IDs to load (Default: all) % ...
f815662dcf542170830ae647a85a9ab249c9fefecf9efa2079e4125818c5494b
MATLAB
14,202
304
%% Main script for the MUA analysis % abdo.sharaf@yale.edu % xinyuan.zheng@yale.edu %% paths clear; close all; datapath = '\Data for Figure 2\Behavioral_partial_MUA'; svpath_beh = 'F:\xinyuan\Mouse Project\MUA Results\Behavior'; svpath_ep = 'F:\xinyuan\Mouse Project\MUA Results\EP'; t = datestr(now,'dd-mmm-yyyy...
ae0af9362e385f2e9fd1495441dc1e4fed72135d48337a11c58dd645285a31dd
MATLAB
14,205
313
function Step3_Beamforming(config, pid, visitnum) % Step3_Beamforming carries out beamforming and source projection on % cleaned data. Steps: % 1. Template grid (sourcemodel) from FieldTrip is loaded in with preselected % dipole grid resolution, in MNI position space % 2. Participant model is cre...
992530ceabb2a31c9e1da684c858b173fc512468675af08ad2a3520ce38d1cd8
MATLAB
14,209
481
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % function [idxs...
170fc8f17808eef7e7cb9e8e5dea2f86144a22700aaf34aec8a140025cb64c43
MATLAB
14,225
374
function CBIG_ComputeROIs2ROIsCorrelationMatrix(output_file, subj_text_list1, subj_text_list2, discard_frames_list, ROIs1, ROIs2, regression_mask1, regression_mask2, all_comb_bool, avg_sub_bool) % CBIG_ComputeROIs2ROIsCorrelationMatrix(output_file, subj_text_list1, subj_text_list2, discard_frames_list, ROIs1, ROIs2, r...
39bbe5f490e977ebb837d01fe7805a1766aaff580537989137c97ec2a9b2403a
MATLAB
14,232
448
function ncquiverref(x,y,u,v,units,reftype,refvec,veccol,cont) % NCQUIVERREF: Vector plotting function for either map or Cartesian axes. % % function ncquiverref(x,y,u,v,units,reftype,refvec,veccol,cont) % % This function is a substitute for the standard version of quiver % and quiverm available using a vanilla releas...
a5c3c1d5b2e937bdef2579c339e1aeff5783c27834efc8a91e14d44c697dc28e
MATLAB
14,265
362
% This pre-processing pipeline is performed through the BrainVoyager 20.6 % scripting platform, along with NeuroElf v1.1. %% Enabling brainvoyager scripting from path bvqx = actxserver('BrainVoyager.BrainVoyagerScriptAccess.1'); %% Defining working directories and getting subjects' directories names % Prep...
d86e9e096bca0918c9e882872b73a69595a283e6e66b7898a9e1cb3f301931f4
MATLAB
14,269
343
function [ANCOVA_F,Header,PairwiseDiff_Brain,Pairwise_p_Brain,Pairwise_Z_Brain] = y_ANCOVA1_Multcompare_Image(DependentDirs,OutputName,MaskFile,CovariateDirs,OtherCovariates, ctype) % function [ANCOVA_F,Header,PairwiseDiff_Brain,Pairwise_p_Brain,Pairwise_Z_Brain] = y_ANCOVA1_Multcompare_Image(DependentDirs,OutputName,...
d132d88dcdeba591086956797530fe64e0f3677cdf2ed9216dc52b2e51778c29
MATLAB
14,272
385
% go_calib_stereo.m % % Script for Calibrating a stereo rig (two cameras, internal and external calibration): % % It is assumed that the two cameras (left and right) have been calibrated with the pattern at the same 3D locations, and the same points % on the pattern (select the same grid points). Therefore, in particul...
c0dbd680159d0d4c24e24f41b7d1f6f2c932c42866aaa81233d45c1c321674b2
MATLAB
14,276
381
function [Aout, Bout] = h_executecalcRoi3(handles) % Aout is regular ROI, Bout is annotationROI. global h_img3 [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); Aout = struct('roiNumber',[],'roi', [], 'bgroi', [], 'avg_bg', [], 'avg_intensity', [], 'roiVol', [], 'max_inten...
b4066e498f08933304ca3c0540d2d8f2ebc11bb18375ad6ef93f077f0b1821bd
MATLAB
14,294
391
function ft_select_range(handle, eventdata, varargin) % FT_SELECT_RANGE is a helper function that can be used as callback function % in a figure. It allows the user to select a horizontal or a vertical % range, or one or multiple boxes. % % The callback function (and it's arguments) specified in callback is called % o...
3add1618795d4bc4a63afe7b5cca72d8b0571f571b2cac7c7d235bf1414b6203
MATLAB
14,320
434
function [predictedY,predictedYD,YD,stats] = predictPhenotype_kernels(Yin,Din,options,varargin) % % Kernel ridge regression estimation using a distance matrix using (stratified) LOO. % Using this means that the HMM was run once, out of the cross-validation loop % % INPUT % Yin (no. subjects by 1) vector of pheno...
57156f38e4300d8fb29733c775c4f3db4a859c2a229e491d6a1e73c8ee4fd5d1
MATLAB
14,322
265
% TSTRIALSTATMULT Computes multiple within-trial statistics. This is a % version of TSTRIALSTAT modified 6/11/16 by CRG to output multiple % statistics. It needs to be tested whether this version substitutes w/o % problem for the tried and true long-standing version of TSTRIALSTAT % ER = TSTRIALSTAT(STATNAME,FUNHAND...
ccb00142c6b02bcdb008dca7a686ae5d35d0491d89015e123eb83405b62a15a4
MATLAB
14,346
289
function [] = Twave_personalisation_POMs_ToRORd_not_converged(nb_models, celltype, stimAmp, stimulus_function_str, result_dir) % Population of models generation for T-wave personalisation % Adapted from scriptDemonstration_2_ParameterComparison.m: % TODO: rename all endo_ variables to not say endo_ %% S...
ad9189bbae928e4fa4529d875be7c904915e200f1a28326510b308606970613c
MATLAB
14,347
394
function saveas(this,filename,format) % Save GIfTI object in external file format % FORMAT saveas(this,filename,format) % this - GIfTI object % filename - name of file to be created [Default: 'untitled.vtk'] % format - optional argument to specify encoding format, among % VTK (.vtk,.vtp), Collada (...
6419033c219e333cab54b8ba88af5725dd4e778b69fc432987cf79fed3b3fd02
MATLAB
14,350
313
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef SpikeDataSet < DataSet properties (GetAccess = public, SetAccess = private) Duration; ChannelIDs; DataSetNames; end properties (GetAccess = private, SetAcc...
826c64be0b3f597a9037b4df8b1a42505e7542f3fd99f26eca88ccee0b901bb1
MATLAB
14,372
432
% demo of Bayesian optimization for "code breaking" %{ Consider a hidden "code" (sequence of letters) of length L, c(1:L), where each element of the code is an integer in {1,..,A}. We are allowed to generating query strings of length L, x(1:L), from the same alphabet. The oracle function is the hamming distance f*(x...
c086f454d15cc0244d2206c0dbce1ade64c49cf615e8a1c82cfb830f48b66313
MATLAB
14,372
325
function NMJ_BoutonRegion_Selector_JuliaCopy(StackSaveName,BoutonSelectionDisplayImage, AllBoutonsRegion1,BorderLines) OS=computer; if strcmp(OS,'MACI64') dc='/'; else dc='\'; end pwd; currentFolder = pwd; [upperPath, deepestFolder] = fileparts(currentFolder); ...
0f5278b1807ad0bfd969939a6f0be7b528212e8807795d8b1829b2118fbaaf37
MATLAB
14,377
435
function [dipout] = harmony(dip, grad, headmodel, dat, varargin) % HARMONY computes a linear estimate of the current in a distributed source model % using a mesh harmonic based low-pass filter. % % Use as % [dipout] = minimumnormestimate(dip, grad, headmodel, dat, ...) % % Optional input arguments should come in key...
5937ec9b4c139cfe86e6d5b0caa3d7d1f87408ae9018492faae6691f3553dffb
MATLAB
14,377
345
function [vols,volsizes,inplanematrixsizes,trs] = dicomloaddir(files,filenameformat,maxtoread,desiredinplanesize,phasemode,dformat) % function [vols,volsizes,inplanematrixsizes,trs] = dicomloaddir(files,filenameformat,maxtoread,desiredinplanesize,phasemode,dformat) % % <files> is a pattern matching zero or more DICOM ...
a046426ce977ea7c86116c3c0408ca0c01b80254ab649ee26aaf78973f925365
MATLAB
14,383
435
function [dipout] = harmony(dip, grad, headmodel, dat, varargin) % HARMONY computes a linear estimate of the current in a distributed source model % using a mesh harmonic based low-pass filter. % % Use as % [dipout] = minimumnormestimate(dip, grad, headmodel, dat, ...) % % Optional input arguments should come in key...
326d601879b23dd6dd9e04638204fb001c4d584ff8e74230d4ec268d4e8855b7
MATLAB
14,394
439
%%% ROI analysis for infant data. Load in ROI measurements for each infant, %%% over different tissue labels. Note that the data contains 61 infant %%% datasets but not all contain T1 and T2 mapping (so are empty) and it %%% also contains 13 tissue labels, though we only consider 8 of these. %%% 2024-10-08: Shaihan Mal...
7bc88b187b6953a1377856e4f069b29ff259eba371cd7def35d05ee70e07d308
MATLAB
14,405
390
% Address the basic question, when x is the salient category, what % percentage of units are tuned to x. function PlotPopulationAnalThroughTime(config,varargin) if strcmp(mfilename,'') || nargin==0 opts=Analyze.Libet.Config_BasicLinearModel; else opts=feval(config,varargin{:}); end %% BaseDir=o...
33396524e819964d826fc15d89f05ef53d5b4af3ed395e39e1ab82759129d53e
MATLAB
14,423
356
classdef Atlas < handle_light % Collection of charts and the transition maps between them % such that together the charts cover the entire manifold (surface). % % Charts and transition maps are CoordinateMap objects. %--------------------------------------------------------------------- ...
35145921110b051943eb637cf7e5bda55dd6ebc7fbe3aa645c2f06820456d5e5
MATLAB
14,427
405
function [h,p,ci,stats,t,slm] = tTestSurfStat(x,y,varargin) % x,y -> two input vectors or matrices or tensors with the following structure (corresoponding to different groups: G.X and G.Y) % lines -> observations (or each subject value) % columns -> different quantities to compare x(:,c) vs. y(:,c) % ...
b6f1a5bc414ae5ce3836d5ba1f6fbabcaf6ea8ee104e35714c812966447bc8c4
MATLAB
14,429
381
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % classdef File...
7b5a7debac4d90fc4995f579e865616e48c5a6ee6f2544ccd55cc4bc28431da0
MATLAB
14,430
378
% calc_sig_struct global dNames % dNames = {'TinC', 'TinI', 'Ramp', 'PC1', 'WhatD', 'WhenD', 'MinC', 'MinI'}; for d = 1 : length(dNames) dim = dNames{d}; disp(['Generating signals: ' dNames{d} '...']) switch dim case 'PC1' nDat = 1; case 'WhatD' nDat...
0b5109bc2ea3f4d3d79e90247af1ba569f98cf3c15b8d2c94dbc47791fb33c24
MATLAB
14,445
353
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% disp(['Making Figure: ',FigName]) figure('name',FigName) set(g...
bb89fa243a834db9da1d9acb1ec157bebec45df9730b7436adcfc5d99b229ca3
MATLAB
14,457
235
function prams=CBIG_gwMRF_set_prams(varargin) % This function sets the prams file, either from default values or from the input varargin % some variables and their explenation and/or possible setting. If not other specified 1 means true and 0 means False. % % % Input % % - start_index - ...
57116db1a47692f67851ebf944b5d21266b60b2266c3c3344b85e8ea92eaa957
MATLAB
14,462
327
function [epp, subset_ids]=run_epp(csv_file_or_data, varargin) % RUN_EPP runs exhaustive projection pursuit to discover/learn % significant subsets of a given data set. % % EPP is an unsupervised data subset discovery method intended for any % N-dimensional dataset containing continuous numeric measurements. Se...
ddfe665ec3075bfe477ce4c31c288439fdd9808ae8e6be636380f758a4513781
MATLAB
14,473
371
%% Fisher Kernel: elife 2024 Main script % Ahrends, Woolrich, & Vidaurre (2024). Predicting individual traits from % models of brain dynamics accurately and reliably using the Fisher kernel. % elife https://doi.org/10.7554/eLife.95125. % This script goes through the steps to reproduce the main results of the % paper. ...
9020730aa413d6ac2860da1bcf2ad86333d2e1c162d04eca265ffcc2a71b0906
MATLAB
14,479
374
% pop_loadset_lan() - load an EEG dataset. If no arguments, pop up an input window. % % Usage: % >> EEGOUT = pop_loadset; % pop up window to input arguments % >> EEGOUT = pop_loadset( 'key1', 'val1', 'key2', 'val2', ...); % >> EEGOUT = pop_loadset( filename, filepath); % old calling format % % Optional inputs: % ...
9b8446cd4248245bbd2fd018e77769b1a22128b99c7b8ecac2ef02aa16d443e4
MATLAB
14,482
380
function [ClusterSize_OneTailed_NN6 ClusterSize_OneTailed_NN18 ClusterSize_OneTailed_NN26 ClusterSize_TwoTailed_NN6 ClusterSize_TwoTailed_NN18 ClusterSize_TwoTailed_NN26] = y_AlphaSim(maskfile,outdir,outname,pthr,iter,algor,fwhm_or_acf) % y_AlphaSim(maskfile,outdir,outname,rmm,s,pthr,iter) % Monte Carlo simulatio...
b7c5151d112f8d00f6a7276fb16ab5b93f321e79b6fe1b306b676d6badc89c8a
MATLAB
14,490
383
function [FailedID WaitingID SuccessID]=y_ReRunqsireconFailedSubjects(Cfg,WorkingDir,SubjectID) % FORMAT [FailedID WaitingID SuccessID]=y_ReRunqsireconFailedSubjects(Cfg,WorkingDir,SubjectID) % Cfg - the parameters for auto data processing. % WorkingDir - Define the working directory to replace the one defined ...
3ba8e6f91e900d0258700321fe763f6976d0bb04f9d2cf10604be920d2a99308
MATLAB
14,507
355
function data = append_common(cfg, varargin) % APPEND_COMMON is used for concatenating raw, timelock or freq data % % The general bookkeeping and the correct specification of the cfg % should be taken care of by the calling function. % % See FT_APPENDDATA, FT_APPENDTIMELOCK, FT_APPENDFREQ % Copyright (C) 2017, Robert...
9a85de1cd0d759c46489df87be71865ab292d21ee565f70c4e75a8f45b1e813d
MATLAB
14,515
307
%% Cross-validation of replay detection performance by using combining both sequenceness and seuqenceless decoding % Sequenceness analysis clear all % workingDir = 'P:\ground_truth_replay_analysis\Dropbo_data8_normalised_within'; workingDir = 'P:\ground_truth_replay_analysis\Dropbo_data8'; % cd P:\ground_truth_repla...
2b75b32a785ae44fb4d5fe392d1bec9825eea89836ba88a9dd49ee35c3162a0b
MATLAB
14,525
354
function [dipout] = dipole_fit(dip, sens, headmodel, dat, varargin) % DIPOLE_FIT performs an equivalent current dipole fit with a single % or a small number of dipoles to explain an EEG or MEG scalp topography. % % Use as % [dipout] = dipole_fit(dip, sens, headmodel, dat, ...) % % Additional input arguments should b...
e4922cf50ba2e0140b17345e45446766a921a29211d490d2fb30f8ff7c29e382
MATLAB
14,530
456
classdef MFTable % Movie/Frame/(Target) tables % % An MFTable is a table with cols 'mov' and 'frm' indicating movies and % frame numbers. properties (Constant) % Uniquely IDs a frame/target FLDSID = {'mov' 'frm' 'iTgt'}; % Core training/test data. FLDSCORE = {'mov' 'frm' 'iTgt' 'tfocc' 'p'}; ...
e1c27ac591752d02ef8183beb37bd8eccad8f68f49c9bc62eff7b65ed14006e9
MATLAB
14,544
362
function [embedding, chart] = generateEmbedding(this, chartName) % generate embedding for spherelikeFitter using parameterization of % surface. % % [embedding, chart] = generateEmbedding(chartName); % % We fit sperelike surfaces in a cylindrical basis as described in the % supporting inform...
cd4f7b60f0da24d4e62b59e010cc37be2556679e5baf52f4ea1c3f0156a9657d
MATLAB
14,545
331
function [DistanceQ, MovementQ, TrialCounts, FitError] = ... HeadMotionStats(Datasets, MotionThreshold, SampleProportion, ... FitErrorThreshold, Verbose) % Calculate head motion statistics for a CTF MEG dataset. % % [Distance, Movement, TrialCounts, FitError] = ... % HeadMotionStats(Datasets, Motion...
48ab9f22c9c7f608b438268e22dc8bdf67c23058706c3df59fce1145a50a8681
MATLAB
14,559
474
classdef FSPath % Filesystem path utilities % % STANDARDIZED paths use the separator '/' and eliminate % double-separators etc. Standardized paths are supposed to look the same % across platforms, modulo differing filesystem mount names etc. % % MACROS look like $datadir and can be replaced/substituted. methods...
9b3d6f0d04f76f11752509a57208b960c9d3f405e5dada86f0234e561e700fd6
MATLAB
14,569
354
classdef VBoxFlex_dspace < uix.VBox & uix.mixin.Flex %uix.VBoxFlex Flexible vertical box % % b = uix.VBoxFlex(p1,v1,p2,v2,...) constructs a flexible vertical box % and sets parameter p1 to value v1, etc. % % A vertical box lays out contents from top to bottom. Users can % resize...
9c331eee20d8ebb1f267e59abf887d21f982d54b75961c9ac7bec2d2c23df956
MATLAB
14,572
406
function varargout = DPABISurf_Vol2Surf(varargin) %DPABISurf_Vol2Surf MATLAB code file for DPABISurf_Vol2Surf.fig % DPABISurf_Vol2Surf, by itself, creates a new DPABISurf_Vol2Surf or raises the existing % singleton*. % % H = DPABISurf_Vol2Surf returns the handle to a new DPABISurf_Vol2Surf or the handle ...
b91433dc03d9e451f3f9384c005840ba7a095a1806ea5c3f4e7487d7e2868053
MATLAB
14,577
383
function [timelock] = ft_timelockanalysis(cfg, data) % FT_TIMELOCKANALYSIS computes the timelocked average ERP/ERF and % computes the covariance matrix % % Use as % [timelock] = ft_timelockanalysis(cfg, data) % % The data should be organised in a structure as obtained from the % FT_PREPROCESSING function. The config...
0257b2db06a26acf600a9562451b6cf28e324fe3b29c32d870397ef048ce5499
MATLAB
14,599
458
function [Xc3,tri3,xc3,xp3,dc3,xc_texture,nc3,conf_nc3,Nn3] = Meshing(Xc2,xc2,xp2,Thresh_connect,N_smoothing,om,T,N_x,N_y,fc,cc,kc,alpha_c,fp,cp,kp,alpha_p), % scaled connection threshold T_connect = Thresh_connect; % scaled threshold fprintf(1,'Organizing the data...\n'); xp_frac = rem(xp2,1); xc_frac = rem(xc2(1...
505dd53ba776414f3d12711339bd669d541756cdc92299d260695d90cb197e45
MATLAB
14,603
348
% 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,...
16791e6fd17dc8b64bd1b794925edd4ede6251250373cd78d302399de5f8be75
MATLAB
14,626
302
classdef CBIG_LiGSR_unit_test < matlab.unittest.TestCase % % Target project: % Li2019_GSR % % Case design: % Li2019_GSR already has unit tests, here we call its % "intelligence_score" unit test and automatically make % judgement on whether the unit test is...
5b7209d47f5d965894291a8b5adca4d11b672a587a560bbc1638043e840f8193
MATLAB
14,630
399
function [cfg] = ft_neighbourplot(cfg, data) % FT_NEIGHBOURPLOT visualizes neighbouring channels in a particular channel % configuration. The positions of the channel are specified in a % gradiometer or electrode configuration or from a layout. % % Use as % ft_neighbourplot(cfg) % or as % ft_neighbourplot(cfg, dat...
9e93261f26e7b0e5f2a2f0ea60d264fff52e612b188eeb086eb83869b558860d
MATLAB
14,633
355
classdef HBoxFlex_dspace < uix.HBox & uix.mixin.Flex %uix.HBoxFlex Flexible horizontal box % % b = uix.HBoxFlex(p1,v1,p2,v2,...) constructs a flexible horizontal % box and sets parameter p1 to value v1, etc. % % A horizontal box lays out contents from left to right. Users can % ...
f116d36282792389d102e310b3195e6aca9b5360792a6161d3418d79387ecc3c
MATLAB
14,638
368
% This pre-processing pipeline is performed through the BrainVoyager 20.6 % scripting platform, along with NeuroElf v1.1. %% Enabling brainvoyager scripting from path % bvqx = actxserver('BrainVoyagerQX.BrainVoyagerQXScriptAccess.1'); % old brainvoyager command (before BV20.4) bvqx = actxserver('BrainVoyage...
83209ca794fd1c6c34df7e4cf88c56987ee282d93fe86cdecbfb13075b70df51
MATLAB
14,645
265
function y_T1ImgAverager(AutoDataProcessParameter) % FORMAT y_T1ImgAverager(AutoDataProcessParameter) % Input: % AutoDataProcessParameter - the parameters for auto data processing % AutoDataProcessParameter.DataProcessDir='/home/data/YCG_AllData/YAN_Work/Monkey/Analysis/Cebus/CP1F/T1CoregAverage'; % AutoDa...
08cf68b8ec6d7ebd9da0d27b2c9aeae7445438b241614e57ecaa433a636e13e2
MATLAB
14,649
331
% Somatotopy figure addpath("HelperFunctions") load(fullfile(DataPath, 'RFData.mat')) load(fullfile(DataPath, 'Discriminability.mat')) load(fullfile(DataPath, 'SurveyMainData_Processed.mat')) load(fullfile(DataPath, 'RFMappingData_Processed.mat')) export_path = fullfile(DataPath, 'Figure3_Somatotopy'); SetFont('Arial'...
ec46a288aac202e74d956999c77f7fa1c54590f87bc7e802b25da306ccfc200c
MATLAB
14,665
384
%% P(x,t) Data Structure % Data Class for holding measured probability data (pX(t)). Designed for % use within the SDO Analysis Toolkit. % % 1) pxtDataCells may be derived from xtdc + ppdc % 2) pxtDataCells may be derived from predictions from sdoMat %_______________________________________ % Copyright (C) 2023 Trevo...
2f7f6938955d92d613206fbc50c7a762bf61d910ddf9b01b7c1e6d8db96052b9
MATLAB
14,668
410
function [mdlFit A3 A4] = meg_singleTrial_crossValidation(expt, sessionDir, user) % function meg_singleTrial_crossValidation(expt, sessionDir, user) % split half cross validation per subject % Inputs: % expt: 'TANoise' % sessionDir: eg: 'R0817_20171212', 'test' will create simulated data % user = 'karen' 'scc' ...
d777c71ba92ce55207bff1095a93f8cb5e2db7d91de603b3ebcf2334fc6ca3fa
MATLAB
14,669
383
function [mdlparams, xerr, errall] = fitSubGridSubSurrModelNakaRushton(mdlparams, stiminfo, stimorder, yy, opts) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here %========================================================================== if nargin < 5 batchsize = 1000; eta = 0.01...
dc8ace085d07eea3fc9a7f4b3404a69f4dee7bbfadef09420e5005e31f1c186e
MATLAB
14,671
357
function CBIG_MFMem_rfMRI_plot_corr_of_VonEconomo(save_dir_input) %-------------------------------------------------------------------------- % CBIG_MFMem_rfMRI_plot_corr_of_VonEconomo() % % show the correlation of estimated W and I in Desikan68 parcellation with % the Von Economo data. % W and I are averaged across ...
9757ae7ca2a5aa058ada573a251fffdbd3bf1e27ff8b2baa65394927fda06452
MATLAB
14,689
344
function [hPatch,api] = imRectRot( varargin ) % Create a draggable, resizable, rotatable rectangle or ellipse. % % The 'ellipse' param determines if the displayed object is a rectangle or % ellipse. The object is identical in both cases, only the display changes. % The created object may be queried or controlled progra...
c0915034858626694b4d9a88ea2c380447c6b57c153a054a146d96987d293f46
MATLAB
14,701
366
function varargout = h_qCamAnalysisGUI3(varargin) % H_QCAMANALYSISGUI3 M-file for h_qCamAnalysisGUI3.fig % H_QCAMANALYSISGUI3, by itself, creates a new H_QCAMANALYSISGUI3 or raises the existing % singleton*. % % H = H_QCAMANALYSISGUI3 returns the handle to a new H_QCAMANALYSISGUI3 or the handle to % ...
c1599689f2a33266d4cb5f150b3df306cc02dc900342c326fbe7972b56b03dc5
MATLAB
14,701
515
function RGB = cmapping(varargin) %CMAPPING Colormap linear mapping/interpolation. % % SYNTAX: % cmapping % cmapping(U) % cmapping(U,CMAP) % cmapping(U,CMAP,...,CNAN) % cmapping(U,CMAP,...,TYPE) % cmapping(U,CMAP,...,MODE) % cmapping(U,CMAP,...,M...
1494eb8eb561a36baed65ce4664e1c3e90cdc9e838bf10a22951e5821fb4608e
MATLAB
14,702
420
function [ripples] = bz_FindRipples(varargin) %FindRipples - Find hippocampal ripples (100~200Hz oscillations). % % USAGE % [ripples] = bz_FindRipples(lfp.data,lfp.timestamps,<options>) % OR % [ripples] = bz_FindRipples(basepath,channel,<options>) % % Ripples are detected using the normalized squared signal...
4c90eb11d0b154123d5c1e69bddc0a96316041b055dc70e9bd55f1eb90a7d02b
MATLAB
14,718
355
function [data] = ft_rejectvisual(cfg, data) % FT_REJECTVISUAL shows the preprocessed data in all channels and/or trials to % allow the user to make a visual selection of the data that should be % rejected. The data can be displayed in a "summary" mode, in which case % the variance (or another metric) in each channel ...
3cbeac59f0cd2c459c26b102549955baa2fa4e2c8ba4518d5783c7835ac042eb
MATLAB
14,725
386
% AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause % classdef Clus...