sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fffd1d007b058d7f1c2dc17d8750cef49268c0428fe9ea7537a43df0245c8b73
MATLAB
12,691
309
function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r) % Algorithm to (try to) compute a maximum cut of a graph, via SDP approach. % % function x = maxcut(L) % function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r) % % L is the Laplacian matrix describing the graph to cut. The Laplacian of a % gra...
0c4772c939853d05162a355b7b61150bf2e4c4ed96edf15b77092bebc79fe1a9
MATLAB
12,707
322
% history: % 2016/05/02 - add support for <wantpushalt> and the case of <epifilenames> being NaN % 2016/02/05 - add <epismoothfwhm> % 2015/11/15 - implement special cell2 case of episliceorder % 2014/04/30 - add binary saving for the extratrans {X} case % 2014/04/17 - add fieldmapslicejump for DICOM case % 2011/08/07 -...
dab67f360f780a0083371f22c4312fa54a87f9d3813086c1eb8c71e2533574f2
MATLAB
12,710
389
function headmodel = spm_cfg_eeg_inv_headmodel % Configuration file for specifying the head model for source reconstruction %__________________________________________________________________________ % Copyright (C) 2010-2016 Wellcome Trust Centre for Neuroimaging % Vladimir Litvak % $Id: spm_cfg_eeg_inv_headmodel.m 7...
0cb5f5a27926c989bd34710b39970ee5082b1ae2b0e8037e5d48c2097206c2b6
MATLAB
12,713
337
% This script shows how to run urOMT algorithm and Eulerian & Lagrangian post-processing on a rat brain dataset % Parameters of urOMT are defined in getPamams.m % Parameters of Eulerian post-processing are defined in paramInitEULApar.m % Parameters of Lagrangian post-processing are defined in paramInitGLADpar.m % One c...
a1feea2ce088c351d156d00116c321fd4207042a152d9cf35fb22e73818a6e40
MATLAB
12,714
386
function [P, P0, output] = cp_wopt(Z,W,R,varargin) %CP_WOPT Fits a weighted CP model to a tensor via optimization. % % K = CP_WOPT(X,W,R) fits an R-component weighted CANDECOMP/PARAFAC % (CP) model to the tensor X, where W is an indicator for missing % data (0 = missing, 1 = present). The result K is a ktensor. I...
fe63f275dd624a4b73e5a285989404cdd2648b32a3703777170ebb9baff6b0ee
MATLAB
12,728
273
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% f12_charge_engine_lu.m -- Using FMM-LU, simulate an event given by %%% %%% a source dipole. The signal to noise ratio is varied from 0 to a %%% %%% maximum value, and from the maximum back to 0, in an %%% %%% inverse-quad...
59694bca01d7d890b1784431516c6a1fd73856c6f42bd940b59538d70b64fa29
MATLAB
12,729
332
function [] = SMA1(obj, action) GetSoloFunctionArgs; switch action case 'init', feval(mfilename, obj, 'next_trial'); case 'next_trial', %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%% SETUP THE...
dd0116da4454faead1439bc6b6dd3ce3f43b7275dd4b958f9a9e7af6b9d5fbd8
MATLAB
12,732
320
function [Image, Space]=w_MontageImage(IndexM, type, curfig, flag) % Written by Xindi WANG % State Key Laboratory of Cognitive Neuroscience and Learning & IDG/McGovern % Institute for Brain Research, Beijing Normal University, Beijing, China % sandywang.rest@gmail.com %================================================...
6971a231d64e7ce588235a7def4886c2ff3926f57071b528162c4294cba32f49
MATLAB
12,770
413
function dipfit = spm_cfg_eeg_dipfit % Configuration file for configuring imaging source inversion % reconstruction %__________________________________________________________________________ % Copyright (C) 2010-2016 Wellcome Trust Centre for Neuroimaging % Gareth Barnes D = cfg_files; D.tag = 'D'; D.name = 'M/EEG ...
e3c1f0bb7b28bdb707648d173c5d5ab518e69d055e52a490d5e218cad0115e72
MATLAB
12,771
359
classdef FeaturesReporter < handle properties name; featuresColor = [0 0 1]; end properties (Transient) controller featuresRange end properties (Transient, Access = private) waitBarHandle cachedFeatureTypes end ...
dacccda393d81bb9ff415507f6a9cae6f16e95feaaeebe81be1f3249d3129492
MATLAB
12,786
312
function [SPM] = spm_fMRI_design(SPM,save_SPM) % Assembles a design for fMRI studies % FORMAT [SPM] = spm_fMRI_design(SPM) % % 1st level %-------------------------------------------------------------------------- % SPM. % xY: [1x1 struct] - data structure % nscan: [1xs double] - nscan(s) = number of sc...
7430e2a32a3e60fbbda2649b37b883c64d5d24ffb2bb1ed6f830ae6104cdfd8c
MATLAB
12,800
298
function write_bioimage_mgrid(filename, elec) % -------------------------------------------------------- % WRITE_BIOIMAGE_MGRID writes BioImage Suite .mgrid files from a FieldTrip % elec datatype structure % % Use as: % write_bioimage_mgrid(filename, elec) % where filename has an .mgrid file extension and elec has...
f53dbad9f131b59708cfc48f2a3c58770a2943ebd4d76055c1748e9d82e997dc
MATLAB
12,800
403
function [INLP,ILP] = fminspleas(funlist,NLPstart,xdata,ydata,INLB,INUB,weights,options) % pleas: partitioned nonlinear least squares estimation, using fminsearch % usage: [INLP,ILP] = FMINSPLEAS(funlist,NLPstart,xdata,ydata) % usage: [INLP,ILP] = FMINSPLEAS(funlist,NLPstart,xdata,ydata,INLB,INUB) % usage: [INLP,ILP] =...
82f3d57103cf56260c07ac9179b21bb44357bc618f86657555c210d23169862a
MATLAB
12,801
281
% Loads animal recordings information. % Edited by Jerry, 09/20/2022 function [szCell,szDir,szTiming]=GetSeizureInfo_220919... (AnimalID,FileName,DataDir,params,bilateral,SaveDir) % FUNCTION INFORMATION: Lick task analysis pipeline % Inputs: % (1)AnimalID: name of the animal [string]. % (1)FileNa...
7c08435fafe55c5875eaa89fea512d9713603b9dc534b10153c9342232cc688e
MATLAB
12,808
320
classdef AbstractFeatures < matlab.mixin.Copyable % Baseclass for Features in Dataspace. % Features are explained in broad terms here: % <a href="matlab:dspace.help('dspace.resources.docs.Introduction_to_Dataspace')">Introduction to Dataspace (Dataspace Help)</a>. % % Features can have fixed di...
d5f0ed1ce48212552b40364d15ea3e876a27cefbd7e1d0e62fa81ca341af2646
MATLAB
12,808
371
function [cfg] = ft_topoplotCC(cfg, freq) % FT_TOPOPLOTCC plots the coherence between channel pairs % % Use as % ft_topoplotCC(cfg, freq) % % The configuration should contain: % cfg.feedback = string (default = 'textbar') % cfg.layout = specification of the layout, see FT_PREPARE_LAYOUT % cfg.foi ...
3a5098bd3a8ddaa7db8ce89d0a9355657f0fe4ec344a476629504baa81757364
MATLAB
12,829
296
function ret = w_spm_ov_reorient(varargin) % Reorient tool - plugin for y_spm_orthviews % % This tool provides the capabilities of the reorientation widget in SPMs % "DISPLAY" for any image displayed within y_spm_orthviews. The control fields % are drawn in the SPM interactive window and work as described in the % Disp...
da4c6b944966e14a6b815d800a765b2e514ef537a615c2fdf086323d58b3f7ad
MATLAB
12,838
207
%boney_extractBoneMeasures_printDetails. Batch to create a figure % % _________________________________________________________________________ % % Robert Dahnke & Polona Kalc % Structural Brain Mapping Group (https://neuro-jena.github.io) % Departments of Neurology and Psychiatry % Jena University Hospital % _________...
2db68f6a9ff8b23bb4afc9269839345f5477da49972ab8be2ddb1c941686f5ab
MATLAB
12,839
352
function [mdlFit, A4] = meg_time_crossValidation(expt, sessionDir, user) % function meg_time_crossValidation(expt, sessionDir, user) % split half cross validation per session by time (first half v second % half) % Inputs: % expt: 'TANoise' % sessionDir: eg: 'R0817_20171212', 'test' will create simulated data % ...
56b93e9d8ff86269d52874556e5b4ff9958652b700d983f1d0df1433d7deb227
MATLAB
12,845
359
function data = ft_anonymizedata(cfg, data) % FT_ANONYMIZEDATA clears the value of potentially identifying fields in % the data and in the provenance information, i.e., it updates the data and % the configuration structure and history that is maintained by FieldTrip % in the cfg field. % % Use as % output = ft_anony...
729bf2d5552e0b0303e464dc5be6201f3f0209fced0a39014ca9801b5ca447f8
MATLAB
12,847
313
function [data, varargout] = femdata_spec_FD(mesh, frequency, varargin) % FEMDATA_SPEC_FD Calculates data (phase and amplitude) for a given % spectral mesh at a given frequency (Hz). Outputs phase and amplitude in % the structure DATA. % % SYNTAX: % [DATA] = FEMDATA_SPEC_FD(MESH, FREQUENCY) % [DATA] = FEMDATA_SP...
8b064d993a9eb9c14fea5221ec44de7b8809bb22a02623ade70d77c183953f29
MATLAB
12,853
359
function data = ft_anonimizedata(cfg, data) % FT_ANONIMIZEDATA clears the value of potentially identifying fields in % the data and in the provenance information, i.e., it updates the data and % the configuration structure and history that is maintained by FieldTrip % in the cfg field. % % Use as % output = ft_anoni...
861881f2b830c41da52a2dc9736cdb0ca2151e1fab2f01035cb06d9f4d1fb19f
MATLAB
12,857
295
clear train = 0; n_sources = 2; load('../anatomy/fs_cortex_20k_inflated.mat') load('../anatomy/fs_cortex_20k.mat') load('../anatomy/fs_cortex_20k_region_mapping.mat'); load('../anatomy/dis_matrix_fs_20k.mat'); % when load mat in python, python cannot read nan properly, so use a magic number to represent nan when...
b8f758e35dddd02477acf2c9f041906c8d4d62caa28db66170f1617358d84ba8
MATLAB
12,862
310
%% rm_raincloud_cg - plots a raincloud of different groups and observations % This function is based on the rm_raincloud function.m of % github.com/RainCloudPlots/RaincloudPlots/ % % Please see the publication Allen M, Poggliali D, Whitaker K et al. % Raincloud plots: a multi-platform tool for robust data visualization...
1f14260028e9e56a7fc92daffc3e10b9f51f4fe03268e0e4d599597c81f3a354
MATLAB
12,865
334
function dataOut=fc_2group_Ttest_1tp_HSB(fc,IM,params) % Performs the Welch-Satterthwaite-corrected t-test % and enrichment analyses using Chi-square and Hypergeometric stats. % fc is the Fisher-z fc-data; Nseeds-Nseeds-Nsubj % IM is the ROI-to-module key. % params.type determines the type of correlation {'Spear...
70369e12c71cba618d5fe65d14b9750c0b52d6ca0f00c6d6b87643c3b8c19d4a
MATLAB
12,874
305
% AUTHORSHIP % Math Lead & Primary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Secondary Developer: Stephen Meehan <swmeehan@stanford.edu> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Funded by the Herzenberg Lab at Stanford University % License: BSD 3 clause % classdef UmapPyt...
7eadf9744c43d3e8f95f5fb3fe1a74bdc7d2a95f6ae4e1930b2cc3d447a57c7c
MATLAB
12,881
257
function [sorted_replay,time_range]=sort_replay_events(option,varargin) % option is [] if no reexposure, and a vector for reexposures, e.g. [ 1 3 ; 2 4 ] % varargin can be 'wcorr', 'spearman' ,'control_fixed_spike' or 'rate_detection_control' if isempty(varargin) load significant_replay_events; else switch var...
0d3bf781ad5660446d68b600d1f703a2180ca6828002a7b109ac3788ac8a7411
MATLAB
12,893
252
function PARAMS = initializeSession( subjectName, subjectID, deviceName ) % (c) Coraline Rinn Iordan 10/2017, 02/2018, 03/2018, 04/2018, 06/2018 if nargin < 2, error( 'Must provide subject name and ID.' ); end if nargin < 3, deviceName = 'SKYRA.CurrentDesign'; end initStartTime = GetSecs; %%%%%%%%%%%%% %%% SETUP %%...
2ddc8b2db6d226349abbf66cd209e462462b7fef78c1dfd955b47dfda6ee52e7
MATLAB
12,893
354
function FilterIntanSiProbeTest(datDir, varargin) % 8/28/2018 M. Farries % currently works on single-channel-per-file-format only % usage: FilterIntan( datDir, varargin ) % This function wavelet filters data and performs common average % referencing (CAR). The result is saved in a single .hsd file. % It also cre...
0157e12a2a5b63e42dd735231a4882d589eefe1f171b74e5677af318ce2a79dc
MATLAB
12,895
296
function h_updateInfo3(handles) [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); currentFilename = get(handles.currentFileName,'String'); [pname, fname, fExt] = fileparts(currentFilename); pos = get(handles.h_imstack3, 'position');% adjust font size accordingly defaultHeight...
3b66f38bd984415b7f6933634e2f4e311266be0ffc580e1ee9e139e459bc9180
MATLAB
12,900
302
%{ Copyright (c) 2025 Axion BioSystems, Inc. Contact: support@axion-biosystems.com All Rights Reserved %} classdef LoadArgs < handle %LOADARGS parser for file loading arguments properties (GetAccess = private, Constant = true) wellVal = 1; electrodeVal = 2; timespanVal = 3; ...
3839ce9c56ba4fe60e656f56256d9f67871e190729bda4e69d7ed9888dea97f0
MATLAB
12,901
393
function ConvertPhyKilo2Neurosuite(varargin) % % ### % . % +-- _folder(basename) % | +-- basename.dat % | +-- basename.xml % | +-- _Kilosort_date_time % | | +-- spike_clusters.npy % | | +-- spike_times.npy % | | +-- cluster_group.tsv % | | +-- pc_features.npy % | | +-- templates.npy % | | ...
bddd206a36bf5136e20baa8ea204a6c6d956d9a842ddbe135161f6282a8dfeaf
MATLAB
12,903
379
classdef LabelCoreSeqController < LabelCoreController % Sequential labeling controller % % Owns all graphics for sequential labeling mode. Receives GUI callbacks, % extracts GUI state (mouse position, modifiers), delegates data logic % to LabelCoreSeqModel, and syncs graphics in response to model events. properties ...
794c13d294e84d906f509e7b1feb4df0dea375a24a21d5a9b73bab200666203a
MATLAB
12,913
400
function [labels,info]=isosplit5(X,opts) %% Default parameters and self test if nargin<1, test_isosplit5; return; end; if nargin<2, opts=struct; end; if ~isfield(opts,'isocut_threshold') opts.isocut_threshold=1; end; if ~isfield(opts,'min_cluster_size') opts.min_cluster_size=10; end; if ~isfield(opts,'K_init') opts.K_...
3ed2c0778652c178ffc778f1328b2ea8a4d6d3085386dae817b46e566a6c1931
MATLAB
12,926
359
% MARA() - Automatic classification of multiple artifact components % Classies artifactual ICs based on 6 features from the time domain, % the frequency domain, and the pattern % % Usage: % >> [artcomps, info] = MARA(EEG); % % Inputs: % EEG - input EEG structure % % Outputs: ...
6b251087bf7d3f9e9e49087d886d02c75008a0e1c732bed52b7c11b4760761ee
MATLAB
12,927
368
function [cfg, artifact] = ft_artifact_ecg(cfg, data) % FT_ARTIFACT_ECG performs a peak-detection on the ECG-channel and identifies the windows % around the QRS peak as artifacts. Using FT_REJECTARTIFACT you can remove these windows from % your data, or using FT_REMOVETEMPLATEARTIFACT you can subtract an averaged temp...
471e2297f6c75e2444d49e75b6389f00d747790308a11757629e7d076822a3d5
MATLAB
12,936
390
function [predictedY,predictedYD,YD,stats] = predictPhenotype_kernels_kfolds(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 % adapted for using either precomputed kernels or ...
f5f27f9cde2c24071c6da417a69ad9a413cb5e5180a9ade94a2595c7d58b78ec
MATLAB
12,942
369
function [cfg, artifact] = ft_artifact_ecg(cfg, data) % FT_ARTIFACT_ECG performs a peak-detection on the ECG-channel and identifies the % windows around the QRS peak as artifacts. Using FT_REJECTARTIFACT you can remove % these windows from your data, or using FT_REMOVETEMPLATEARTIFACT you can subtract % an averaged te...
25bf38a6eaec067a15698c5dee79027136297fd19f802249a1255c7fedebb3ba
MATLAB
12,957
320
function seizureInfo = getControlTimingInfo(seizurePath, seizureCell, params) % This function reads a seizure's mat file and extracts information about % the baseline times, control times, postcontrol times, recovery times. % It also extracts information about lick and click times. % INPUTS: % - seizurePath: path t...
659a3c69e0639de8a7179e4d9b2b42a4c9f7a4c30d195a3da03fbe55895da57c
MATLAB
12,963
270
function [tismri, Ybraindist0] = boney_segment_evalSPMseg(Yo,Ym,Yc,Ymsk,vx_vol, fast, job, seg8t, tis) %evalSPMseg. Evaluation of the SPM segmentation. % This function extracts tissue intensities by the segmentation Yc from the % intensity scaled image Ym. % % [tismri, Ybraindist0] = boney_segment_evalSPMseg(Yo,Ym,Y...
fe01fadaeec5e55b15d5a577e7253d9cd58a6adb88052d899c0639a7d6617b94
MATLAB
12,967
167
GaussTestFig=figure; set(GaussTestFig,'position',[100,100,1700,800]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AreaSize=100; Amp=1; mu1 = [30 30]; Sigma1 = [ 50 20; 20 50]; % Sigma = [Variance1, C...
de67ba8a0e3db7bb11596ec419cedc063c1452cac684bc3c57baafca5b616973
MATLAB
12,981
466
function varargout = boundedline(varargin) %BOUNDEDLINE Plot a line with shaded error/confidence bounds % % [hl, hp] = boundedline(x, y, b) % [hl, hp] = boundedline(x, y, b, linespec) % [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2) % [hl, hp] = boundedline(..., 'alpha') % [hl, hp] = boundedline(...
f625a38bbe23df254c8a709207a3c39b8786fd13f86da2cbd1b1a7ede53c23f4
MATLAB
12,983
330
%%MergeEvents function [events,noise]=MergeEvents(posevents,negevents,noise,HowToMerge,DealWithNoise,EventCutoff,NoiseCutoff,EventGlue) %Combines lists of positive, and negative events, as well as noise into one using either intersection, union, or another method % %Input: 'posevents' matrix of all positive even...
dd7f0355890773e50c0614c40072e6ade9f0ddca9a18d396020c5d27ac124c33
MATLAB
12,992
363
function headmodel = ft_headmodel_interpolate(filename, sens, grid, varargin) % FT_HEADMODEL_INTERPOLATE describes a volume conduction model of the head in which % subsequent leadfield computations can be performed using a simple interpolation % scheme. % % Use as % headmodel = ft_headmodel_interpolate(filename, sen...
8338787e035ec0fa34fc77d98e55ed4a632e22f65cd9584239792ae7f7a9cd05
MATLAB
12,997
293
function SingleUnitAnalysis(config,varargin) %% % DEtermine whether to use single windows or finescale windows % opts..(FN{i})=opts..(FN{i}); if strcmp(mfilename,'') || nargin==0 opts=Analyze.Libet.Config_BasicLinearModel; else opts=feval(config,varargin{:}); end WindowType=Utilities.getInput...
d04e565ab61fc4e7b2d507a69a3512dbdf0a7c1399bbf25f8eeee5490c7fdef7
MATLAB
13,030
310
function [StandardizedBrain_LH, StandardizedBrain_RH, Header_LH, Header_RH, OutNameList_LH, OutNameList_RH] = y_Standardization_Surf(ImgCells_LH, ImgCells_RH, MaskData_LH, MaskData_RH, MethodType, OutputDir, Suffix) % [StandardizedBrain_LH, StandardizedBrain_RH, Header_LH, Header_RH, OutNameList_LH, OutNameList_RH] = y...
bf47cd2a73ab6f2b7fce033f757146446850a9a21d51d4245b2ffd46bd1da1d9
MATLAB
13,033
463
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
60af318be4d51fc553afd61c07c5571d14667f7b8c4f74f73f996c242dc40eb2
MATLAB
13,041
357
function FilterIntanSiProbe(datDir, varargin) % 8/28/2018 M. Farries % currently works on single-channel-per-file-format only % usage: FilterIntan( datDir, varargin ) % This function wavelet filters data and performs common average % referencing (CAR). The result is saved in a single .hsd file. % It also creates...
6fc55fb8239f60210d3c6d3cecc2188a1e725e7d9f779e67178342e148c0efba
MATLAB
13,045
305
%% ANOVA-N: look at ants, vowels, sub-classes if(run_ANOVA==1) DIRresultsGammaAnova = [DIRresultsRipple, '/anova_gamma_multiple']; mkdir(DIRresultsGammaAnova); % running multiple multiple-way ANOVAs on the words vs non vs noise data for k=1:length(task_data(:,1)) if(multi_se...
a042eaa65669d85df1c71a99fdb2d0efd1423ea55390c73c90c1475762783bab
MATLAB
13,049
401
% add dependencies addpath(genpath('C:/Code/wjn_toolbox-master')) addpath(genpath('C:/Code/wjn_toolbox')) addpath(genpath('C:/Code/leaddbs')) addpath(genpath('C:/Code/spm12')) %% Parcellate and export conmaps input_images = {'alpha_functional_network.nii', 'alpha_str_network_n388.nii','beta_str_network_n982.nii', 'bet...
e2168f7dbc1ea3a27be1d6a90038a4c51a74bdff3628a87f135c95752fc4b880
MATLAB
13,050
305
clear; clc; % This analysis script can be used to run a parellelised version of % connectome-based predictive modelling with LOOCV or repeated k-fold CV. % CPM package could be dowdload from https://github.com/rorytboyle/flexible_cpm/ % Authors: Rory Boyle & Yihe Weng % Emails: rorytboyle@gmail.com & wengy@tcd.ie % Da...
ea7645078d796cfdffd2b658a47250bec029dd7092a3b1e6f22600dea4c1e6c4
MATLAB
13,051
329
function [options,u,dim] = VBA_check(y,u,f_fname,g_fname,dim,options) % VBA_CHECK % [options,u,dim] = VBA_check(y,u,f_fname,g_fname,dim,options) % Checks (and fills in default) optional inputs to VBA_NLStateSpaceModel.m % function [options,u,dim] = VBA_check(y,u,f_fname,g_fname,dim,options) % This function checks the ...
0f202711b07feb3bac208f987a3bde9d63690deae0ddff7ca99b86039cbd0ab3
MATLAB
13,068
495
function ok = CheckEEGMatData(EEG, kb, varargin) % function ok = CheckEEGMatData(EEG, kb, varargin) % checks the dates of the EEG file, mat file, eyelink files all match % checks these against the records % will give errors/warnings if there are mismatches % Input: % EEG = eeglab structure, with EEG.result = resu...
c73bc6e34d56c73bfa303bd8d042b525b82a6c2de9d9d0c2b8bff2036018950a
MATLAB
13,069
381
% Author: Birgit Nierula % nierula@cbs.mpg.de function stats_late_seps(epo_esg, epo_control, condition, srmr_nr) %% stats late SEPs addpath('/data/pt_02296/toolboxes/fieldtrip-20200331'); % paths cfg_path = getenv('CFGDIR'); ga_path = getenv('GADIR'); % condition info cond_info = get_conditionInfo(condition, srmr_nr...
5f448d98f303933ee912e997ed1059fe547c08ed9bcc2dca7b1fef2403880218
MATLAB
13,070
330
function draw_figure2AB(p,decRes) % % This code is for drawing figure 2AB % % %% settings % score index dimIdx = 1:14; catIdx = 15:48; % get roi Idx hcpIdx = ~cellfun(@isempty,strfind(p.roiDescrip,'hcp180')); subIdx = ismember(p.roiDescrip,{'thalamus','hyppocampus','hypothalamus','pallidum','brainstem','caudate','puta...
7f62820c80e72db7496ebdeec65bc61b9751eec1bb8e1fa13171d57fefe2f3e3
MATLAB
13,073
392
% This script separates the images for each freqband addpath C:\code\spm12 addpath C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Neuromodulation - PROJECT ECoG Atlas Connectomics (1)\functions; addpath C:\code\wjn_toolbox spm('defaults','eeg') %% Load Table clear all %% load('E:\ECo...
e68cc0b5f1a2ee44cb5e366a7196c63da4907a3628ed368ddb6e91f80717a7a0
MATLAB
13,075
259
function DatsMetadata = bz_DatFileMetadata(basepath) % Store basic info about the original dat files: names and bytes % Brendon Watson 2016-8 %% Input and directory handling if ~exist('basepath','var') basepath = cd; elseif isempty(basepath) basepath = cd; end basename = bz_BasenameFromBasepath(basepath); ...
19e426151f29455efb66f0ebbe11d2aefadc6a8ffd8c982be0cfc679a7601ed9
MATLAB
13,091
364
function [dipout] = beamformer_pcc(dip, grad, headmodel, dat, Cf, varargin) % BEAMFORMER_PCC implements an experimental beamformer based on partial % canonical correlations or coherences. Dipole locations that are outside % the head will return a NaN value. % % Use as % [dipout] = beamformer_pcc(dipin, grad, headmod...
c297082cae4f12434954373fb42d3f817293800872886bb2e71e9870d30c7e85
MATLAB
13,093
363
function [varargout] = polarPcolor(R,theta,Z,varargin) % [h,c] = polarPcolor1(R,theta,Z,varargin) is a pseudocolor plot of matrix % Z for a vector radius R and a vector angle theta. % The elements of Z specify the color in each cell of the % plot. The goal is to apply pcolor function with a polar grid, which % provides...
516d5fa601dac9b6ac5f2bce5ed8c4e2b6aeb04250d286175fde9ddda99b2faa
MATLAB
13,095
213
function info = display_Training( subjectName, subjectID, scanNum, currentRun ) % (c) Coraline Rinn Iordan 09/2017, 10/2017, 02/2018, 04/2018 % % Flips on given timing! Flips TR-locked! % Total Length: 10m32 sec = 632 secs = 316 TRs if nargin < 4, error( 'Must provide subject name, subject ID, scan run number, and cur...
2ad56d3f7441d1a341974b0439ae2054e8ff4bec3a848d244d7173204442f653
MATLAB
13,096
367
% run_mediation_all2all load(fullfile(saveLoc, 'sig_allSessions'),... 'sigSL') % Analysis parameters max_coh = 0.1; minRT = 0.67; maxRT = 2; start_t = 0; end_t = 0.6; S = sigSL; S.MinI_minus_C = S.MinI - S.MinC; S.Int_MinC_minus_I = cumsum(S.MinC - S.MinI, 2); session = S.session; times = S...
f018bd770d02c08c260744cf3d4616345bb206896800f0250f91164d6ff20821
MATLAB
13,110
325
function [e, thresh] = canny(im, varargin) %CANNY is an implementation of the Canny edge detector % E = CANNY(IM) takes a 2-D grey-level image or a 3-D array representing % a volume and returns a 2-D or 3-D logical edge map using centred % differences and non-maximum suppression. No smoothing or thresholding ...
9273ef8a1de2f467d3834762451e9f9375b5073365138b8c7370a4ac41bc3dc4
MATLAB
13,116
382
function [px] = projective (x, t, d, m, r) % PROJECTIVE % % CALL: [px] = projective (x, t, d, m, r); % % INPUTS: % x: the vector containing the scalar observations % t: delay parameter used in embedding % d: embedding dimension to consider % m: dimensiona of null space % r: number of nearest neighbors to c...
3d466a963d2513c092178e2fe868cfdcea7f4de298b581818ea32a57c28ef2a7
MATLAB
13,132
309
function varargout = h_CASpineDetectionGUI3(varargin) % H_CASPINEDETECTIONGUI3 M-file for h_CASpineDetectionGUI3.fig % H_CASPINEDETECTIONGUI3, by itself, creates a new H_CASPINEDETECTIONGUI3 or raises the existing % singleton*. % % H = H_CASPINEDETECTIONGUI3 returns the handle to a new H_CASPINEDETECTION...
d31d77f38566efd3567302245ece0c4fc4d0f305ee056f72172b7700de924cd7
MATLAB
13,135
347
function [neighbours, cfg] = ft_prepare_neighbours(cfg, data) % FT_PREPARE_NEIGHBOURS finds the neighbours of the channels based on three % different methods. Using the 'distance'-method, prepare_neighbours is % based on a minimum neighbourhood distance (in cfg.neighbourdist). The % 'triangulation'-method calculates a...
097694a75b82eb3c9be501607c7369ae81f3cee8cfef97107cdb7fc68eda318e
MATLAB
13,138
362
function [t,I]=image_difference(V,U,type,Mask,MaskNum) % This function gives a registration error and error image I between the two % images or volumes. % % [t,I]=image_difference(I1,I2,type,Mask) % % inputs, % I1: Input image 1 % I2: Input image 2 % type: Type of similarity / error measure % (optional)...
1c1754f5ba3c6500f39abaa2c40a9706123eab87ed6d3bf5fac1f92c755b72aa
MATLAB
13,150
457
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Mus...
b679c67a7c0a4712942090932d8983147a7db0426973c7c2fc53b3e14e6f9b2c
MATLAB
13,154
492
clear all close all clc % Use this script to generate figures similar to those in Figure 5 and Figure 6 of: %Luna, R., Li, J., Bauer, R., & van Leeuwen, C. (2023). Retinal waves in adaptive %rewiring networks orchestrate convergence and divergence in the visual system. %Network Neuroscience cd '..\scr...
d13ca3b2b1ac64bf452fdf4c0bcc6eef0fc27aaf0a353b8f4e45044d5cf61e56
MATLAB
13,159
373
% create_periods_nametable_forPLSR.m % Sarah West % 6/4/22 % Script that organizes periods_nametable for easy creation of response % variables for partial least squares regression for Random Motorized % Treadmill experiment. clear all; % Create the experiment name. parameters.experiment_name='Random Motorized Tread...
e93d680b43380a6d76d1e0f2501f9f78f501d7f7de41fa85bf76161e201108e2
MATLAB
13,164
450
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
6b787cc70f014de8c9887a066c03e022427dd5bf505b00919158b32d59da5dff
MATLAB
13,171
457
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Mus...
a2caf79807f94855985cbefd16cb753d11940816ae1d4373ecd3be3fb375cdab
MATLAB
13,180
325
function model = plotMCmatlabMC(model,varargin) % Displays (if calculated) % Absorbed power % Fluence rate of all photons % Example paths of some of the photons % Distribution of escaped photons in the far field % Fluence rates (intensities) on all boundaries % And, if a light collecto...
c17ac873117c4249f1625f7e21abf55498948154830ff66589b5e5d0c1326273
MATLAB
13,182
456
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
7e990a380466304d5f13dfb54a5a7196ba066288d1493a45a149578faf2ce46e
MATLAB
13,184
453
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
6fcfbe8c7c25e4b5238a43d80ed112f6641baa111c4618909d5a9e7b0484a65f
MATLAB
13,192
449
function data = loadubjson(fname,varargin) % % data=loadubjson(fname,opt) % or % data=loadubjson(fname,'param1',value1,'param2',value2,...) % % parse a JSON (JavaScript Object Notation) file or string % % authors:Qianqian Fang (q.fang <at> neu.edu) % created on 2013/08/01 % % $Id$ % % input: % fname: input file...
f08a08c4f8667c71fbbe8a074e02bab60575c6121aee21c95e46398a27e24abe
MATLAB
13,196
358
function Stroop_170907(setup, expInfo) % 170904 JQK | adapted from http://peterscarfe.com/stroopdemo.html % | merged with parts of BasicSoundInputDemo for audio recording % | removed parts related to RT encoding by button press % 170904 JQK | added EEG triggers %% create individual directory St...
07b0dcceacdcd21b19b8698248c93d9099cf26adeede8a1331c7227c134c7b11
MATLAB
13,203
363
% Author: Birgit Nierula % nierula@cbs.mpg.de function ga_amplitudeAndLatency(subjects, condition, srmr_nr) savepath_ga = getenv('GADIR'); if ~exist(savepath_ga,'dir'), mkdir(savepath_ga); end % get condition info [cond_info] = get_conditionInfo(condition, srmr_nr); cond_name1 = cond_info.cond_name; nerve = cond_inf...
3e96d9bfc6f0dd2dbed3736b957f40bf5a9475cbbba8ef45763dea29d1b49392
MATLAB
13,203
385
function [cfg] = ft_connectivityplot(cfg, varargin) % FT_CONNECTIVITYPLOT plots channel-level frequency resolved connectivity. The % data are rendered in a square grid of subplots, each subplot containing the % connectivity spectrum between the two respective channels. % % Use as % ft_connectivityplot(cfg, data) % w...
e7d9c06d335724e75cf3ef1ab698a1f88535c5370c43989c62879103e8c98a57
MATLAB
13,208
295
function DataStructure=ExpFit_ZN(Xdata,Ydata) if size(Xdata,1)<=1&&size(Xdata,2)<=1&&size(Ydata,1)<=1&&size(Ydata,2)<=1 warning('Need to provide more than one data point to fit!') DataStructure=[]; elseif size(Xdata,1)~=size(Ydata,1)||size(Xdata,2)~=size(Ydata,2) warning('Need to provide...
da2526d5ec7518bd1c5d5683fa3ce4145c37b76bcd2b19831c95b8b41f4fdbf8
MATLAB
13,209
246
% TSTRIALSTAT Compute within-trial statistics % ER = TSTRIALSTAT(STATNAME,FUNHAND,VARARGIN) creates a stat called STATNAME % that is determined by running the function FUNHAND (passed in as a % function handle or a string) on the current trial's active data (usually TSData) % and the remaining arguments given ...
17091c574ea703111d9ca1cad75e01e3a108d7c06ae7e3c508baf4337088173b
MATLAB
13,211
363
function headmodel = ft_headmodel_interpolate(filename, sens, sourcemodel, varargin) % FT_HEADMODEL_INTERPOLATE describes a volume conduction model of the head in which % subsequent leadfield computations can be performed using a simple interpolation % scheme. % % Use as % headmodel = ft_headmodel_interpolate(filena...
9fa68106613caa5cfdd3d0e9e71d2f9e609b15e1b97d9b8296c42a449d88924c
MATLAB
13,211
461
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
b4fb7f40cbffe15cd86ead865095d8604411b6f7fc2fbaf88346292851acf047
MATLAB
13,222
353
function bz_ConcatenateDats(basepath,deleteoriginaldatsbool,sortFiles) % bz_ConcatenateDats - Concatenate raw .dat files found in a session folder % - for intan type recordings % % ALGORITHM OUTLINE: looks for .dat files in a folder (or in subfolders) to % concatenate together. The concatenation happens via system c...
fbc495bd817cd20d83c371861e5891d27745f76f8e386a26c7f51e8082406637
MATLAB
13,228
459
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
ccb7188ec56be4724c52eeeac003c55a02f4a57dffee3c54cc5b00af21ad81eb
MATLAB
13,229
320
classdef cylinderDetector < surfaceDetection.surfaceDetector % Detect surface by maximal cylindrical radial derivative % as opposed to fast cylinder detector, the center for the radial % derivative is estimated separately for each z-position based on % thresholding %-----------------------------...
6cd6174db0a5a127081358ecd10c1a4242cf25b778a087a91eda5daef60bbc94
MATLAB
13,263
460
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Mus...
77a6e7df5c3ccd5456dacfbfc3b2dcfb14227222caabb1fa865039a5bc40e023
MATLAB
13,264
469
function [LAN] = lan_read_file(filename,type) % <*LAN)<] toolbox % v.0.3 % read file usig Fieldtrip toolbox % -- addpting for reading micromed .trc file % % Pablo Billeke % 03.05.2017 add Brain Amp option % 12.04.2016 add CNT particular option to not use MEX file from FILEIO % use EEGLAB fun...
08ec0dda3533f4d6ac57c73f222e0bbf77f88a9d88ff0df6a653f1e9e818a871
MATLAB
13,266
322
function [data] = ft_regressconfound(cfg, datain) % FT_REGRESSCONFOUND estimates the regression weight of a set of confounds % using a General Linear Model (GLM) and removes the estimated contribution % from the single-trial data. % % Use as % timelock = ft_regressconfound(cfg, timelock) % or as % freq = ft_re...
94e21b2564bedf790c5a022da56e9d0274cf526cfe9f2afc112fce19ae5aa6fd
MATLAB
13,269
334
function [r_coupling, beta_weights, pc_variance, predictor_outputs, CommModel_SFC_Parameters] = ... fcn_calculate_CommModel_SFC_RegionalPCA_wy(results_dir, ids, cs, coords, opts) % FCN_CALCULATE_COMMMODEL_SFC_REGIONALPCA_WY % Compute regional SFC using selected communication-model predictors. % % This toolbox versi...
422362a1cdfee695a344c0c16da630ebd8ea36c2eac5102b5adf6a1b44167a31
MATLAB
13,281
345
function [trl, event] = rest_trialfun(cfg) % FT_TRIALFUN_GENERAL determines trials/segments in the data that are % interesting for analysis, using the general event structure returned % by read_event. This function is independent of the dataformat % % The trialdef structure can contain the following specifications % ...
581861cf7997d59008be4b9979227b50bd860ffad28cebd9f1e759558897f9ef
MATLAB
13,284
313
function varargout = h_proteinGelAnalysisGUI3(varargin) % H_PROTEINGELANALYSISGUI3 M-file for h_proteinGelAnalysisGUI3.fig % H_PROTEINGELANALYSISGUI3, by itself, creates a new H_PROTEINGELANALYSISGUI3 or raises the existing % singleton*. % % H = H_PROTEINGELANALYSISGUI3 returns the handle to a new H_PROT...
07ef49d363329b49fbdc106f0bdedfa43164fe31e715153362ac506e4c623dde
MATLAB
13,286
326
classdef SurfacesReader < SurpassObjectReader % SurfacesReader Read Imaris ims file Surfaces data % % © 2015–2016, Peter Beemiller (pbeemiller@gmail.com) % % See also ImarisReader | SurpassObjectReader properties (SetAccess = 'immutable', GetAccess = 'public', Transient = true) ...
c23c166a781f74da7b413af8768ac5c8b639f30bc05ef2f2e43475000be92ed0
MATLAB
13,286
345
function [trl, event] = ft_trialfun_general(cfg) % FT_TRIALFUN_GENERAL determines trials/segments in the data that are % interesting for analysis, using the general event structure returned % by read_event. This function is independent of the dataformat % % The trialdef structure can contain the following specificatio...
f7f7298ebec21fb5d43056d03e4c5f05d7b6b27aaf0035840d4d41a3666280a7
MATLAB
13,288
345
function [trl, event] = ft_trialfun_general(cfg) % FT_TRIALFUN_GENERAL determines trials/segments in the data that are % interesting for analysis, using the general event structure returned % by read_event. This function is independent of the dataformat % % The trialdef structure can contain the following specificatio...
7bc231628b3a182f741fbdd295a71e9e908746482ba854691ebad3a1bc569c98
MATLAB
13,299
338
function [imgPair] = imageRegistrationWorkflowParfor(imgPair,imgSize, doNotSection) % imgPair must contain at least the fields moving.input and static.input, % which are the matrices containing input images % output imgPair is a structure with all relevant results from operations in % this function % moving.mask is...
185d917ebb0c50650962981c71fe0dad478b7489afe48b894932616d14abc27c
MATLAB
13,300
248
% 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 processes and analyzes sensory feedbacks in cat locomotion. % In order to compute sensory feedback (Ia, ...
4d93c15afae88418402d98a3945594e5d8205e079d01427bf64212cd042cf8c4
MATLAB
13,303
462
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
e9b80772f2a414dd38956f09d5c4647912d95525ce3a1ff47d13f6269311f244
MATLAB
13,304
386
function [Y,xY] = spm_regions_mask(job) % VOI time-series extraction of adjusted data (& local eigenimage analysis) % FORMAT [Y,xY] = spm_regions(xSPM,SPM,hReg,[xY]) % % xSPM - structure containing specific SPM, distribution & filtering details % SPM - structure containing generic analysis details % hReg - Handl...
92b0e2574c4177a4296470135831b98184cf289e956a9795443efe407052f055
MATLAB
13,305
464
% clear % clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); MuscleCluster = load('MuscleCluster.mat'); MuscleCluster = MuscleCluster.MuscleCluster; C1 = MuscleCluster{1}; C2 = MuscleCluster{2}; C3 = Musc...
bfbd1dc94c781a45bfa4c66b25991161916e31b3f944544efcf86ca6bab2582b
MATLAB
13,305
480
classdef TrackingVisualizerMTFast < TrackingVisualizerBase % TrackingVisualizerMTFast % Like TrackingVisualizerMT, but uses fewer graphics handles for speed. % % Non-gobject model state lives on the associated % TrackingVisualizerMTFastModel (accessed via obj.tvm_). properties parent_ % LabelerControl...