sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
ccd71e9d43b7312ffd4fa17a2ca78d0ce5ee9fd1817e1f9b8239431e66782c31
MATLAB
19,496
458
function [tree, RootName, DOMnode] = xml_read(xmlfile, Pref) %XML_READ reads xml files and converts them into Matlab's struct tree. % % DESCRIPTION % tree = xml_read(xmlfile) reads 'xmlfile' into data structure 'tree' % % tree = xml_read(xmlfile, Pref) reads 'xmlfile' into data structure 'tree' % according to yo...
2315cd8516a75aadb937ce2cc62ba0021f39b0919dad02d4bfe364790dd513ef
MATLAB
19,504
447
function [label, tau] = CBIG_hMRF_find_and_fix_lost_parcels(label, avg_mesh, lh_mask, rh_mask,... full_corr_mat, tau, params) % [label, tau] = CBIG_hMRF_find_and_fix_lost_parcels(label, avg_mesh, lh_mask, rh_mask, full_corr_mat, tau, params) % % This function processes lost parcels given a set of parcellation labe...
42669bf037d4fe0b267424bda760fff4bddce93c9b88d90029ceb92ece70ceed
MATLAB
19,525
436
function [dist_from_hyperplane, Y, svm_dist_pos_neg, svm_dist_pos_neg_matrix] = plugin_oofmridataobj_svm_contrasts_get_results_per_subject(DAT, svm_stats_results, DATA_OBJ) % [dist_from_hyperplane, Y, svm_dist_pos_neg, svm_dist_pos_neg_matrix] = plugin_svm_contrasts_get_results_per_subject(DAT, svm_stats_results, DATA_...
248a8a377aa31e875f2d70735c890d3423258f695cf06aa673009c0204d7f254
MATLAB
19,532
511
function [map,num,typ,scheme] = brewermap(N,scheme) %#ok<*ISMAT> % The complete selection of ColorBrewer colorschemes/palettes (RGB colormaps). % % (c) 2014-2022 Stephen Cobeldick % % Returns any RGB colormap from the ColorBrewer colorschemes, especially % intended for mapping and plots with attractive, distinguishable...
e401dc8874e9874f99273e6e5629d050df1e88e92e1e526b11a6da2fe8b3b9a7
MATLAB
19,538
373
function in = LeG_intriangulation(vertices,faces,testp,heavytest) % intriangulation: Test points in 3d wether inside or outside a (closed) triangulation % usage: in = intriangulation(vertices,faces,testp,heavytest) % % arguments: (input) % vertices - points in 3d as matrix with three columns % % faces -...
7a5fa230d9123a42aed1f7e2cf3e30019f9fbeba91b9e082f0a6e16507dfba59
MATLAB
19,564
419
%% prep_1b_prep_behavioral_data.m % % % *USAGE* % % This optional script attaches behavioral/non-imaging data to the DAT % structure defined by prep_1_set_conditions_contrasts_colors.m. It % % # calls a_set_up_paths_always_run_first, then loads DAT from % image_names_and_setup.mat if not already in the workspace (fal...
ae3ef76b8cc652f1da9e23f5840175ccbb0b7e8bb7a804a6eef0358282912fd5
MATLAB
19,572
552
function ROI_table = plot_PLSDA_diagnostics_neuroimaging(results, XL, roiNames, atlasFile, varargin) % plot_PLSDA_diagnostics_neuroimaging Plot and diagnose PLS-DA neuroimaging results (ROI/parcellation). % % This function provides generic visualization and diagnostics for PLS-DA % results produced by PLSDA_neuroimagi...
d2b44665e5e7bb8f1dc085cad157480a4907619b181241ca7659271a4b082fd4
MATLAB
19,574
411
%% LaBGAScore_prep_s1_write_events_tsv.m % % % *USAGE* % % This script reads logfiles, extracts the onsets, durations, and ratings for % different conditions, and writes events.tsv files to the BIDS dir for % each subject. It also contains an option to write a single phenotype file % with trial-by-trial ratings for all...
941b210a64784f6bc2a4c2030b1d81bc78c02b6a0cd1381f95b27dc84db02b11
MATLAB
19,600
632
function outdata=specscope(indata) % record and plot audio spectrogram % % Usage: outdata=specscope(indata) % % Input: indata (optional) % Displays a recorded piece of data, if an argument is passed % Otherwise displays audio data from an attached microphone % % Output: outdata (optional) % If pres...
fc06e402dbbdd8655aa44101d790fb2c024f89046ed3b0363baaf2d78b420e4b
MATLAB
19,642
591
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...
53e2e71398c68118616d2c52e98a439735fe57f92c838606fdff4081eaf9c809
MATLAB
19,648
395
% std_erspplot() - plot STUDY cluster ERSPs. Displays either mean cluster ERSPs, % or else all cluster component ERSPs plus the mean cluster % ERSP in one figure per condition. The ERSPs can be plotted % only if component ERSPs were computed and saved in the % ...
83e8fa5c52f33ef8966d6a9ef5d4dddbbd9ac25a3bb8d7ebda3c1cc5ddb85575
MATLAB
19,658
529
function SANDIinput = setup_and_run_model_training_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) % Cardiff Univers...
b0d062034ed82ef2f527da9d8ed26a20078d47d414826b21935a64961604b8dd
MATLAB
19,662
655
function varargout = FTrack(varargin) % FTRACK % For all your fly-tracking needs! . See documentation for usage details. % Last Modified by GUIDE v2.5 26-Nov-2007 18:07:29 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleto...
521421faefed5a996d3b05c77c90efd460277245594593bd91a43148b54fb2ed
MATLAB
19,677
664
function outdata=specscopepp(indata) global acq; h=hamming(5); mins=5e-008; maxs=1e-004; % record and plot audio spectrogram % % Usage: outdata=specscope(indata) % % Input: indata (optional) % Displays a recorded piece of data, if an argument is passed % Otherwise displays audio data from an attached micropho...
a78ee8ad0ef6385affd5d04af9b7bcdc4d4983ac6fbd0bc52b0a7c5d3ce66386
MATLAB
19,683
580
% Save back to the original image with a portion of slices that was % loaded by "load_untouch_nii". You can process those slices matrix % in any way, as long as their dimension is not altered. % % Usage: save_untouch_slice(slice, filename, ... % slice_idx, [img_idx], [dim5_idx], [dim6_idx], [dim7_idx]) % % slice ...
a23debefad7ed7144b8892cbedc7ff2980840ffc452dfb61a67fb3721bd641d2
MATLAB
19,757
566
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...
e6928cb105ab89161e168e20e1730e70712e94f7a872001f6e5f31ce71406bfa
MATLAB
19,793
470
classdef KTNSPOnline % UEAMAPFILE -- Defines a class that contains information on a UEA % electrode array using CMP files provided by Blackrock Microsystems. % % To load a CMP file type 'MapName = UEAMapFile' where MapName is the name % of the variable that will be created and will contain the map class. % % E...
823ff7fdbde6c944e49828f6f428eb5a0beabe1ff70375c197b2d2406190e98b
MATLAB
19,797
635
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 %% ======================= step 1 ...
96eb04a0dae7e714738e6b612cfc58c64a058123fd95b1e58c0ee54e175b6cea
MATLAB
19,813
444
%% prep_3f_create_fmri_data_single_trial_object.m % % % *USAGE* % % This script creates and saves an fmri_data_st object from the single-trial % con images written to rootdir/firstlevel/model_x_yyy/sub-zz by % LaBGAScore_firstlevel_s2_fit_model.m. It % % # loads DSGN/DAT if not already in the workspace, and excludes su...
9d76672e004b3547ccc2c433a4c4f636d835af5b17c463ced4b684f850919cc5
MATLAB
19,877
467
classdef GridFlex < uix.Grid & uix.mixin.Flex %uix.GridFlex Flexible grid % % b = uix.GridFlex(p1,v1,p2,v2,...) constructs a flexible grid and % sets parameter p1 to value v1, etc. % % A grid lays out contents from top to bottom and left to right. % Users can resize contents by dragging...
fc665dc1ede16e5caab0472854d92cc50a4cfc11f173ef9cbb6ea25d1ef24347
MATLAB
19,894
556
%%% Supplementary Figure 5 % Structure: % 1) Compute all data for Supplementary Figure 5A-C % 2) Plot all panels % 3) Save independent Zenodo MAT files for each final panel % % No local functions. ccc; %% Paths % Supplementary Figure 5A-B: 400-ms ISI example, monkey C, nSTD = 9 SINGLEPATHs = dir("..\MAT Data\gr...
d38dda3c9bd96cea59e1eb976ebdf64547f3bd1b69cf25cd1b8c90bd4750ba42
MATLAB
19,915
373
function [refinedTrack, measurements, cntTrackOutput] = basicTransientTrackCrop(transDiffAnalysisRes, decompTrack) %BASICTRANSIENTTRACKCROP splits decompTrack into tracklets/segments based on DC-MSS analysis & chop tracks in half if track duration is too long; and tally out tracks information/analysis in a matrix forma...
e944f80441253c5c4123003a4b056550e8135bf5e70d6a792f5ce5718a6373ec
MATLAB
19,926
631
function [gridness, props] = Gridness(self, cel, varargin) % Calculates the original gridness score of 'cel'. Continuizes all epochs. % % ARGUMENTS % % cel 1x2 vector indicating tetrode index and cell index % % RETURNS % % gridness a number indicating gridness score % props struct of...
4f83569cb27638d59219cd6e612dc0753d5f24b46413a9dd04ff65db03047c11
MATLAB
19,936
555
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 (...
07ca4fea07addb59f5d9eb9673318a7ded2430fe3fdb505c11714621509fb009
MATLAB
19,952
464
function newdata=jdatadecode(data,varargin) % % newdata=jdatadecode(data,opt,...) % % Convert all JData object (in the form of a struct array) into an array % (accepts JData objects loaded from either loadjson/loadubjson or % jsondecode for MATLAB R2016b or later) % % This function implements the JData Specification D...
5aa60beaa992d29e7cb669fb936bad826d4423030b909b08535f45bfd3aa4acc
MATLAB
19,956
471
function ea_normalize_fibers(options) % Normalize fiber to MNI space vizz=1; % turn this value to 1 to visualize fiber normalization (option for debugging only, this will drastically slow down the process). cleanse_fibers=0; % deletes everything outside the white matter of the template. directory=[options.root,options...
b5ff46c302aa95cabbd7f50b20abf4293021dcb1c93bb5efb4b39897b380be91
MATLAB
19,968
536
% crossf() - Returns estimates and plot of event-related coherence (ERC) changes % between data from two input channels. The lower panel gives the % coherent phase difference between the processes. In this panel, for Ex. % -90 degrees (blue) means xdata leads ydata by a quarter cycle...
2c19aa4f31a067f193c7158308c8072aed3304149cb702d49f5a8b60a3420be1
MATLAB
19,972
532
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...
9857494bef7584787071a19b787c9642acbfde8608d8b71ac5fed78c49d07695
MATLAB
19,986
611
function dimord = getdimord(data, field, varargin) % GETDIMORD % % Use as % dimord = getdimord(data, field) % % See also GETDIMSIZ, GETDATFIELD if ~isfield(data, field) && isfield(data, 'avg') && isfield(data.avg, field) field = ['avg.' field]; elseif ~isfield(data, field) && isfield(data, 'trial') && isfield(dat...
0d50d8eccc8016bc062223099c1e62ae3d71be28984dcc813e7c2271e558d05b
MATLAB
19,997
474
function [ likelihood, results] = CBIG_gwMRF_graph_cut_clustering_split_newkappa(x,prams,hemisphere) % This function performs the actual clustering % % Input % - x = input timeseries % - prams = a struct containing various input parameters % - hemisphere = a string indicating the hemisphe...
825eb567122bfd553bd644ee651264c351f70a6bda61c4887d8f8a6352669d52
MATLAB
20,001
371
% pop_dipfit_settings() - select global settings for dipole fitting through a pop up window % % Usage: % >> OUTEEG = pop_dipfit_settings ( INEEG ); % pop up window % >> OUTEEG = pop_dipfit_settings ( INEEG, 'key1', 'val1', 'key2', 'val2' ... ) % % Inputs: % INEEG input dataset % % Optional inputs: % 'hdmfile' ...
954e6f6b0ed2e290c1a610d20dc95b43808750fb22411c98526045468e104007
MATLAB
20,016
519
function colocalMeasure = condColocGeneral(refInfo,tarInfo,condInfo,cellMask,... distThreshToColocWithCond, colocDistThresh,numTarRefRand,numCondRand) %CONDCOLOCGENERAL measure colocalization among three channels with segmented and/or detected objects % %SYNOPSIS colocalMeasure = condColocG...
dc1b63de25212596b26d691ca0739226568807553a3337ea178a81344e55f1ae
MATLAB
20,027
450
function plottrials_flex(data, savepath, which_trials, dff_yaxis, dff_coloraxis, add2txt, print_flag, file_type) % if which_trials is blank, plot all trials % dff axes are 2 element vectors of lower and upper boundries (if empty: dff_yaxis = [-.1 .8], dff_coloraxis = [0 0.4]; % add2txt goes into title and filename (wit...
62488f23d158863cb674a2f3d53bf2932dd74bff0d43c24dd0cb4d5f41782317
MATLAB
20,036
521
function obj=redraw(obj,spacing,display) % redraw Optimize location and size of axes in figure after resizing % % Syntax: gramm_object.redraw(spacing,display) % spacing is an optional argument that indicates how far apart % the elements should be. It is expressed in normalized units % of the figure's smallest dimension...
3c844ec8ff901ba0040c1c25dd559165be0a1bfbd0a8d754f6824ab02b6f8011
MATLAB
20,127
569
% plotdata() - plot concatenated multichannel data epochs in two-column format % % Usage: >> plotdata(data) % >> plotdata(data,frames) % >> plotdata(data,frames,limits,title,channames,colors,rtitle,ydir) % % Necessary input: % data = data consisting of consecutive epochs of (chans,frames) ...
871d7f44110649aff093ce2e999260d214e02133a450c375a738e54f90fcd352
MATLAB
20,181
487
% configure file for operations on streamline trackings results % % for BATCH EDITOR system (Volkmar Glauche) % % File created by Susanne Schnell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function ftrop = dti_cfg_ftrop % --------------------------------------------------------------...
66d72db0427735897fb999dcc1af138e083dfcefa984f247ef1b12b76101a34e
MATLAB
20,184
643
function [data, timestamps, info] = load_open_ephys_data(filename,varargin) % % [data, timestamps, info] = load_open_ephys_data(filename) % [data, timestamps, info] = load_open_ephys_data(filename,'Indices',ind) % % Loads continuous, event, or spike data files into Matlab. % % Inputs: % % filename: path to file...
36d89ea31d47799f7d1354bd91775ac316f4b576e7a817d5b97fcffe71777932
MATLAB
20,239
632
function solve( prob ) global cvx___ p = prob.index_; pr = cvx___.problems( p ); quiet = pr.quiet; obj = pr.objective; gobj = pr.geometric; prec = pr.precision; solv = pr.solver; ndual = ~isempty( pr.duals ); shim = cvx___.solvers.list( solv.index ); if isempty(shim.eargs), eargs = {}; else eargs = shim.e...
d60ee40f3628d04dac996c7b397f0e409614d1c90fd84c1ab6b9b50f61dafd87
MATLAB
20,271
546
function [ results ] = plot_phase_precession( self, varargin ) %PLOT_PHASE_PRECESSION Makes the phase precession plot % % ARGUMENTS % % OPTIONAL ARGUMENTS % cel 1 x 2 vector like [tetrode index, cell index]. If % unassigned, uses self.cel. % lfp Scalar integer that coresponds to which EEG...
aa16385d9f9781bd25f6e03f8968381c115a9345317876ff2301a4ab01100960
MATLAB
20,276
531
%% 3-D volume visualization %% About volume visualisation % % Creating 3-D renderings of brain data and results can help localize brain % activity and show patterns in a way that allows meaningful comparisons % across studies. % % The CANlab object-oriented tools have methods built in for rendering % volume data on br...
4e106d99c4402fa901fd3ba1b3a1ffe54e246aee55a9d6408c3ea7c101446ea7
MATLAB
20,310
421
% pop_importepoch() - Export epoch and/or epoch event information to the event % structure array of an EEG dataset. If the dataset is % the only input, a window pops up to ask for the relevant % parameter values. % Usage: % >> EEGOUT = pop_importepoch( EE...
4d4e5eabc5bf91d60251378c1f40d0ebcc0df8f2852e945b6b60540fc6683045
MATLAB
20,312
492
%% Script for the analysis of MINFLUX signals from DNA-Paint labelled ALFA-tagged PIEZO1 % Dependencies: DBSCAN.m; % SetALFAanalysisParameters.m, PlotRawData.m; PIEZO1Superparticle; % PlotTrimerAnalysisResult.m; CalcTrimerAngle1.m clear all; close all; Exclude = []; %% %%%%%%%%%%...
ae926529506d4946730ef1d88e9228cc41836500ae8f3a1934cd1d499ea0bc62
MATLAB
20,317
655
function varargout = FTrack(varargin) % FTRACK % For all your fly-tracking needs! . See documentation for usage details. % Last Modified by GUIDE v2.5 26-Nov-2007 18:07:29 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui...
baf204d3b99e1b7df8305dc4275beffa6c3bd17f54fb69ddcbaef1f640ffce97
MATLAB
20,341
664
function outdata=specscopepp(indata) global acq; h=hamming(5); mins=5e-008; maxs=1e-004; % record and plot audio spectrogram % % Usage: outdata=specscope(indata) % % Input: indata (optional) % Displays a recorded piece of data, if an argument is passed % Otherwise displays audio data from an att...
893254654953cd8e76556cafacdcafc361b963335fc425206a5cf407d0723a84
MATLAB
20,429
485
%% DATA2STATES - converts raw data to states % Converts raw data to states as pre-processing for information theoretic % analyses as implemented in instinfo. % % Syntax: [StatesRaster,MethodResults] = data2states(DataRaster, MethodAssign) % % Input: % DataRaster (cell array or double array) - trial data. If a double...
494ad9700b25e2878a0c30877beb3314359fdb37d969dcac2729fdc553ed3461
MATLAB
20,442
615
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...
371c04a41e6a9c20613e824d8aff1473629e55c8d54b0ac15e0b6e75fc472463
MATLAB
20,477
476
%% Compares multiple sessions based on the contour maps of burst and tonic scatter maps % Necessary to run the ApertureResponseTypes.m script for the respective % stages first. close all; clearvars; clc; % Define areas to plot area_names = {'BC','VPM','POm','ZIv'}; area_colors = {'#377eb8','#4daf4a','#984ea3','#ff7f00...
36da3106a9506f23db66ba4cd37eaeacc18a25598a194dd0bf7bcc4af573acd3
MATLAB
20,505
409
% teststat - EEGLAB statistical testing function % % Statistics are critical for inference testing in Science. It is thus % primordial to make sure than all the statistics implemented are % robust and at least bug free. Statistical function using complex % formulas are inherently prone to bugs. EEGLAB functions are a...
0834e4d03469d64d981c46bca382cbec2fc2d7c9b6593b2f75073dea7e706dfa
MATLAB
20,515
501
function varargout = ea_imageclassifier(varargin) % EA_IMAGECLASSIFIER MATLAB code for ea_imageclassifier.fig % EA_IMAGECLASSIFIER, by itself, creates a new EA_IMAGECLASSIFIER or raises the existing % singleton*. % % H = EA_IMAGECLASSIFIER returns the handle to a new EA_IMAGECLASSIFIER or the handle to %...
eff2106537ae51d94b66eab21ba445724a2352c1b0637077506fdb023a1ee39a
MATLAB
20,553
437
% std_ersp() - Compute ERSP and/or ITC transforms for ICA components % or data channels of a dataset. Save results into Matlab % float files. % % Function description: % The function computes the mean ERSP or ITC for the selected % dataset ICA components or data c...
a9c4ef6e55b0ae539395fe6e485fbf907e9b68f9a4c3131d6be0e71d2b73bb69
MATLAB
20,563
490
function [XYZ_dest_mm, XYZ_dest_vx] = ea_map_coords(varargin) % Coordinates mapping, support SPM, ANTs and FSL linear and non-linear % transformation. % % Please use this function for any point transform within the Lead Suite % environment. It should automatically detect whether to use ANTs, SPM or % FSL based transfor...
87aaecf901995369ce7bad190443f3fd45fc8eac96668e8c6cf00bba0ed69741
MATLAB
20,583
454
function [sens] = ft_datatype_sens(sens, varargin) % FT_DATATYPE_SENS describes the FieldTrip structure that represents % an EEG, ECoG, or MEG sensor array. This structure is commonly called % "elec" for EEG and "grad" for MEG, or more general "sens" for either % one. % % The structure for MEG gradiometers and/or magn...
e008b34628ce3f5451226a1c8d2579aafffb0ee7c1cfc1a5975d457474fccf03
MATLAB
20,721
353
function ExtClustInfo_CWL(CWLclusterDir,C,j,Dmasked,OWLDir) % save([OWLclus{i},filesep,'Piece',sprintf('%05d',iseg),'.mat'],... % 'Pval_media_perm','Pval_mean_perm','Pval_std_perm','segind3','iseg','DATIND','V','Dmasked'); piecedir = [CWLclusterDir,filesep,'Group',sprintf('%03d',C(j,1)),'vsGroup',sprintf('%03d',C(j...
773559e9b2fb793fbd30a625f1becdb6e72d10bb7101624d7b3606f929ea6607
MATLAB
20,825
497
% bootstat() - accumulate surrogate data to assess significance by permutation of some % measure of two input variables. % % If 'distfit','on', fits the psd with a 4th-order polynomial using the % data kurtosis, as in Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., % ...
1a003515869c71ffb1b8ec68cc84435cc5276dad51509c950272c8290dee0f6a
MATLAB
20,859
431
%% Single Cell Reactivity % Split cells into groups of aperture responding units % Reponses can either be single-targeted ("wide" or "narrow"), "both" or % "none" % Define animal individuals to analyze close all clearvars clc spontWindow = [-0.6,-0.4]; % spontaneous window in sec (default: [-0.6,-0.4]) respWindow = ...
889c83f7466d2cf894b9576baf13d059cdcd7a47dbf09a34a0389fbc49edd3ca
MATLAB
20,908
601
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...
f3f2351d509efc10314d69c63e082fc7b9a6f94ef40e3861f4bcaa356792d682
MATLAB
20,942
502
function ea_autocoord(options) % This function is the main function of LEAD-DBS. It will generate a % vector of coordinates. % Trajectory{1} will be the right trajectory, trajectory{2} the % left one. % For each hemisphere of the brain, this function will call the % reconstruction routine ea_autocoord_side and lateron ...
e39f52d876f5f623512c53f8347785dad7f053224f46c1b80d763b78373f2482
MATLAB
20,955
414
% std_erpplot() - Command line function to plot STUDY cluster component ERPs. Either % displays grand mean ERPs for all requested clusters in the same figure, % with ERPs for different conditions (if any) plotted in different colors. % Else, displays ERP for each speci...
1180c70e489b9bdddaee2db6a1fe7045c431089ff0f96f303b76306b0f432b72
MATLAB
20,959
430
%% c2h_run_multivariate_mediation.m % % % *USAGE* % % Single-level multivariate mediation (PDM) on second-level CONTRAST images: % does a multivariate brain pattern mediate the effect of a between-person % treatment X on a between-person outcome Y? % % X group (one value per subject), from DAT.BETWEENPERSON.group %...
9f247108bda599017a869f02bd88fe4f46176ef72d2f7e59e520fcec3b07b50d
MATLAB
20,974
663
function [baseline, decline] = CBIG_hypoTest_4t(stats) % [baseline, decline] = CBIG_hypoTest_4t(stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md beta = stats.Bhat; betaCov = stats.CovBhat; baseline = zeros(18, 3); decline = zeros(18, 3); %% ------------...
874c037c02d5cb2fab6a126164579781b5aa478f9757735cdbeae14d99161597
MATLAB
20,993
542
function [cuts,expslice,boundboxmm,allcontour]=ea_writeplanes(varargin) % This function exports slice views of all electrode contacts reconstructed % priorly. Images are written as .png image files. Bot transversal and % coronal views are being exported. Additionally, overlays from atlas-data % can be visualized via t...
1914ed9ac0dfd636f62798fdaa79bf6bcd5ff40765510a0e16e0e431dafafd72
MATLAB
20,997
391
classdef generalization_DS < handle % This datasource object (DS) allows one to train a classifier on a specific % set of labels, and then test the classifier on a different set of % labels - which enables one to evaluate how similar neural representations % are across different but related conditions (i.e....
b35103ffd0252a725af4d93ebf94b6f1df4263f6679bc4f53ca2301e6cfc7707
MATLAB
21,034
614
%% PrL behavior-conditioned calcium AUC for Poking 1, Poking 2, and Others % Uses the same denoise / normalization / real-neuron selection rule as % calcium_data_PrL_SB_struct_clean.m, but DOES NOT delete the first 10 frames. % % Outputs: % 1) Per-SB behavior-conditioned calcium AUC % 2) Whole AUC across SB1-SB5 fo...
96e95181f7b7fb3b7050ea4a9f1373ab6d47fdb4213ad97024c3cea16c75a430
MATLAB
21,059
307
function HispeedTrials = getWhiskerContactsApertures(sessionDir) configPath = 'C:\Users\Groh\DLC-Modules\Whiskertrack_Apertures-Heimburg-2021-11-11\config.yaml'; %% Grab the DLC (filtered) csv file with the bodyparts videoDir = fullfile(sessionDir,'videos'); HispeedTrials = assignTrialsToVideos(videoDir); try py...
e2a5a496f3a23dd6722ff56cc12d717e0c9c7cf85fcf059d3f33e573fc3ebaa4
MATLAB
21,074
529
% supergui() - a comprehensive gui automatic builder. This function help % to create GUI very fast without bothering about the % positions of the elements. After creating a geometry, % elements just place themselves into the predefined % locations. It is especially...
5e8c7436e43717954d02606419f7a86d36fccc7416b1bf55b971a424561d302c
MATLAB
21,082
663
function [baseline, decline] = CBIG_hypoTest_4t(stats) % [baseline, decline] = CBIG_hypoTest_4t(stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md beta = stats.Bhat; betaCov = stats.CovBhat; baseline = zeros(18, 3); decline = zeros(18, 3); %% ------------...
2f5a2749cd00555d111b4199008c6b9410eeb836756c0c93d4c3b079ba2e58d8
MATLAB
21,130
504
%% Linear Mixed Model demo %% % This demonstration was prepared by Bogdan Petre and Tor Wager % % It includes code to perform a mixed-effects analysis on a dataset % in both Matlab and R. The published version runs the Matlab code. % % To reproduce the analysis, you must have the dataset, which is in the % |CANlab_h...
db08ff8d30120f0b3abdcf1af704f50b940620b2fbf295ddfae628bfa588dc29
MATLAB
21,135
422
function varargout = palm_help(varargin) % Shows a help text. Call palm_help('logo') to show just the logo. % _____________________________________ % Anderson M. Winkler % FMRIB / Univ. of Oxford % Mar/2014 % http://brainder.org % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % PALM -- Permut...
cd89ac8337d2e74f69cf3ee036fd82a507d163be72506a8afd992c6d776fa1b4
MATLAB
21,153
478
% AnalysisBatchScript.m % This scritp runs preliminary descriptive analysis to get a summary overview % of the session. It is called by expPipeline and require output variables % generated by that fucntion. % List of analysis to perform % 1. Spike-waveform, autocorrelogram and spatial position % 2. Psth from ana...
b899f86b4d6de15473f484e1701f22a4cf8fab8e0c90e1e06c017744d4d7531f
MATLAB
21,201
584
function ea_imshow3d(nii) % % This function displays a NifTi image. % % SYNTAX: % imshow3d('anat_t1.nii') % imshow3d('Users/user/Images/anat_t1.nii') % imshow3d(anat_t1) % imshow3d(anat_t1.img) % % Example1: % nii = load_nii('t1.nii') % imshow3d(nii) % % Example2: % anat_t1 =...
acd207ac78077f86314915672b24d05008dcab23ba4ec825f09d820a180d7009
MATLAB
21,279
546
% ==================================== %% Help % ==================================== % % CBIG_supp_fig5_model_compare % % This script replicates Supplementary Figure 5: FC homogeneity and % inhomogeneity of the NIH individual-specific networks as a function of % the number of training subjects used to train MS-HBM (5,...
38efd168607aa9ecc9b89c8ca5743563fe110f779f38cb3268813a4d56b2f033
MATLAB
21,303
425
% pop_precomp() - precompute measures (spectrum, ERP, ERSP) for a collection of data % channels. Calls std_precomp(). % Usage: % >> [STUDY, ALLEEG] = pop_precomp(STUDY, ALLEEG); % pop up interactive window % Inputs: % STUDY - STUDY set structure containing (loaded) EEG datas...
00eebed8c5bf1045fbf26b90799afabd6678d922818f2221bcdb32efef6992c6
MATLAB
21,312
673
% topoimage() - plot concatenated multichannel time/frequency images % in a topographic format % Uses a channel location file with the same format as topoplot() % or else plots data on a rectangular grid of axes. % Click on individual images to examine separatel...
60530f7d991b005aaf13e9d60b7900739fa90c8421206365b65ce264c03155e3
MATLAB
21,344
442
function SessionMetadata = bz_SessionMetadataTextTemplate(basepath) % This .m file is a generic template and will be copied to session % folders/session folders and will be called basename_SessionMetadataText.m. % It is represents code that will be used to % create a basename.SessionMetadata.mat file. Edits here will ...
d783685dc55b3687d3e4ba28871a0ea059223b6b47d0aaa23972e499ea280b92
MATLAB
21,347
516
function [] = normCorreTifROIgui(moCorreImg) %draw ROIs on concatenated motion corrected image data sROI.img = moCorreImg; sROI.nFrames = size(moCorreImg,3); sROI.imgHeight = size(moCorreImg,1); %this will be the main figure for drawing ROI ui.roiGUI.fh = figure('Name','Choose frame and draw ROI','Visible','o...
a1a1f8956aeef8ecb9dbf16b7819f1115f02f8d18c8470f9a4a13962db4c7ec4
MATLAB
21,503
430
%% LaBGAScore_prep_parrec2bids.m % % % *USAGE* % % This script converts Philips PARREC files to Nifti files and names and % organizes them according to BIDS specification. % % Script should be run from the root directory of the superdataset, in this % example case /data/proj_bitter-reward, and assumes that % 1. the sou...
ecb4bca8b9762a1849923536694f418b6cea9e6240959244e9ec629925d366f5
MATLAB
21,604
552
function data = loadjson(fname,varargin) % % data=loadjson(fname,opt) % or % data=loadjson(fname,'param1',value1,'param2',value2,...) % % parse a JSON (JavaScript Object Notation) file or string % % authors:Qianqian Fang (q.fang <at> neu.edu) % created on 2011/09/09, including previous works from % % Nedial...
57b9a48e7a958479f01dbd6fe896e250581a0d6fd18e53b58b8601e4d6b8b0ba
MATLAB
21,630
566
%% modeltype3 - full Izhikevich network % Generates data for the full Izhikevich neuron network. This network is % precisely the 1000 neuron network described in Izhikevich 2003. In % addition to the spontaneous activity produced by the network, square % current pulses are supplied to subsets of excitatory neurons. The...
9fc8db4efa85cd57bfded17806d7c517716d89845acd1f857a465774f24f4df0
MATLAB
21,769
691
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...
79d4140ed1544bc932484335e350072b5d16a9c2f00b7a636d21994ab84ea08c
MATLAB
21,788
441
% std_makedesign() - create a new or edit an existing STUDY.design by % selecting specific factors to include in subsequent % 1x2 or 2x2 STUDY measures and statistical computations % for this design. A STUDY may have many factors % (task or...
fe925c290a5240436ba1be48ecaf8f3b9402b50bce5d17cadce7d861a17c3d17
MATLAB
21,797
462
%% LaBGAScore_firstlevel_s1_options_dsgn_struct.m % % % *USAGE* % % This script sets the options and creates a CANlab-style DSGN structure % variable, which are used by the subsequent script in the standard LaBGAS % workflow, LaBGAScore_firstlevel_s2_fit_model, to fit first level models % using CANlab and SPM functions...
51164ec9369b0746a12c35ba746f9e5aab54552de591c1383547a7f78e9b8d3d
MATLAB
21,813
548
function [colocalMeasure, numOfObjects] = condColocPt2Pt2Blob(refCoords,tarCoords,condCoords,... mask,distThreshToColocWithCond, colocDistThresh,numRandomizations, alpha) %CONDCOLOCPT2PT2BLOB runs conditional colocalization for 2 channels of punctate objects with one channel non-punctate obj...
91f652871226603d150f3c3d58a6da082f2a5b0a42c1a04120f5b4ca0a817558
MATLAB
21,834
430
function go = LCN12_PET_preprocessing(dir_pet,infostring_tracer,infostring_PET,infostring_frames,dir_anat,name_logfile) % assumptions: % Data-organisation: % Data are transformed to nifti format and organized according to BIDS. % You have to specify a main directory where al the folders of the % subje...
27cbb34808ed256a54271cea08a17a422166abe6c43cbbc7ad91ad33f827efc2
MATLAB
21,849
426
% pac() - compute phase-amplitude coupling (power of first input % correlation with phase of second). There is no graphical output % to this function. % % Usage: % >> pac(x,y,srate); % >> [coh,timesout,freqsout1,freqsout2,cohboot] ... % = pac(x,y,srate,'key1', 'val1', 'key2', val...
06e0d6682a6708d229d13a6f012b64804ca3db8764eb0088692a5f713a2cf5df
MATLAB
21,851
444
% pop_editeventfield() - Add/remove/rename/modify a field in the event structure % of an EEG dataset. Can also be used to append new events to the end of the % event structure or to delete all current events. If the dataset is % the only input, a window pops up to ask for relev...
6eda58300a0892bfc75838491c12354ae1bf6af308997212fc52671440ff9fec
MATLAB
21,879
584
function plotTracksTransDiffAnalysis2D(trackedFeatureInfo,transDiffAnalysisRes,timeRange,... newFigure,image) %PLOTTRACKSTRANSDIFFANALYSIS plots tracks in 2D highlighting the different diffusion segments within each track % %SYNOPSIS plotTracksTransDiffAnalysis2D(trackedFeatureInfo,transDiffAnalysisRes,timeRange,.....
10d1cfcd08c0584338901462bf2842a7af52d6d2fe3213a316481bd4a3a7347a
MATLAB
21,901
542
function varargout = ea_anatomycontrol(varargin) % EA_ANATOMYCONTROL MATLAB code for ea_anatomycontrol.fig % EA_ANATOMYCONTROL, by itself, creates a new EA_ANATOMYCONTROL or raises the existing % singleton*. % % H = EA_ANATOMYCONTROL returns the handle to a new EA_ANATOMYCONTROL or the handle to % t...
3ed3a3fa1d66bf4db6499b0d45ae8a6357f5257726715caa6e6e07df51717a7d
MATLAB
21,926
587
function plotTracksDiffAnalysis2D(trackedFeatureInfo,diffAnalysisRes,timeRange,... newFigure,image,showConf,simplifyLin,offset,hideUnclass) %PLOTTRACKSDIFFANALYSIS2D plots tracks in 2D highlighting the different diffusion types % %SYNOPSIS plotTracksDiffAnalysis2D(trackedFeatureInfo,diffAnalysisRes,timeRange,... % ...
93bf2ddbfc8ad9c6a662220dd42205ad9bd5ead878aa221f21b25fa641874f2e
MATLAB
21,955
572
function draggable(h,varargin) % DRAGGABLE - Make it so that a graphics object can be dragged in a figure. % This function makes an object interactive by allowing it to be dragged % accross a set of axes, following or not certain constraints. This % allows for intuitive control elements which are not buttons or o...
63b023dfab9f2e7809922e184aeed4010d162c10d74a75971cdaf16e028a1bb1
MATLAB
21,985
530
% Put all the mat files you want to analyze into one folder and navigate % there. matfiles = dir('*.mat'); % colnames = {'all','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve'}; % colnames = {'left','right'}; colnames = {'left','right','three','four','five','six','seven','eigh...
93cd15908870440c95eefedbfb9efaf4d008a2992bc1f3066e954692c023fee6
MATLAB
22,037
561
%% Regression Walkthrough %% % This walkthrough works through multiple aspects of a basic 2nd-level (group) % analysis. We are interested in activity related to emotion regulation % for a contrast comparing reappraisal of negative images vs. looking at % negative images without reappraisal, i.e., a [Reappraise Negativ...
d761d4697c8e3a8cd12d0c4bb284187ee6a4de3d27d9313e076b4753d88befb3
MATLAB
22,037
433
% DPRIME - Signal-detection theory sensitivity measure. % % d = dprime(pHit,pFA) % [d,beta] = dprime(pHit,pFA) % % PHIT and PFA are numerical arrays of the same shape. % PHIT is the proportion of "Hits": P(Yes|Signal) % PFA is the proportion of "False Alarms": P(Yes|Noise) % All numbers involved must be b...
3f6d88580c9e362b2a46e0891b495bdc87582a1164247be35be46b786c15d249
MATLAB
22,055
617
function [amplifier_channels, notes, aux_input_channels, spike_triggers,... board_dig_in_channels, board_adc_channels, supply_voltage_channels, frequency_parameters ] =... read_Intan_RHD2000_file(path,file) % read_Intan_RHD2000_file % % Version 1.3, 10 December 2013 % % Reads Intan Technologies RHD2000 data f...
377671be1c760d0478ce87ff06ee31847bb18850b29065491d8922cb45811e8c
MATLAB
22,064
475
%% LaBGAScore_firstlevel_s1a_options_dsgn_multisess_multitask.m % % % *USAGE* % % This script sets the options and creates a CANlab-style DSGN structure % variable, which are used by the subsequent script in the standard LaBGAS % workflow, LaBGAScore_firstlevel_s2_fit_model, to fit first level models % using CANlab and...
38743d13dc8f7f9691252ad1b63caa25b1c97c205b9e4ae63cbbea70aa999f98
MATLAB
22,093
614
function ea_NBSrun(varargin) %NBSrun Reads user inputs, performs basic error checking and then performs %operations specified by user inputs. % % NBSrun(UI) operates on the user inputs in the structure UI. % % NBSrun(UI,S) attempts to write progress to the graphical user interface % with handles S, otherw...
1bf16430fe9696ec3a14915c0d148196bd7e63bf8b67525a05b95cf23b23fbf2
MATLAB
22,141
660
function [counts,indices] = RadialMaze(data,baitedArms,varargin) %RadialMaze - Compute simple statistics for the 8-arm radial maze task. % % Compute the number of reference and working memory errors, rewards found, etc. % % USAGE % % [counts,indices] = RadialMaze(data,baitedArms,<options>) % % data li...
c8f3ec8143693441d4a3d531078df7b260f5ac9c6b5771075a4aced8dfd88d7b
MATLAB
22,143
708
function [res, errStr, oArg1]= dtdstruct_modify(varargin) % % function [res, errStr, oArg1]= dtdstruct_modify(dtdStruct, command, parm1[, parm2[, ...[, parmN]]]) % % General method to manipulate a dtdStruct % % dtdStruct: should contain a valid dtdStruct % command: spezifies the action and should contain a st...
7f2816711bbbe231eb48285b9ee4037857da99eaa4e4a398dad13e3ca62de528
MATLAB
22,156
587
function cs_fmri_conseed_pseed(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') w...
8898272ca10de8aab45ed62d8edc72af67ac7bea0ffc865993110ec9f997381d
MATLAB
22,237
541
function atlases=ea_genatlastable(varargin) % This function reads in atlases in the Lead-dbs/atlases directory and % generates a table of all available atlas files. % Atlastypes: 1 - RH % 2 - LH % 3 - both hemispheres (2 files present both in lhs and rhs % folder % ...
4c9ebbc4252add71597482d8e7b46fdf26ebc9a1bbee64f71bdbce9ceb11fd23
MATLAB
22,260
722
function M = run_measurement_prediction(mesh_mat, nirsmodel_file, roi_def, dmua_file, opts) %RUN_MEASUREMENT_PREDICTION Predict noiseless channel-level responses from simulated ROI distributions. % % M = fnirspower.pipeline.run_measurement_prediction( ... % mesh_mat, nirsmodel_file, roi_def, dmua_file, ...) ...