sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
448a2e41481b6f82d4961f840b4819102ad856256d3319438b3ac1d79a20e452
MATLAB
22,268
535
function colocMeasure = simulateCondColocGeneral(numRefObj,numTarObj,segmentation,... cellMask,refColocWithCondFrac,tarColocWithCondFrac,... tarColocWithRefAtCondFrac,tarColocWithRefNotAtCondFrac,varargin) %SIMULATEPT2PT2BLOBCONDCOLOC simulate object positions to be used for general cond...
6c0d099c50c78868075c91f7ff98527a274f523a6c22bd4b7edb0e23a5f94446
MATLAB
22,416
543
function [] = minimalTifROIgui(tifFilePath) IMGdata = justLoadTif(tifFilePath); %draw ROIs on concatenated motion corrected image data sROI.img = IMGdata; sROI.nFrames = size(IMGdata,3); sROI.imgHeight = size(IMGdata,1); %this will be the main figure for drawing ROI ui.roiGUI.fh = figure('Name','Choose fra...
a6eb8a8fcdfc7c7c91597a2fd88e7eefaa04c0cbd033ab22ce1058711e640f67
MATLAB
22,434
774
idx = cell(2,1); idx{1} = 1:94+86; idx{2} = 94+86+1:400; %% Ketamine within_ketamine = nan(12,2,2); % subj x BASE/PLOR x 4 matrices filelist = dir('./KTM/Reordered_FCmat/'); for subj = 1:12 disp(subj) load("./KTM/Reordered_FCmat/"+filelist(subj+2).name+"/BASE_noGSR_FCmat.mat"); FC_NG = FCmat; ...
aba8c84d42fc6cf1c35903e9231de06ade7259257767810107568634ad328958
MATLAB
22,443
459
function [methodsText, references, bibtexEntries] = generateMethodsText(param, varargin) % bc.qm.generateMethodsText - Generate a methods section paragraph from BombCell parameters. % % Generates a ready-to-use methods section paragraph for scientific papers, % with appropriate citations, based on the parameters used t...
de711264c904c6239d709c2ab21bf30e8face91ec6bc7b5c4cecbcdeaae0fc62
MATLAB
22,466
667
function preprocess_bids_minimal(bids_root, subj_list, keep_tasks, opts) % preprocess_bids_minimal % % ONE-FILE, serial, lightweight SPM12 preprocessing for BIDS fMRI. % % Pipeline per selected run: % 1) Segment T1 (deformation field only; once per sub+ses) % 2) Realign: Estimate + Reslice mean only (no r*.nii time...
69fe8ec4f3c11b0289f4a0cc3dbf4b130ca63ce08c05da5078da55a8c65634e1
MATLAB
22,506
461
function IN = inpolyhedron(varargin) %INPOLYHEDRON Tests if points are inside a 3D triangulated (faces/vertices) surface % % IN = INPOLYHEDRON(FV,QPTS) tests if the query points (QPTS) are inside % the patch/surface/polyhedron defined by FV (a structure with fields % 'vertices' and 'faces'). QPTS is an N-by-3 se...
3e5c0bb64b112ec709b27b4bb65710352d382588ee7c608ce36241cd7f622963
MATLAB
22,615
660
function varargout = ea_cortexselect(varargin) % EA_CORTEXSELECT MATLAB code for ea_cortexselect.fig % EA_CORTEXSELECT, by itself, creates a new EA_CORTEXSELECT or raises the existing % singleton*. % % H = EA_CORTEXSELECT returns the handle to a new EA_CORTEXSELECT or the handle to % the existing si...
91369f73a180611fbea877dbb57054bd280667f2a98339433afaab24f8ba2e36
MATLAB
22,652
517
% dipoledensity() - compute and optionally plot a measure of the 3-D spatial % (in)homogeneity of a specified (large) set of 1- or 2-dipole % component models, either as physical dipole density or as % dipole-position entropy across subjects. In either case, ...
5b012b0febd44aa79c7d82d24359238bdd09a8c896d45464b260598f0910bcb1
MATLAB
22,775
620
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
4298b2173819b48b9d85b799616345158b0dd2a3cb8b38316cead5996c871e6b
MATLAB
22,822
494
function [rankStats] = bz_RankOrder(varargin) % [rankStats] = RankOrder(varargin) % % Get rank order of spikes inside events from previously calculated % bz_getRipSpikes structure. The 'corrEvents' output field structure shows % rank correlation of each event with the selected 'templateType', and the % 'pvalEve...
e7f700afd915aae7d2713997e2610fd9d1cd5d50460de372721eec9c2e12a439
MATLAB
22,953
550
function [ likelihood, results] = CBIG_gwMRF_graph_cut_clustering_split_newkappa_prod(x,prams,hemisphere) % This function performs the actual clustering. This version is for the premulitiplied input data. % % Input % - x = input data (premultiplied timeseries data) % - prams = a struct containi...
3d7b06fef091c5345639604176d78af36feb59916650eb2742eeb29b4283ef04
MATLAB
22,994
646
function myOISscr1(fname,saveid,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16) % Usage ... myOISscr1(fname,saveid,p1,a1,p2,a2,...) % % p#s = do_load, do_loadall, do_motc, do_maskreg, do_intc, do_motc_apply, do_intc_apply, do_keepalldata % average_parms = [#off, #ims_per_trial, #trials] % % ex. % myOISs...
453b37fccf57dfdad52afe1d6bd8e13be561f4c7ca79e4d04accbf57cd33ad59
MATLAB
23,018
657
function ea_mancor_updatescene(varargin) hobj=varargin{1}; ev=varargin{2}; mcfig=varargin{3}; firstrun=getappdata(mcfig,'firstrun'); contrast=getappdata(mcfig,'contrast'); offset=getappdata(mcfig,'offset'); if isempty(contrast) contrast=0.8; end if isempty(offset) offset=0.3; end setappdata(mcfig,'offset',off...
2928563a999ddb2454287c0273e36c6edcb28acca3707a2840743f61bfcee7bd
MATLAB
23,057
608
function [lh_labels, rh_labels] = CBIG_MSHBM_generate_individual_parcellation( ... project_dir, mesh, num_sess, num_clusters, subid, w, c, subject_set) % [lh_labels, rh_labels] = CBIG_MSHBM_generate_individual_parcellation(project_dir,mesh,num_sess,num_clusters,subid,w,c) % % This script will estimate the indi...
069887694ac444fefc17dbf93385468f34e7e1d3d9b14763b45fd18cd096de45
MATLAB
23,084
608
function [ EventDetectionReview ] = EventExplorer(basePath,events,varargin ) %EventExplorer is a GUI tool for exploring buzcode events and states files. % %INPUT % events eventsName string (i.e. 'SlowWaves'), % to load file: basePath/baseName.eventsName.events.mat % -or- % ...
36992d5dc1f182abbc67ebbffa0c3c23b7432188e9b6945a668b22bc10656786
MATLAB
23,133
635
function [Sxx, Syy, Sxy, xc, yc, um, vm] = compute_stress(x,y,tx,ty,K1,K2,h,BC) %COMPUTE_STRESS.m COMPUTE MONOLAYER STRESSES FROM TRACTIONS % % [Sxx, Syy, Sxy, xc, yc, um, vm] = compute_stress(x,y,tx,ty,K1,K2,h,BC) % % Compute in-plane stress tensor components from a list of grid points % (x,y) and nodal tractions (tx...
b75e9dac75f6c28d9f158574e11cae1595fef7a7ec2fd764925f55367181079f
MATLAB
23,139
376
function ClincFreq_HeatNumStat(INDIR,OutHeatdir,SetUpPara,Para,AtlasTempU) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; for i = 1:length(SetUpPara.ParaOut) LabName = SetUpPara.ParaOut(i).LabName; HeatDir{i} = [OutHeatdir,filesep,LabName,filesep]; % if onl...
40fc1232860031ecc210d9a8b24905206af2b577b4d5515999770b67d78fa2b4
MATLAB
23,240
551
function [lh_labels, rh_labels] = CBIG_ArealMSHBM_parcellation_single_subject(params) % [lh_labels, rh_labels] = CBIG_ArealMSHBM_parcellation_single_subject(params) % % This function is a simplied wrapper to perform MSHBM individual areal-level % parcellation for a single subject. This function prepare take simple inpu...
c161f99b84bc6f40e11c734ddf5d2baeb6aaf3077a308d2a6c962b1ca2741a80
MATLAB
23,311
491
%This script is designed to calculate coherence between pairs of channels %using an adapted coherencyc function from chronux %Saves a structure for each animal that contains a coherence matrix for %each behavioral state (for this script: full recording, running time, %running time within threshold, and non-runni...
3a94774acd8fa4f865ad28038c20f1c889a85b7da5c28890e16fd06e1d5931e6
MATLAB
23,316
484
function varargout = ea_genvat_butenko(varargin) % Wrapper for OSS-DBS simulations. % By Butenko and Li, konstantinmgtu@gmail.com if nargin==2 S=varargin{1}; options=varargin{2}; elseif nargin==3 S=varargin{1}; options=varargin{2}; hFigure=varargin{3}; elseif nargin==1 && ischar(varargin...
fd0e821e14692651dee7b9985288cee4e24ed5acbf650fdeef1e19ce983792fa
MATLAB
23,316
486
function [M_final,shifts_g,template,options,col_shift] = normcorre_batch(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a 3D % ...
eb0d8748eae6b5fc729a47369ed4c6231bf9c7617b00fb8af5f93871b74fb834
MATLAB
23,416
635
function [amplifier_channels, notes, aux_input_channels, spike_triggers, board_dig_in_channels, supply_voltage_channels, frequency_parameters,board_adc_channels ]... = read_Intan_RHD2000_file_bz % read_Intan_RHD2000_file % % Version 2.01, 11 October 2017 % % Reads Intan Technologies RHD2000 data file generated by...
3669928a337920135f5a6c92bb95cffdf8db8bb87ed6d91b47ab3743183da51d
MATLAB
23,457
497
%This script is designed to calculate coherence between pairs of channels %using an adapted coherencyc function from chronux %ADDING STEPS TO LOOP THROUGH POSSIBLE SPEED RANGES - NOT DONE YET %Saves a structure for each animal that contains a coherence matrix for %each behavioral state (for this script: full r...
f43681e5f359d7a15afa46ea3a497806ce3c0440f72b56339a3671aac50ac711
MATLAB
23,520
690
function canlab_glm_subject_levels_old(dsgnarg, varargin) % Performs lower level GLM analysis with SPM: % 1. specifies model % 2. estimates model % 3. generates contrast images for model % 4. creates directory with named links to spmT and con maps % 5. publishes analyses with scn_spm_design_check % % :Usage: ...
2cca7916919a905195ba093c1ff3b95f50e500321a0fc14255d56288ca565a11
MATLAB
23,647
537
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) % ...
726b1c2202d814a9ef3bef3c04ce743bf20fbd99ff14b1084956f83388b93236
MATLAB
23,726
593
% ==================================== %% Help % ==================================== % % CBIG_supp_fig4_lang_homo % % This script replicates Supplementary Figure 4: FC homogeneity and % inhomogeneity restricted to the Language A and Language B networks. % Four panels are produced: % A - NIH test set resting-state ho...
a67e65bfb52805f64ab2f3c897162b69d3794da7598ec6a54e928fe301c64fff
MATLAB
23,728
378
% pop_rejmenu() - Main menu for rejecting trials in an EEG dataset % % Usage: >> pop_rejmenu(INEEG, typerej); % % Inputs: % INEEG - input dataset % typerej - data to reject on (0 = component activations; % 1 = raw electrode data). {Default: 1 = reject on raw data} % % Author: Arnaud Delorme,...
786bdef557e25f17cabb51ac12991c889f2b2135c8cc00b27218b155c81862d8
MATLAB
23,756
691
function make( varargin ) % % Determine the base path % odir = pwd; base = mfilename('fullpath'); base = fileparts( base ); % % Check the force and runonly flags % args = varargin; is_octave = exist( 'OCTAVE_VERSION', 'builtin' ); if is_octave, force = true; runonly = true; indexonly = ...
4e2e9713182b568309f4d2760f5a5cb6685952802aa137dd15d61b5e8db59622
MATLAB
23,769
479
function [M_final,shifts_g,template,options,col_shift] = normcorre_batch(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a 3D ...
cc784e586ef8dcca5e2792dc1f66756480904f3f7930f8cfa885235a21548000
MATLAB
23,783
583
%% LaBGAScore_secondlevel_mvpa_beta_maps_conn.m % % % *USAGE* % % This script runs MVPA regression analysis on a continuous outcome Y % (default pcr, but can easily be adapted to pls or % other machine learning algorithms) on an fmri_data % object created from seed-based resting-state connectivity maps generated % by t...
b484f82949ab107008bf2253e3c56d396905c8b05e196515513003b68d3a49c6
MATLAB
23,800
547
%% Step 4 Tiny Dancers: Group analyses for frequencies clear all clc bigbin=5; smallbin=3; % load all frequency data cd('D:\MUSICOM_EEG\PROC\Step3_frequencydata\3m'); FileNames_3m = {dir(['*_FREQ' '.mat']).name} ; for k=1:1:length(FileNames_3m) load(FileNames_3m{k}) avg_baseline_ssep_3m{k} = Tri...
df75f3b0cfef09c5363b6155bbe9e1ff2df2c4ce8d52dee22c62bf62dcde922b
MATLAB
23,836
632
function read_Intan_RHD2000_file % read_Intan_RHD2000_file % % Version 2.01, 11 October 2017 % % Reads Intan Technologies RHD2000 data file generated by evaluation board % GUI or Intan Recording Controller. Data are parsed and placed into % variables that appear in the base MATLAB workspace. Therefore, it is...
32d221db22ad6a0b6928b8d03f470648d66e46b03950d691424087c9dbf76c7a
MATLAB
23,871
416
function AnimalMetadata = bz_AnimalMetadataTextTemplate(basepath) % This .m file is a generic template and will be copied to animal % folders/session folders and will be called basename_AnimalMetadataText.m. % It is represents code that will be used to % create a basename.AnimalMetadata.mat file. Edits here will be re...
39befecead83c4dc23f0734501b8ed849d37dae99e8b536fca83b1237ae4a9f1
MATLAB
23,976
634
function read_Intan_RHD2000_file_noselect(file,path) % read_Intan_RHD2000_file % % Version 2.01, 11 October 2017 % % Reads Intan Technologies RHD2000 data file generated by evaluation board % GUI or Intan Recording Controller. Data are parsed and placed into % variables that appear in the base MATLAB workspac...
5c776bd167daa64baeec06b982046d2b3d37a0ba8dd473850cf6593e0de6a3cb
MATLAB
24,049
649
function read_Intan_RHD2000_file(varargin) % read_Intan_RHD2000_file % % Version 2.01, 11 October 2017 % % Reads Intan Technologies RHD2000 data file generated by evaluation board % GUI or Intan Recording Controller. Data are parsed and placed into % variables that appear in the base MATLAB workspace. Therefore, it ...
6e71f139b9662eb6e746f986dd2629696db0a065feaec64b6f80cc08d0fa2db1
MATLAB
24,057
863
function [Results, Summary] = calcium_data_PrL_SB_struct_clean( ... mouse_number, session_frame, matfilepath, corr_threshold, matfile, neuron_chosen_signal) % Structured version of calcium_data_PrL_SB % % Inputs % mouse_number : vector of mouse IDs % session_frame : 6xN or 9xN session frame mat...
cde80626c6eb6b6806728ba3d407d20f73824797d1d49e49d67fb984dd783c16
MATLAB
24,065
544
% pop_comperp() - Compute the grand average ERP waveforms of multiple datasets % currently loaded into EEGLAB, with optional ERP difference-wave % plotting and t-tests. Creates a plotting figure. % Usage: % >> pop_comperp( ALLEEG, flag ); % pop-up window, interactive mode % ...
a41a399d1fa83a4ab7ffc00741bd30e708f8052713b315404465748686956413
MATLAB
24,066
468
classdef SSankey < handle % Copyright (c) 2023-2024, Zhaoxu Liu / slandarer % ========================================================================= % @author : slandarer % 公众号 : slandarer随笔 % 知乎 : slandarer % ========================================================================= % # update 2.0.0(2024-02-04)...
230fa640bb078594eafc2bbc3823ba93e1dbef7bca8b0e52c1c263b3f2fdad3c
MATLAB
24,196
598
function SANDIinput = setup_and_run_model_training_with_dot_forGUI(SANDIinput, fig_ax) % Main script to setup and train the Random % Forest (RF) or multi-layers perceptron (MLP) regressors used to fit the % SANDI model % % Author: % Dr. Marco Palombo % Cardiff University Brain Research Imaging Centre (CUBRIC) % Cardif...
215a0bcaa87c697c6079261b85631bdc2a5a847b1fa1831fbc8c6b188dca0a29
MATLAB
24,264
659
function ROI_table = plot_ENet_diagnostics_neuroimaging(results, X, Y, roiNames, atlasFile, varargin) % plot_ENet_diagnostics_neuroimaging Plotting and diagnostics for Elastic Net neuroimaging pipelines. % % This function visualizes and exports diagnostics from Elastic Net pipelines % such as ENet_neuroimaging_pipelin...
634befee34719465002dbb51c7f61db0fdfe15d8b8da75647547d2e87115e720
MATLAB
24,311
595
function [RP, RESULTS]=rqa_legacy(DATA,TYPE,tau,dim,ZSCORE,NORM,SETPARA,SETVALUE,plotOption) % [RP, RESULTS]=rqa_legacy(DATA,TYPE,EMB,DEL,ZSCORE,NORM,SETPARA,SETVALUE,plotOption) % Inputs - DATA, a double-variable with each dimension of the % to-be-analyzed signal as a row of numbers in a separate % ...
8a1763e8a41de5ea8405850cd533159df7f9e8e62c2581447731e62e939420f3
MATLAB
24,316
568
%% Step 4 Tiny Dancers: Group analyses for ERP % load all ERP data clear all clc %% Load data cd('D:\MUSICOM_EEG\PROC\Step3_ERPs\3m\'); FileNames = {dir(['*' '.mat']).name} ; for k = 1:1:length(FileNames) load(FileNames{k}) avg_baseline_3m{k} = ERP_baseline; avg_control_3m{k} = ERP_co...
157e243066fb92f1adcecfb79bb57e25450f8f8eede0b78dc99632f3bd34a2b9
MATLAB
24,375
699
function varargout = auto_classify(varargin) % AUTO_CLASSIFY M-file for auto_classify.fig % AUTO_CLASSIFY, by itself, creates a new AUTO_CLASSIFY or raises the existing % singleton*. % % H = AUTO_CLASSIFY returns the handle to a new AUTO_CLASSIFY or the handle to % the existing singleton*. % % ...
23a768ca3bf6bdc0ff2162909655a5f9f54eea23a3adfbf604de3f71ffc265bd
MATLAB
24,396
646
function saveNEV(NEV, varargin) %% % Save an .NEV file from an NEV structure (gained by using openNEV) % Works with file spec 2.3 % % Use saveNEV(NEV, filename, noreport) % All input arguments are optional. Input arguments can be in any order. % % NEV: Name of the NEV structure to be saved. % ...
294420d5744696a4b1d74405fbefa1bf996b8e011d841b92ea448d5e2c66eace
MATLAB
24,437
363
% pop_statparams() - helper function for pop_erspparams, pop_erpparams, and % pop_specparams. % % Usage: % >> struct = pop_statparams(struct, 'default'); % >> struct = pop_statparams(struct, 'key', 'val', ...); % % Inputs: % struct - parameter structure. When called with the 'default' % ...
5574c74c829b3cd069a3d98865ad1287e4a38307fbe4d70b3a3d48232c79a0cf
MATLAB
24,471
495
%% Basic script for decoding behavioral stimuli based on neural data function [RastFig, DecodeFig, num_cv_splits, num_units] = runNeuralDecodingToolbox(raster_data_dir,area,condition,spikeType, ... unitType,trialType,classifier_labels,classifierName,varargin) options = inputParser; checkArea = @(x) ischar(x) || is...
7b78c60e971b17bb45b1068dd516314050bb258ac3beadb0a81495459491230a
MATLAB
24,553
609
function SANDIinput = setup_and_run_model_training(SANDIinput) % Main script to setup and train the Random % Forest (RF) or multi-layers perceptron (MLP) regressors used to fit the % SANDI model % % Author: % Dr. Marco Palombo % Cardiff University Brain Research Imaging Centre (CUBRIC) % Cardiff University, UK % 4th A...
175bca04c25c1d6879d2c072668c25692b04714bc5c6e70e73bc3fad5c601396
MATLAB
24,583
756
function CFA_inout(H) % function CFA_inout movegui(H.fig,'west') pathss = which('CFA_inout.m'); [pth nam ext] = fileparts(pathss); IOsetupdir = [pth,filesep,'IOparameter',filesep]; if ~isempty(dir(IOsetupdir)) rmdir(IOsetupdir,'s') mkdir(IOsetupdir); else mkdir(IOsetupdir); end load([pth,filesep,'colorforl...
7cd11bcdae41a2d5aa0fb74cbca32ddb94281453a4fac141d97923aa29114ec2
MATLAB
24,608
569
% pop_selectevent() - Find events in an EEG dataset. If the dataset % is the only input, a window pops up to % ask for the relevant parameter values. % % Usage: >> [EEGOUT,event_indices] = pop_selectevent( EEG, 'key1', value1, ... % ...
b6362cdc58cecd9c0657ae7aade582d5f9b1b4afb7c3a4f351924c8a07f0b59b
MATLAB
24,628
688
function varargout = ea_atlasselect(varargin) % EA_ATLASSELECT MATLAB code for ea_atlasselect.fig % EA_ATLASSELECT, by itself, creates a new EA_ATLASSELECT or raises the existing % singleton*. % % H = EA_ATLASSELECT returns the handle to a new EA_ATLASSELECT or the handle to % the existing singleton...
d0ba93e0fa2f111c828902cee8c4cdb42ec6084a0cbe38b96b922ff3fe247b52
MATLAB
24,678
662
%% demos - demonstrations of the analysis software % Performs various information theoretic analyses using simple model data % generated within. Each specific type of demo can be run individually. % % Other m-files required: whole software package % Subfunctions: none % MAT-files required: 2PIDMats.mat, 3PIDMats.mat, ...
389ce78a147a387cc202a2a1e0f970a02bb2c78d23a77ec82d380c22af87c6e6
MATLAB
24,747
617
function plotSaveConditionalColoc(PtOrBlob,plotting, saveRes,pathToSave, varargin) %PLOTSAVECONDITIONALCOLOC plots and/or saves conditional colocalization results % % SYNOPSIS plotSaveConditionalColoc(PtOrBlob,plotting, saveRes, varargin) % %INPUT % PtOrBlob: 1 for plotting Pt2Pt2Pt, 2 for Pt2Pt2Blob, or 3 for Gene...
2a591043461bcf303676535406471634e36e287dbc958d8c1e1804386a9c41bb
MATLAB
24,773
717
function [SpikeLFPCoupling] = bz_GenSpikeLFPCoupling(spikes,LFP,varargin) % SpikeLFPCoupling = GenSpikeLFPCoupling(spikes,LFP) % %INPUT % spikes structure with fields (from bz_getSpikes) % .times % -or- % {Ncells} cell array of spiketimes ...
e64ca91bbc5dc4cf80b3256a7cea1f20cb8f2a6f4658282291bade8a2adc3df8
MATLAB
24,801
626
%% LaBGAScore_cosmomvpa_searchlight_rsa.m % % % *USAGE* % % This script uses functions of % <https://www.cosmomvpa.org/index.html CoSMoMVPA> to % % % # run first-level (i.e. within-subject) representational similarity % analysis comparing behavioral and neural dissimilarity matrices % for conditions of your choice ...
c152f1412b6d52add3175c5c2ea8b58e67f03d3a4b9fcfbe7055cb1f54e36e0f
MATLAB
24,855
505
% pop_headplot() - plot one or more spherically-splined EEG field maps % using a semi-realistic 3-D head model. Requires a % spline file, which is created first if not found. % This may take some time, but does not need to be % done again for this ch...
dc7aa31525c9070388c477dace5de8f3510eea12b3b3a61744799cd9067fa2a2
MATLAB
24,862
682
function DEP = LaBGAScore_dep_map(target, varargin) % % % *USAGE* % % Maps which dependency files a script or function actually reaches, by % parsing it with mtree, resolving every called name against the index % built by LaBGAScore_dep_build_index, and walking the result transitively. % % Two consumers: % % # LaBGASco...
9f647ab70af698023f02532d2720a08bf85fde7fe2954ddfccfc459f620a5b70
MATLAB
24,879
555
% statcond() - compare two or more data conditions statistically using % standard parametric or nonparametric permutation-based ANOVA % (1-way or 2-way) or t-test methods. Parametric testing uses % fcdf() from the Matlab Statistical Toolbox. % Usage: % >> [stats, d...
58724d80a44abd91fc7169c84bdd737bfba9b63094ef90f12f850b4d3ea8157c
MATLAB
24,900
499
function results = ea_discfibers_ui_enablerules(app,flag) app.isbusy(1); if ~isfield(app.tractset.results,ea_conn2connid(app.tractset.connectome)) val='off'; else val=ea_bool2onoff(isfield(app.tractset.results.(ea_conn2connid(app.tractset.connectome)),...
969a8da34e006dfe29ee30b947f11937f39f65c701ea48c0b179bd971dd3614e
MATLAB
24,916
647
function results = PLSDA_neuroimaging_pipeline(X,Y,opts) % PLSDA_neuroimaging_pipeline Robust PLS-DA pipeline for neuroimaging feature matrices. % % This function implements Partial Least Squares Discriminant Analysis (PLS-DA) % for binary classification with repeated nested k-fold cross-validation. % It is designed ...
26f3ab3314b5eb5a81f5a8a03623e776fa279017714265659c4662a68831cf73
MATLAB
24,992
624
function [lh_labels, rh_labels] = CBIG_ArealMSHBM_dMSHBM_generate_individual_parcellation(project_dir, ... mesh, num_sess, num_clusters, subid, w, c, subject_set) % [lh_labels, rh_labels] = CBIG_ArealMSHBM_dMSHBM_generate_individual_parcellation ... % (project_dir, mesh, num_sess, num_clusters, subid, w, c, subjec...
8fc01ba01877994510c5c30efa8bf5d6c1e7d594a3154bf8a129e1150e79c5ff
MATLAB
25,074
699
function varargout = auto_classify(varargin) % AUTO_CLASSIFY M-file for auto_classify.fig % AUTO_CLASSIFY, by itself, creates a new AUTO_CLASSIFY or raises the existing % singleton*. % % H = AUTO_CLASSIFY returns the handle to a new AUTO_CLASSIFY or the handle to % the existing singleton*. % ...
6bdeb7fa5e689f09641ac1a217d20c0f9b634c208e760b31c58daf7778183625
MATLAB
25,155
727
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color if ~contains(path, '/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab') addpath(genpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainSpace-latest/matlab')); end %% ======================= compare...
49484da7e6bd78401db2826712a0467290a5c50b4420f6e08aaf9714bf35b9ad
MATLAB
25,184
641
%% Tutorial for xml_io_tools Package % *By Jarek Tuszynski* % % Package xml_io_tools can read XML files into MATLAB struct and writes % MATLAB data types to XML files with help of simple interface to % MATLAB's xmlwrite and xmlread functions. % % Two function to simplify reading and writing XML files from MAT...
ac31203677d3c8cf8201424965bbd3d9889ee52e903e16e5fc5ed86df950c7ac
MATLAB
25,199
749
function cs_fmri_conseed_seed_tc(dfold,cname,sfile,cmd,writeoutsinglefiles,outputfolder,outputmask) tic % if ~isdeployed % addpath(genpath('/autofs/cluster/nimlab/connectomes/software/lead_dbs')); % addpath('/autofs/cluster/nimlab/connectomes/software/spm12'); % end if ~exist('writeoutsinglefiles','var') ...
b3f7c07f09e78e47501efe16d41cb8cec21b9444313436f4649477c60ee355d9
MATLAB
25,380
538
% pop_runica() - Run an ICA decomposition of an EEG dataset using runica(), % binica(), or another ICA or other linear decomposition. % Usage: % >> OUT_EEG = pop_runica( EEG ); % pops-up a data entry window % >> OUT_EEG = pop_runica( EEG, 'key', 'val' ); % no pop_up % % Graphic interface: % "ICA ...
79699fccf894fe8df6b6cd7f55094f4fcb2f381aec992cfcafe6f20c68e60e0e
MATLAB
25,394
609
% corrimage() - compute correlation image between an event and amplitude % and phase in the time-frequency domain. % % Usage: % corrimage(data, sortvar, times); % [times, freqs, alpha, sigout, limits ] = corrimage(data, sortvar, ... % times, 'key1', val1, 'key2'...
388a3b5e668dca9fe18cb3d93f5194af9cd71deda2ea45e347d406b39c1e0cba
MATLAB
25,498
418
function ClincFreq_HeatNumStat(INDIR,OutHeatdir,SetUpPara,Para,AtlasTempU,dbmask) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; outind = find(dbmask==0); D(outind,:) = 0; Dvol = sum(D)'; Dvole = sum(D,2); IgV = Para.IgP; indexs = find(Dvole>=(size(D,2)*IgV/100)); Dma...
23863c56d0b3645ab541445b70f0da59b494ba663fad17c39ce7b0217d2db1a9
MATLAB
25,562
605
classdef ea_trajectory < handle % Trajectory class to handle trajectories in lead dbs resultfig / 3D Matlab figures % A. Horn properties (SetObservable) elstruct % reconstruction of electrodes as handled by ea_elvis plan2elstruct % reconstruction (pseudo) of stereotactical plan plan...
3f864dc9bf62adfdeaeeda63d239954b4fa376fd073e402da5845a82c30d1874
MATLAB
25,662
665
% tftopo() - Generate a figure showing a selected or representative image (e.g., % an ERSP, ITC or ERP-image) from a supplied set of images, one for each % scalp channel. Then, plot topoplot() scalp maps of value distributions % at specified (time, frequency) image points. Else, ...
c828ce62ba4493d23a4c9f697a5b2df8a246aca2062488bd2e6020691912eddc
MATLAB
25,681
678
%% Figure 5A-C % Prediction-error GC during active task engagement. % Structure: % 1) Compute all data required for Figure 5A-C % 2) Draw Figure 5A, Figure 5B, and Figure 5C % 3) Save one independent MAT file for each final panel % % Notes: % - No local functions. % - No mixed upload MAT files. % - Suppleme...
2f71c0f2d6a36be16a7a6aeaa71af61f8fa3774584484f9078645476d279d638
MATLAB
25,717
669
function results = PLSR_neuroimaging_pipeline(X,Y,opts) % PLSR_neuroimaging_pipeline Robust PLS regression pipeline for neuroimaging feature matrices. % % This function implements Partial Least Squares Regression (PLSR) % for continuous outcomes with repeated nested k-fold cross-validation. % It is designed for neuro...
bb12137b47827e9b34bf2661fad85f591f2e1dc4e8a2cefbf306440f61dc1d24
MATLAB
25,793
656
% pop_editeventvals() - Edit events contained in an EEG dataset structure. % If the dataset is the only input, a window pops up % allowing the user to insert the relevant parameter values. % % Usage: >> EEGOUT = pop_editeventvals( EEG, 'key1', value1, ... % ...
aa4814b1f1b43fae577a57dfe2a4106e1e34adafa6d535458b466bb7c3b629d6
MATLAB
25,961
669
function Params = CBIG_MSHBM_estimate_group_priors(project_dir,mesh,num_sub,num_sess,num_clusters,varargin) % Params = CBIG_MSHBM_estimate_group_priors(project_dir,mesh,num_sub,num_sess,num_clusters,varargin) % % This script will estimate group priors for individual-level parcellation % generation. The estimated group...
b05db17b332d055eb29d08823136f3c0e6473c9c9736ae2347e8e24040428679
MATLAB
25,962
645
classdef ScrollingPanel < uix.Container & uix.mixin.Panel %uix.ScrollingPanel Scrolling panel % % p = uix.ScrollingPanel(p1,v1,p2,v2,...) constructs a scrolling panel % and sets parameter p1 to value v1, etc. % % A scrolling panel is a standard container (uicontainer) that shows % one i...
948f06391ee6fa80231b20d6a6d8b91978b71e70a9449ac4cd0176ac5c7c18ae
MATLAB
26,003
741
function ea_imshowpair(Img, options, title, callingfunction, helptext) % this function is based on IMSHOW3DFULL by Maysam Shahedi and supports % truecolor images. Windowed view is adapted from MAGNIFY by Rick Hindman. % % Todd Herrington, 2016-03-16 if ~exist('callingfunction','var') callingfunction='normalization...
90533b30d742a48308789e6e1c544465df93fc37a4abb1a4ad44fa2e0f9b098d
MATLAB
26,077
535
classdef (CaseInsensitiveProperties = true) functionalSpreadPlot < ... iosr.statistics.functionalPlot %FUNCTIONALSPREADPLOT Draw a functional plot showing data spread % % Use this class to plot the spread of data against a continuous % variable. The class calculates point-wise statistics for each set of % ...
dbf600a672807f69ef13da27db067481b53d36559ad9c785bb1dd92c865cc2f5
MATLAB
26,243
647
function plotSaveConditionalColocDiffMarker(PtOrBlob,plotting, saveRes,pathToSave, varargin) %PLOTSAVECONDITIONALCOLOC plots and/or saves conditional colocalization results % % SYNOPSIS plotSaveConditionalColoc(PtOrBlob,plotting, saveRes, varargin) % %INPUT % PtOrBlob: 1 for plotting Pt2Pt2Pt, 2 for Pt2Pt2Blob, or ...
8434fa3a2f46db263b382bb27e82deef2c6ac929e170aa37553aff14d9fd2093
MATLAB
26,255
718
% miro :: Measured Impulse Response Object % % miro Class Definition % % 2012 by Benjamin Bernschütz (bBrn) % Cologne University of Applied Sciences % Institute of Communication Systems % mail benjamin.bernschuetz@fh-koeln.de % GSM +49 171 4176069 % Phone +49 221 8275 ...
ceb59e9022a6dc2dc2cfa0287eddc7d83190910b486ac6ba05bda35ce3b1a225
MATLAB
26,261
788
function CFA_inout(H) % function CFA_inout movegui(H.fig,'west') pathss = which('CFA_inout.m'); [pth nam ext] = fileparts(pathss); IOsetupdir = [pth,filesep,'IOparameter',filesep]; if ~isempty(dir(IOsetupdir)) rmdir(IOsetupdir,'s') mkdir(IOsetupdir); else mkdir(IOsetupdir); end load([pth,filesep,'colorforl...
1253ffc85615e01782a09a24c950e554e8e8c4ff7f36b8f740159fc0f5eebb41
MATLAB
26,311
411
function [Ihat,Ihat_train_global,val_struct] = ea_compute_unified_model(numTestIt, obj, fibsval, Ihat, Ihat_train_global, patientsel, training, test, Iperm,vals,usedidx) % this needs to be edited when external model is brought back % if obj.useExternalModel == true % S = load(obj.ExternalModelFile); % ...
efb90bd349c6747d06fbbc6839f45cdb691fa9a2cb4020412a7064cb6c0c235e
MATLAB
26,512
439
function h = copyUIAxes(varargin) % The use of Matlab's copyobj() is not supported with UI axes. % use COPYUIAXES to copy the content of a UI axis to a new figure. % COPYUIAXES receives the handle to a UI axes and copies all of its % children and most of its properties to a new axis. If the UI axis % has a legend...
0d9415004ad50f33c4244992a09e3de0cea48fd4349e287d8ee4c3606a72e5f1
MATLAB
26,647
821
function icatb_defaults % All the GIFT toolbox defaults are stored in this file if (isdeployed) gicaInstallDir = getenv('GICA_INSTALL_DIR'); defsFile = fullfile(gicaInstallDir, 'icatb_defaults.m'); if (~isempty(dir(defsFile))) icatb_eval_script(defsFile); return; en...
ffd50aa9a1a34b27815c7b75d924a42111783ac7a3f2dd8c74aa972c49434633
MATLAB
26,685
561
function [status] = ft_hastoolbox(toolbox, autoadd, silent) % FT_HASTOOLBOX tests whether an external toolbox is installed. Optionally % it will try to determine the path to the toolbox and install it % automatically. % % Use as % [status] = ft_hastoolbox(toolbox, autoadd, silent) % % autoadd = 0 means that it will ...
8288e66c14d5939d259d6ce630df82950f105b1692851a3b81e5983b77c8878f
MATLAB
26,717
536
function [M_final,shifts,template,options,col_shift] = normcorre(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a 3D % ...
a846124d5d8b20de1b652801be73a83cdad96d00a907f504074b6e480a98de48
MATLAB
26,905
998
function [Results, Summary] = calcium_data_PrL_SB_struct_clean_WTdownsample60( ... mouse_number, session_frame, matfilepath, corr_threshold, matfile, ... neuron_chosen_signal, group_label, nRepeats, frac_keep, useParallel) % Structured version of calcium_data_PrL_SB with repeated WT downsampling % % Main change...
88b19176bdd93b056e4438418efce6f9349bcdcff67443aaf3e49405e5a18b64
MATLAB
26,930
555
%% Visualize individual responses upon stimulus presentation % Choose a stage and plot the stage progression close all; clearvars; clc; % Make the user pick the two "ResponsePattern" mat files to compare scriptFullPath = matlab.desktop.editor.getActiveFilename(); try load(regexprep(scriptFullPath, 'Scripts.*', 'Scripts...
eeb1a49b1240d40b58f94664d385eea27b1d75b54ffc29293cd987b04855c9ab
MATLAB
26,943
720
function [norm] = electroderealign(cfg); % ELECTRODEREALIGN rotates and translates electrode positions to % template electrode positions or towards the head surface. It can % either perform a rigid body transformation, in which only the % coordinate system is changed, or it can apply additional deformations % to the i...
b6c9abdeb01e27a1f9dfd4cbabc4691d66123d7449785050139b4e1b09b529cb
MATLAB
27,008
503
% std_preclust() - select measures to be included in computation of a preclustering array. % This array is used by pop_clust() to find component clusters from a % specified parent cluster. % Selected measures (dipole location, ERPs, spectra, scalp maps, ERSPs, % ...
50f7b20f4363546d66f3614a48f077c7f5ac4c8daa3886b77b71465784dc20b4
MATLAB
27,014
531
function [M_final,shifts,template,options,col_shift] = normcorre(Y,options,template) % online motion correction through DFT subpixel registration % Based on the dftregistration.m function from Manuel Guizar and Jim Fienup % INPUTS % Y: Input data, can be already loaded in memory as a 3D % ...
1aa598af099adf7f787b669d2f3059e9c07054a8586cce7bbdfe9cde59429a17
MATLAB
27,050
570
% pop_newset() - Edit/save EEG dataset structure information. % % Usage: % >> [ALLEEG EEG CURRENTSET] = pop_newset( ALLEEG, EEG, CURRENTSET,... % 'key', val,...); % Inputs and outputs: % ALLEEG - array of EEG dataset structures % EEG - current dataset structur...
4e1b60b9d87834a108029026814fac94ef0d980c2926c83182f641349645cfc1
MATLAB
27,105
818
function varargout = ea_cat_run(job) % Segment a bunch of images % ______________________________________________________________________ % % FORMAT cat_run(job) % % job.channel(n).vols{m} % job.channel(n).biasreg % job.channel(n).biasfwhm % job.channel(n).write % job.tissue(k).tpm % job.tissue(k).ngaus %...
a2594804643d2a127bceab77ee6929619330d938709780a7edbffb0d711d3b7d
MATLAB
27,155
582
% std_dipplot() - Commandline function to plot cluster component dipoles. Dipoles for each % named cluster is displayed in a separate figure. To view all the clustered % components in the STUDY on the same figure (in a separate subplot), all % STUDY clusters must be req...
ee4c9415053eba4d637bd37d46b65beeaa3c724df5d4c660c4c2ba48c0eb71b2
MATLAB
27,200
832
%lets start easy - just get all the responsive ones and plot the average %directional response load('/Volumes/Samsung_T5 1/2-photon imaging/vt062617/incides.mat') load('/Volumes/Samsung_T5/2-photon imaging/vt062617/incides.mat') cd ../../../../../../../Volumes/'Samsung_T5 1'/'2-photon imaging'/vt062617 cd ../../../../....
cdefe70bc37a88a187643a635c555416bc11046e0687b6877c0ec4b60b364b49
MATLAB
27,340
546
% std_readersp() - load ERSP measures for data channels or for all % components of a specified cluster. This function is % also being used to read ITC and ERPimage data. % Usage: % >> [STUDY, erspdata, times, freqs, erspbase] = ... % std_readersp(STUDY, ALLEEG, v...
c006ec3e944891b85a2b9d43dbed494b80668e2e7a7d33485c95a5904088caf3
MATLAB
27,487
720
% ==================================== %% Help % ==================================== % % CBIG_test_MSHBM_esfmri_homo % % This script tests the MS-HBM model on the electrostimulation fMRI % (esfMRI) dataset using leave-one-run-out cross-validation. Two % independent homogeneity tests are performed: % % (1) Pre-op res...
bd00c4d807c26499bfb28ab15ef3de44fc21668df7517f96745cc0c6d882ed5c
MATLAB
27,501
556
%% TestElectrodes - Class representing a Ben's Gun configuration of Test Electrodes (up to rotation!) % note that the precise rotation depends on the kinematics of the % sterotactic frame/the micro drive device % % Andreas Husch % Centre Hospitalier de Luxembourg, Dep. of Neurosurgery / % University of Luxembourg - Lux...
7a86396216ddca750dadfc2545c8bc7f667d3e2418538df0d17d2b298f6ba9fb
MATLAB
27,521
754
function varargout = FAnalyze(varargin) % FANALYZE % For all your trajectory analysis needs! . See documentation for usage details. %Written by Dan Valente %November 2007 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton...
3d832fc3998aa827a9643f5a41f974717f98cf5776fa0e62c43fbac87cf9a1e1
MATLAB
27,582
509
% pop_chanplot() - graphic user interface (GUI)-based function with plotting % options for visualizing. Only channel measures (e.g., spectra, % ERPs, ERSPs, ITCs) that have been computed and saved in the study EEG % datasets can be visualized. These can be computed using ...
e058a4d68aeb62b9ec9451ce386004f7a6e1aee3a6f4d0012220d82d028dd954
MATLAB
27,634
651
% eeg_context() - returns (in output 'delays') a matrix giving, for each event of specified % ("target") type(s), the latency (in ms) to the Nth preceding and/or following % urevents (if any) of specified ("neighbor") type(s). Return the target event % and urevent numbe...
e7dbb70c09cd2b4056f08407b6be5f3f3a16c7a852d8089b4b9f438639b20574
MATLAB
27,719
880
%% Cosine dissimilarity + BOLD dissimilarity vs stimulus position clear; clc; loadparam; % Create ensemble of 200 stimulus positions num_samples = 200; % Set seed rng(1, "twister"); stim_array = topology.L * rand(2, num_samples); % tolerance for bold calculation tol = 1e-5; % Record total length used and times to ...