sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
400fa510b64a3f1c7898123659eaac5742a0d1a7da8dca36ce99b060a6dea554
MATLAB
7,761
257
function [Bset,nB,mtr] = palm_shuftree(varargin) % This is a wrapper for the palm_permtree.m and palm_fliptree.m % that generates a sigle set of permutations. It can also generate % only permutations with sign-flipping depending on the input % arguments. % % Usage (style 1) % [Bset,nB] = palm_shuftree(Ptree,nP0,CMC,EE,...
076d7525a5e3bfff8d312eb36d68ff4901c18f6598f5b61628aa6bbc669ba407
MATLAB
7,765
226
function nptype21_imro % Build imro table for single shank NP 2.0 (probe type 21) for some useful % patterns. % % Output is saved in the directory where this script is run. % % If a mulitple electrodes are mapped to the same channel, this program % will not save the imro table. % patternType = 0 for single ...
7ec2dd925585d7549a849799554492b159f63f116f0e58e4ee41fc0a0a705e4f
MATLAB
7,771
233
function hp = superviolin(dat, varargin) % Basic implementation of Violin SuperPlots in MATLAB % Please cite the original work (Kenny & Schoen 2021 Molecular Biology of % the Cell) when using the code for your work. Thank you. % by Ingmar Schoen, RCSI (c) 2021 % I would like to gratefully acknowledge Jonas Ries for hel...
2f08d7126efb4c9859d4e0e93b34484c95ae16022fb5107f44c94d4197dca817
MATLAB
7,772
226
classdef MyvarHolder % Class for arbitrary time series variables. properties (SetAccess=private, Hidden) p_var % Backup of the original variable, from the time of making the object p_ts % Backup of the original timestamps, from the time o fmaking the object checkRoot ...
9d4772840bc3e46641e3cc1d03031a5bc306a3ba40ed98d8a50a5144307708dc
MATLAB
7,784
226
function [result] = bfopen(id, varargin) % Open microscopy images using Bio-Formats. % % SYNOPSIS r = bfopen(id) % r = bfopen(id, x, y, w, h) % % Input % r - the reader object (e.g. the output bfGetReader) % % x - (Optional) A scalar giving the x-origin of the tile. % Default: 1 % % y - (Optional) ...
4aac20c92a8c8958cf46ca32d5ca40beceb7ad5f5f6e6d2ddfe37683f0064358
MATLAB
7,789
257
function [ws, warned] = ft_warning(varargin) % FT_WARNING will throw a warning for every unique point in the % stacktrace only, e.g. in a for-loop a warning is thrown only once. % % Use as one of the following % ft_warning(string) % ft_warning(id, string) % Alternatively, you can use ft_warning using a timeout % ...
4060cacbb186bcb8a43b8a4f36fda27a741ec6c6bb5abdedda7584d1b7311a7e
MATLAB
7,793
193
function [tassmInl, flagInl, tassmInlFollower1Out, tassmInlFollower2Out] = ... retainTassmInliers(tassmMaster, thresholds, tassmFollower1, tassmFollower2) %RETAINTASSMINLIERS: search for and NaN out outliers in each column of tassm % %INPUT: tassmMaster : (array of n cells), each cell contains 3 cells: % ...
57d93e628592672e8ad9fee3864e689d008ccd3890d65f896c2aeaeacaba2b78
MATLAB
7,799
251
function [fig1, fig2] = plotRepresentativeGraphs(inputFile, outputFolder, numTracks, offset, options) % PLOREPRESENTATIVEGRAPHS Plot 3D displacement graphs for n cell tracks. % % INPUT: % % Required: % inputFile: (char | string) % Path to the AggregatedCSVResults.xlsx produced by % aggregateTrackingResul...
6b33126e129c9d4cccea35a1ad0b56d8f32ed0bdff2654a2131588ada915385a
MATLAB
7,805
220
%% Set the working directory clear cd('C:\Users\perre\Cardin-Higley Lab Dropbox\Quentin Perrenoud\Partage-QP\FigShare'); %<--------- change to local path addpath(genpath(pwd)) chFigDir = 'Figures'; %<--------- relative path to output figure directory %% Load data db2Mat = xlsread('Input_Matrix.xlsx', 'C2:AJ25');...
aa2e5a7a97bd5d0477c97c7d085d2c3ed4c9b25248fa828fe7dde4bde91d61ea
MATLAB
7,807
198
% ========================================================================= % Script: Simulation_study2_SNR.m % Authors: Zijian Gao,Qianxue Shan,Weitian Chen % Email: zijian.gao@link.cuhk.edu.hk % Date: 2025-12-19 % Version: 1.0 % % Copyright (c) 2025 Zijian Gao, Qianxue Shan, Wei...
e83b15840bc303d7778b81d8b9f0584126b1f9493520b0dcff48ee6ee8700cf9
MATLAB
7,809
206
%PRINT2EPS Prints figures to eps with improved line styles % % Examples: % print2eps filename % print2eps(filename, fig_handle) % print2eps(filename, fig_handle, options) % % This function saves a figure as an eps file, with two improvements over % MATLAB's print command. First, it improves the line styl...
73a3198bb115de843d271d48b0708aa37764308c04748871ecae832f55f4d46d
MATLAB
7,817
198
function RegPara = reg_NoCrossStack(RegPara, handles, imageinfo, figuretitlename, fext, k, w, f_wait) [userview, systemview] = memory; % fprintf('Available memory') disp(systemview.PhysicalMemory.Available) Mem_max = systemview.PhysicalMemory.Available; if handles.useGPU Mem_max = min(systemview.PhysicalMemory.Avai...
6650cd49a17cc167e27f12c5af260a6064ee1ff2d0581a47466e59545ecc467c
MATLAB
7,824
217
function [res, errStr]= mrstruct_to_nifti(mrStruct, fName, dataType) % Convert mrStruct image/volume/series to NifTI compatible files % FORMAT [res, errStr]= mrstruct_to_nifti(mrStruct, fName, dataType) % ====== % This routine tries to convert mrStruct data to NifTI compatible files % using SPM functions spm_type, spm...
f478e711bb343194fdf3ae4ad34310e423a7f6b141c44c5288c80f7d0a162dd9
MATLAB
7,824
240
function [fig] = colormap_roi_meta(mat, sorting, label, labelmeta, varargin) % DESCRIPTION: % Save matrix sorted by network label. % USAGE % colormap_roi(sorted_matrix, 2, roifile); % colormap_roi(sorted_matrix, 2, roifile, -.075, .075,'cool',1,'fig title','graph.png') % colormap_roi(un_sorted_matrix, 1, roifile, ''...
fb0834744950b0cee556cdbfec04b86aa530189635dec1a302141b56e23ce036
MATLAB
7,830
255
% Decode extra NIFTI header information into hdr.extra % % Usage: hdr = extra_nii_hdr(hdr) % % hdr can be obtained from load_nii_hdr % % NIFTI data format can be found on: http://nifti.nimh.nih.gov % % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) % function hdr = extra_nii_hdr(hdr) switch hdr.dime.datatype ca...
1343638baf300ed469343f2ebabaf2ff5181ba4cff7cb93a470d9de29a801764
MATLAB
7,833
147
function [specklePropPerTimeIntByBoxClass, specklePropPerTimeIntByBoxNoClass] = stratifySpeckleByBoxClass(actinPropPerTimeInterval, boxClass, boxClassCondition, speckleIdPerBox) %STRATIFYSPECKLEBYBOXCLASS: split the actin speckle data into groups based on their box classification % %SYNOPSIS: [specklePropPerTimeIntByBo...
06cf3a041c0889bc717c6c7912df706f8baa9acb621c0e3987ba814ec2512667
MATLAB
7,838
186
function varargout = ea_atlaseditor(varargin) % EA_ATLASEDITOR MATLAB code for ea_atlaseditor.fig % EA_ATLASEDITOR, by itself, creates a new EA_ATLASEDITOR or raises the existing % singleton*. % % H = EA_ATLASEDITOR returns the handle to a new EA_ATLASEDITOR or the handle to % the existing singleton...
b1c592fe4ef5a7274740ea983ff21d8f99771306998d42e37295c222d8efef76
MATLAB
7,849
236
% Version 26/06/2026 % Authors: Alessandro Petrini and Davide Pierangeli % ------------------------------------------------------------------------- % This script is provided as a reference implementation of the experimental % procedure described in the manuscript. It documents the acquisition logic % and computation...
d17f9bd0b282926bd7b91dc9a7d6bb9dd6b6b7d08fde8d7271879ba9dc3939fa
MATLAB
7,850
178
% % This is a calling routine to test & check out the power spectrum & % spectrogram routines for unequal segment lengths. In addition, use it % to compare with Chronux routines when segments are of equal length. % clear all; if 0 dir = 'G:\ravi\Chrowser\Pass~ Tioga_0e927741-9673-46e5-9050-ca1d7541bf22\'...
94e644160de662adec0496fc342a123b5a40ef4b891b2f865752ea0d96a21159
MATLAB
7,852
194
%% Multi-level kernel density (MKDA) meta-analysis example: Agency database % The starting point for coordinate-based meta-analysis (CBMA) is a text file % with the information entered from published studies. In this example, the % information is contained in the file "Agency_meta_analysis_database.txt" % It is in th...
a632728c9aa2ce58bd3b1104dc1e05ad900ce590845ba97e6463ea2975ca755d
MATLAB
7,854
202
function ea_busyaction(varargin) % function displays or hides a spinning wheel on top right corner (default) % of figure. if isa(varargin{2}, 'matlab.ui.control.Image') switch varargin{1} case 'on' varargin{2}.ImageSource = fullfile(ea_getearoot, 'icons', 'busy.gif'); varargin{2}.To...
e5db8077b3c0aa4a97d17ee67aae6c4fd784dcf5313789f649c1265cc7f6a842
MATLAB
7,859
120
% ------------------------------------------------------------------------- % SUBFUNCTION which detects artifacts by using a sliding window % ------------------------------------------------------------------------- function [ autoart ] = artifact_sliding_threshold(cfgT, data_in) numOfTrl = length(data_in.tria...
06e2266b65b65ad3f9fa3b288c55d1e3a651200e7ed14d3c2f8ae9a4ef57c071
MATLAB
7,860
182
ccc; RAWDATAPATHs = dir("..\MAT Data\raw\**\7-10Freq Active\**\*.mat"); % Date filter % other ISI DATESTRs = {'cc20220908', 'cc20221019', ... % 700, 400 'xx20221017', 'xx20221018'}; % 400, 400 RAWDATAPATHs = RAWDATAPATHs(contains({RAWDATAPATHs.name}, DATESTRs)); MATNAMEs = {RAWDATAPATHs.name}'; AREAs = ...
b9bcf327da5b8b6935ff01b89471c8259c9c1a22f25a600a5e2fcb29cbd4dc4e
MATLAB
7,860
234
function [rate_map, xdim, ydim, occupancy, no_occupancy] = RateMap(self, varargin) % Returns matrix rate_map with x and y dimensions in vectors xs and ys. % % [rate_map, xs, ys] = root.plot_rate_map(cel, varargin) % % Plots spatial rate map for cell cel = [ tetrode, cell ] % % % ARGUMENTS % cel 1 x 2 vec...
32fbd3952d705e2ee4a4ca973e9043299ea29da2afa920038e846e7b59b5604c
MATLAB
7,871
211
function [lfp] = bz_GetLFP(varargin) % bz_GetLFP - Get local field potentials. % % Load local field potentials from disk. No longer dependent on % FMAT/SetCurrentSession. % % USAGE % % [lfp] = bz_GetLFP(channels,<options>) % % INPUTS % % channels(required) -must be first input, numeric % ...
4b601749a3463de513fc824453aadb27a450f42118af97f83765f22979b7228a
MATLAB
7,874
172
function [Obj,modified] = SOFAupgradeConventions(Obj) %SOFAcompatibility % [Obj,modified] = SOFAupgradeConventions(Obj) upgrades the Obj to the next higher % version if required. MODIFIED is 1 when an upgrade was required. % In order to obtain the most recent version, SOFAupgradeConventions % should be p...
3c7cc7bbc60851c46491427f26ecd846096cf05dc7141af4f02d618d7614ebdc
MATLAB
7,876
159
%Example script that extracts areas for fold change analysis shown in %Figure 5 % Inputs are MasterMatAreaABSOLUTE, MasterMatLengthBondABSOLUTE and % IntensitiesPerFrameMatrix .mats obtained from GetSizeAndBondTables.m close all clear all movie_number = '3'; window_number = '1'; window_size = 10; if str2double(mov...
4bba39fbd203dde52d0886c14c6eb14e31e17c69d0f49555282a828b7a691e71
MATLAB
7,879
216
function [] = thetaSeqDecoder(spikes,lfp,behavior) % USAGE % % % INPUTS % % spikes cell array of spike times where each element is a neuron and % each timestamp is represented in seconds % positions Nx2 matrix of X and Y positions % lfp % behavior.events.trialInter...
bb3eb98e4c2a2f5b9e05f3f968fd765f9f37bcba13bbff9cdf2e17d3141d4766
MATLAB
7,879
220
%% ======================= step 01-00 for disposal all data % compute some basic maps %% compute cosine similarity between CBF and Cell-body staining intensity (CCSI) Data_PScs_bil = subfun_ProfileSimilarity(Data_scan_bil,Data_BBLP_bil); Data_PScs_uni = subfun_ProfileSimilarity(Data_scan_uni,Data_BBLP_uni); Data_PSc...
ef230373855111ba0ffc1b982a7af7a84546ba3bd68ce2ba3b1e9408f2d58cfe
MATLAB
7,882
208
% eeg_epochformat() - Convert the epoch information of a dataset from struct % to array or vice versa. % % Usage: >> [epochsout fields] = eeg_epochformat( epochs, 'format', fields, events ); % % Input: % epochs - epoch numerical or cell array or epoch structure % format - ['struct'|'array...
3e98e414a4f5731121dd65e10deb0b64442a1141f1986945b9730ad75ecf8308
MATLAB
7,885
202
% pop_firpm() - Filter data using Parks-McClellan FIR filter % % Usage: % >> [EEG, com, b] = pop_firpm(EEG); % pop-up window mode % >> [EEG, com, b] = pop_firpm(EEG, 'key1', value1, 'key2', ... % value2, 'keyn', valuen); % % Inputs: % EEG - EEGLAB EEG structure % 'fcutoff' -...
ca22cebe13ad95587df40429ca72d745d5df931f7d10bfa8968e79f168251efa
MATLAB
7,893
233
% % mergeNSxNEV(filename1, filename2) % % This function loads two NSx and NEV files and it will combine them % together into one file. The resulting file will be saved as new NSx % and NEV files onto the disk. To combine two NSx and NEV files into % indivual NSx and NEV variables in MATLAB see combineNSxNEV...
d19a47f820dfaf5b3a065acbbee29a814f1c2de2459617513ce1bd4e76117508
MATLAB
7,896
161
% Copyright (C) 2010 - 2019, Sabass Lab % % This program is free software: you can redistribute it and/or modify it % under the terms of the GNU General Public License as published by the Free % Software Foundation, either version 3 of the License, or (at your option) % any later version. This program is distributed ...
0013a95b978e6668d134af2c613d6e90c3b2d700fe98ff92c3ad32a404598238
MATLAB
7,898
239
function hp = superviolin(dat, varargin) % Basic implementation of Violin SuperPlots in MATLAB % Please cite the original work (Kenny & Schoen 2021 Molecular Biology of % the Cell) when using the code for your work. Thank you. % by Ingmar Schoen, RCSI (c) 2021 % I would like to gratefully acknowledge Jonas Ries for hel...
5e8228f17e23f28fae84a86a2a8598ef2f7fd62fb79166514fb6a7f0697edb30
MATLAB
7,898
174
%% BUZCODE TUTORIAL: SPW-R (HPC), UP/DOWN, and State Event Detection % SUMMARY: % In this tutorial we outline the use of the buzcode repository to load a % .lfp file and detect i) hippocampal sharpwave-ripples and ii) cortical UP/DOWN % states. We then create a .evt file that can be read into neuroscope for % si...
f6642e00d27702336b819acfd46dc75b369ac51e5202d3ce2c5752f9651805fe
MATLAB
7,908
163
% 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...
1526f171ccaa0693dfa251edf9fa3a5e38f9f8192ea5c6ea6fb9f0710a2f7e2b
MATLAB
7,921
236
% Runs a two-sample t-test for a set of signature responses, for each % conditions. Also runs NPS subregions. % Signatures, scaling, etc. are defined below. % created by @lukasvo76 from h_group_differences.m, March 2021 %% USER OPTIONS % ------------------------------------------------------------------------- mys...
67962673df9380a95adea6459addea008a35368b50a5874298468a828ab4765b
MATLAB
7,924
190
classdef StepWaveform < DiscreteWaveform %STEPWAVEFORM is derived from the DiscreteWaveform class and contains %only the extra necessary properties to produce time stamps for %triggering or anyother desired method. properties (SetAccess = 'private') Triggers % Reminder: Size and val...
249c86bc709948647d6533261f93d9b0e102d3071b311d513f1e3e321fa24135
MATLAB
7,925
232
function handles = loadtrace(handles, dataID) datafilepath = handles.datafilepath; datafilename = handles.datafilename{dataID}; fprintf('Load data from: ' ); fprintf('%s\n', fullfile(datafilepath, datafilename)); variableinfo = who('-file', fullfile(datafilepath, datafilename)); variablename = handles.variablename; im...
6cc2a6cd46ead0f578a67c60a461b39d35a233e4d8c425e8175bafcdecf5e0f3
MATLAB
7,928
217
% GICA BIDS App (tweaked from spm BIDS app file @ https://github.com/bids-apps/SPM/blob/master/spm_BIDS_App.m) gica_inputs = evalin('base', 'gica_inputs'); %========================================================================== %-BIDS App structure %================================================================...
5c8be8487c3d62c76314eeef33d46732694e0cdd54e1c2bb5e6e0a51157079cb
MATLAB
7,929
199
%% Load and explore a sample dataset % This example shows how to load a pre-set example fMRI dataset into % an fmri_data object. %% General instructions % % Before you start, the CANlab_Core_Tools must be added to your path with % subfolders. Otherwise, you will get errors. % % The script canlab_toolbox_setup can help...
8a7caabe490cd954261cefd2ef1dbe78ac375673557d6dc4148bbfb2400fcd3f
MATLAB
7,936
256
function [WC,T] = LeG_autoElecs(app) Img = app.CTImg; MaxElecs = app.detect.maxelecs; ElecRad = 2; % electrode radius in mm (standard intracranial) XYZScale = app.XYZScale; % voxel scaling (used earlier; now mostly for info) MRInfo = app.MRInfo; ProjSurfRaw = app.Pr...
552665ba2b09d542de91b29e2cc15617f8e1c090753fd3a83d910269bb064182
MATLAB
7,950
196
function cs_dmri_conseed_map(connBaseFolder,connName,sfile,cmd,space,options) useNativeSeed = options.prefs.lcm.struc.patienttracts.nativeseed; for s=1:length(sfile) if useNativeSeed vatdir = [fileparts(sfile{s}),filesep]; copyfile(ea_niigz([ea_getearoot,'templates',filesep,'spacedefinitions',files...
ce44e4719c8e73ed780806bbabf962aae9a99d706217a7b7cf260d474ef137bf
MATLAB
7,950
207
function violins = violinplot(data, cats, varargin) %Violinplots plots violin plots of some data and categories % VIOLINPLOT(DATA) plots a violin of a double vector DATA % % VIOLINPLOT(DATAMATRIX) plots violins for each column in % DATAMATRIX. % % VIOLINPLOT(DATAMATRIX, CATEGORYNAMES) plots violins for each % ...
842ce05d7641b75277cbbc34a301b7b853ad26a811fcbe4d5a48dee3ebdac0bc
MATLAB
7,958
152
function mris_SD_pairwise_register(fixed_surface, moving_surface, output_surface, disp_iter) % mris_SD_register(input_surface, moving_surface, output_surface, disp_iter) % Example call: % <When in the same directory as mris_SD_pairwise_register.m> % mris_SD_pairwise_register('../../example_surfaces/OAS1_0001...
7aee96214b32e6a9f13c76087baa3f2831ff9d4ed7dfb859e58585cf6d7fdd14
MATLAB
7,961
211
%Adapted from bz_eventCSD from Buzsaki lab repository. Almost identical to %what is used by AFR lab as well. %LV 1/10/25 function [ csd, lfpAvg ] = bz_eventCSD_lv (lfp, events, animal, group, filter, csd_lyr_borders, region, varargin) % [ CSD ] = bz_eventCSD (lfp, events, varargin) % Calculates event-triggered (i.e. ...
2e94eb0030a25bfa89ed5dea26bf7fab6d8aac6009d27c96240bf339d4bc0af7
MATLAB
7,965
185
function results = pass_index( varargin ) % PASS_INDEX - Calcultes the pass index and plots % % Calculates the pass index for the data passed. This function uses the % pass_index_parser to generate its input structure. % % RESULTS = PASS_INDEX_PARSER(POS_TS,POS,SPK_TS,LFP_TS,LFP_SIG) % RESULTS = PASS_INDEX_PARSER(POS_T...
c1aa32e66af993e9394d16722a81bdfa2938ef7f4f527d6b376f8923a21b792e
MATLAB
7,973
252
function fit = fit_meta_d_mcmc_regression(nR_S1, nR_S2, cov, mcmc_params, fncdf, fninv, name) % HMeta-d for between-subjects regression on meta-d'/d' % cov is a n x s matrix of covariates, where s=number of subjects, n=number % of covariates % See fit_meta_d_mcmc_group for full details % % Steve Fleming 2017 % % 16.09...
2e3976963bfba23566cf38b21083c569614deb19413b3286774432a36219b8b3
MATLAB
7,986
309
function y=processBiopacStruc(x,fs,fco,t0avg,dtt,po2cal,po2tr,refvar,skp) % Usage ... y=processBiopacStruc(x,fs,fco,t0avg,dtt,po2cal,po2tr,refvar,skp) % % x- parseBiopac variable % fs- sampling rate in Hz, fco- cutoff frequency in Hz, t0avg in time % note: a second entry in fs will be the interpolated desired sample ...
a78d889dce0a13cd49b8935a3021c186fe33b8d2ed7458b74ea110d64baf5bd2
MATLAB
7,996
237
function [SourcesMat,SetsMat,TransMat] = PIDLattice(N) %PIDLattice creates necessary lattice variables for PID calculations. % [SourcesMat,SetsMat,TransMat] = PIDLattice(N) is a collection of % variables that describe the partial information lattice. These % variables depend on the number of X variables that are ...
2f5f21126df9f68bcfb12456403779196b374343c8d450dc82ff8a53f83ec272
MATLAB
7,999
212
% eeg_eegrej() - reject porition of continuous data in an EEGLAB % dataset % % Usage: % >> EEGOUT = eeg_eegrej( EEGIN, regions ); % % Inputs: % INEEG - input dataset % regions - array of regions to suppress. number x [beg end] of % regions. 'beg' and 'end' are expressed in...
cc6f3bd39c19361a17b10ffdeab981a509a355ad2ec0d1f649573bf24091621b
MATLAB
7,999
131
function cpDiff = couplingdiffs(coupling, spindles, so, srate, samples) % Summarize slow oscillation and spindle parameters separately for coupled % and uncoupled events % % Required inputs: % % coupling: A structure containing coupling data (output of % fun_so_spindle_coupling) % % spindles: A structure containing spi...
bda4156d4a8647aafc2da32cf1846356a517cb3172cdad8b9df1336dc38c8a17
MATLAB
8,008
236
function this = read_gifti_file_standalone(filename, this) % Low level reader of GIfTI 1.0 files % FORMAT this = read_gifti_file(filename, this) % filename - XML GIfTI filename % this - structure with fields 'metaData', 'label' and 'data'. %_____________________________________________________________________...
81d432654b15d516e496f2a23e22bd4eb865332ee9dee90b173c7ceb49113193
MATLAB
8,017
226
function varargout = dirwalk(topPath, visitor, recursionLimit, varargin) %DIRWALK Generate the file names in a directory tree by walking the tree % % Description: % Function DIRWALK generates the file names in a directory tree by walking the tree % top-down. For each directory in the tree rooted at directory ...
bcf114448e62ae9c9bdaf5faa57c72d7e11efa347191cb197f1c17cc76ccd4e2
MATLAB
8,023
224
function stackview(mr,hr,ftr,showfun) if nargin == 3, showfun = @imagesc; end; ds.img = mr; ds.hr = hr; ds.ftr = ftr; set(datacursormode,'UpdateFcn',{@(x,y) labeldtips(x,y,ds)}) %f = figure('Position',[360,500,750,585]); f = gcf; clf; h = uicontrol('Style','slider','String','Surf','Position',[0,0,...
363507cae4b932790d4dafed22212716f09d5ab6ccd61e596a698c2b6dbb6bb9
MATLAB
8,031
214
% eegfilt() - (high|low|band)-pass filter data using two-way least-squares % FIR filtering. Optionally uses the window method instead of % least-squares. Multiple data channels and epochs supported. % Requires the MATLAB Signal Processing Toolbox. % Usage: % >> [smoothdata] = ...
d00702f7591bfed71ff9b960c2ccfdcdd344aa07148ecdb3084ce4efd8cfef0d
MATLAB
8,035
189
function varargout = impexp_run_probstruct2nifti(cmd, varargin) % Template function to implement callbacks for an cfg_exbranch. The calling % syntax is % varargout = impexp_run_probstruct2nifti(cmd, varargin) % where cmd is one of % 'run' - out = impexp_run_probstruct2nifti('run', job) % Run a job, an...
922676d52b7a9569c5312794743190eff5986d18ebe7e5a53d611ef07c4fc3d7
MATLAB
8,044
204
% function run_stress_calculation(traction_data,savename,domainname,BC) %RUN_STRESS_CALCULATION % % run_stress_calculation(traction_data,savename,domainname,BC) % % Compute monolayer stresses. This follows the procedure the following % papers: % Tambe et al, Nat Mater, 2011, 10:469-475 % Tambe et al, Plos One, 2013,...
7702be6b997f014a819f80da10469895194823df4109be723b3e1c17cbffdbcf
MATLAB
8,046
287
function map = turbo(m) % TURBO An improved rainbow colormap for visualization % TURBO(M) returns an M-by-3 matrix containing a colormap. % % TURBO returns a colormap with the same number of colors as the current % figure's colormap. If no figure exists, MATLAB uses the length of the % default colormap. % % S...
0a6663b17c5087b33f8a539fb5fc8f05d6a50dc7e2c4ca0f59cc74fba29c2fd2
MATLAB
8,052
229
function [N,X,sp] = optimalHistogram(varargin) % OPTIMALHISTOGRAM generates a histogram using the "optimal" number of bins % % This function was previously called histogram prior to R2014B % % If called with no output argument, optimalHistogram plots into the current axes % % SYNOPSIS [N,X,sp] = optimalHistogram...
b008c93e9471d3f6ce080f9491fcaf861200ccc8471847ea06983e3af17f28d8
MATLAB
8,056
214
function ConvertMountainsort2Neurosuite(basepath,basename) % Converts .kwik/kwx files from Klusta into klusters-compatible % fet,res,clu,spk files. Works on a single shank of a recording, assumes a % 16bit .dat and an .xml file is present in "basepath" (home folder) and % that they are named basename.dat and base...
09d24d56ebc8ad38fa31dac8624e3f2bcdbb728e859bbc7d8cf17d2ccb6669d9
MATLAB
8,071
263
% [kcMax,A0,kcGM,d0,d] = getDcorrSect(im,r,Ng,Na,figID) % --------------------------------------- % % Estimate the image sectorial cut-off frequency based on decorrelation analysis % % Inputs: % im 2D image to be analyzed % r Fourier space sampling of the analysis (default: r = linspace(0,1,50) % ...
4eda755026ba9ee0a9c101d1089cb6c97e9931386a1a0c4fe72c62dafea62c87
MATLAB
8,071
163
function hndl=plotci(obj,x,y,yci,draw_data,geom,dodge,width) if nargin<7 dodge=0; end if nargin<8 width=0.5; end x=shiftdim(x)'; y=shiftdim(y)'; %Hackis...
34f195319e2d40bd0d9e71f3705893cbf29778e0d88e931f5e3af85477914568
MATLAB
8,079
214
function [xscl,y,zscl,y0, w,relt, dxmdz,err, wr] = ... wregion(L,Lden,Lsd,d,v,vfrm,A,DAt,dense, R,K,y,y0,b, pars, wr) % [xscl,y,zscl,y0, w,relt, dxmdz,err, wr] = wregion(L,Lden,Lsd,... % d,v,vfrm,A,DAt,dense, R,K,y,y0,b, pars, wr) % % WREGION Implements Sturm-Zhang Wide-region Interior...
28316dd02e4ca778f5cb5becb244b519a7a5ac9718087c866cc588e8ad96ac22
MATLAB
8,081
209
function demoBrowser() %demoBrowser: an example of using layouts to build a user interface % % demoBrowser() opens a simple GUI that allows several of MATLAB's % built-in demos to be viewed. It aims to demonstrate how multiple % layouts can be used to create a good-looking user interface that % retains the corr...
22b1d2fbe16c0611187c6bf5a5bbf82b36b81c31254c4080b8783b7bd97d7016
MATLAB
8,085
317
function [out] = EgocentricRatemap(root, varargin) % calculates the egocentric ratemap and returns structure containing all of % the relevant information for plotting or statistical testing. % % Note: In order to simplify distribution we assume that the "root" object % contains cleaned and epoched data only. %% Setup...
8ccf6b3ddec34e578084585831604da367a73e43052c50a21cd489d73bacff06
MATLAB
8,085
232
function[vardecomp] = glmfit_multilevel_varexplained(X,Y,B,varargin) % Variance decomposition for multi-level linear model % % USAGE: vardecomp = glmfit_multilevel_varexplained(b,XX,YY,varargin) % % B is the transposed vector of beta weights returned by glmfit_multilevel % Default is B = stats.beta' obtained from work...
fd391635a3996a1674437cdde9d229fd51e10749f178a09904661f66992347fd
MATLAB
8,088
229
function [N,X,sp] = optimalHistogram(varargin) % OPTIMALHISTOGRAM generates a histogram using the "optimal" number of bins % % This function was previously called histogram prior to R2014B % % If called with no output argument, optimalHistogram plots into the current axes % % SYNOPSIS [N,X,sp] = optimalHistogram...
ab7ed33e6aa0ece6c1f90ca761a1dd23a3a68f8bb6978f2f6320951de2f8f8c4
MATLAB
8,092
218
function vatlist = ea_networkmapping_getvats(obj) % Return list of VATs numPatient = length(obj.allpatients); vatlist = cell(numPatient*2,1); [modlist,modType] = ea_genmodlist; [~,ix] = ismember(obj.connectome,modlist); if ~ix ea_error('Something went wrong, connectome disappeared?'); end modType = modType(ix); m...
24d7c1fbb98d51847e8e0a7eb64308029feeda4fb940fb36aaf21ececf741409
MATLAB
8,093
200
% internal function % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) function hdr = load_nii_hdr(fileprefix, machine) fn = sprintf('%s.hdr',fileprefix); fid = fopen(fn,'r',machine); if fid < 0, msg = sprintf('Cannot open file %s.',fn); error(msg); else fseek(fid,0,'bof'); hdr =...
99f524c4ddba4964bc7988794934a0d6d492fbf7795077c14f77152b4468666b
MATLAB
8,110
201
function CBIG_MMLDA_example_wrapper(out_dir, queue) % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); addpath([CBIG_CODE_DIR '/stable_projects/disorder_subtypes/Sun2019_ADJointFactors/step2_MMLDA']) doc_dir = [CBIG...
6df5ee9496a9ed29a6d5187a1d76bf64b247c6809b6ff6ec0d95cf62f2ee5594
MATLAB
8,123
283
function varargout=ea_genvat_kuncel(varargin) % This function generates a volume of activated tissue around for each % electrode. % Usage: VAT=ea_genvat(coords_mm,stimparams,options). % ? stimparams is a struct variable with fields U (8*1 with voltage % entries) and Im (8*1 with Impedance measurements). % % This functi...
07d5b80e8d84024772c875e6ed4951e75a5e1c87651ad79ff5dac896c17218c7
MATLAB
8,131
267
function cm_data=GyRd(m) cm = [0.1020 0.1020 0.1020 0.1100 0.1100 0.1100 0.1180 0.1180 0.1180 0.1260 0.1260 0.1260 0.1340 0.1340 0.1340 0.1420 0.1420 0.1420 0.1500 0.1500 0.1500 0.1580 0.1580 0.1580 0.1660 0.1660 0.1660 0.1740 ...
78a1d9b73821b86307d3da39ddf146de742d2bdde514d5d484b969bad46796a5
MATLAB
8,131
267
function cm_data=GyBu(m) cm = [0.1020 0.1020 0.1020 0.1100 0.1100 0.1100 0.1180 0.1180 0.1180 0.1260 0.1260 0.1260 0.1340 0.1340 0.1340 0.1420 0.1420 0.1420 0.1500 0.1500 0.1500 0.1580 0.1580 0.1580 0.1660 0.1660 0.1660 0.1740 ...
cae4ae7c13592648f314ae87c5585954c79c3c1681f22920bd2136670802352f
MATLAB
8,133
267
function cm_data=Reds_r(m) cm = [0.4039 0 0.0510 0.4141 0.0025 0.0529 0.4240 0.0051 0.0546 0.4338 0.0077 0.0562 0.4434 0.0104 0.0577 0.4528 0.0130 0.0591 0.4621 0.0156 0.0603 0.4712 0.0182 0.0615 0.4801 0.0207 0.0626 0.4888 ...
f6dfee68f283ebd8a863677a410ff3d6004574729907483840a058228ccf4a86
MATLAB
8,134
267
function cm_data=Blues_r(m) cm = [0.0314 0.1882 0.4196 0.0307 0.1925 0.4276 0.0299 0.1967 0.4355 0.0292 0.2010 0.4432 0.0285 0.2052 0.4508 0.0277 0.2094 0.4582 0.0270 0.2135 0.4655 0.0263 0.2177 0.4727 0.0256 0.2219 0.4797 0.0249 ...
5cd8895f027f64b9213c0ea822ed9f507cf0f1a76819a8d24b24f547ba6caaac
MATLAB
8,137
243
function Pset = palm_fliptree(Ptree,nP,cmc,idxout,maxP) % Return a set of permutations from a permutation tree. % % Usage: % Sset = palm_fliptree(Ptree,nS,cmc,idxout,maxS) % % Inputs: % - Ptree : Tree with the dependence structure between % observations, as generated by 'palm_tree'. % - nS : Number of...
f3a9bb22b4da4144b2dcbebe4e841488349e7a9d3623a7015553ff045dd4dbcc
MATLAB
8,139
307
function [x,fval,exitflag,output] = fminsearchbnd(fun,x0,LB,UB,options,varargin) % FMINSEARCHBND: FMINSEARCH, but with bound constraints by transformation % usage: x=FMINSEARCHBND(fun,x0) % usage: x=FMINSEARCHBND(fun,x0,LB) % usage: x=FMINSEARCHBND(fun,x0,LB,UB) % usage: x=FMINSEARCHBND(fun,x0,LB,UB,options) % usage: x...
9ef986c5b2ebb9ff668145923200bad7a4d8fcb6c62e4870358be7414751f9fa
MATLAB
8,142
239
classdef (Abstract) audio < matlab.mixin.Copyable %AUDIO Abstract superclass providing audio-related properties and methods. % % The IOSR.DSP.AUDIO superclass is an abstract class that defines % audio-related properties and methods. As an abstract class, it cannot % be instantiated. % % IOSR.DSP.AUDIO is a su...
6cef202216962684a05cc8952020807e68a71737b10cafb9d8a969bfcb2c5b03
MATLAB
8,148
218
function vatlist = ea_unified_nm_getvats(obj) % Return list of VATs numPatient = length(obj.allpatients); vatlist = cell(numPatient*2,1); [modlist,modType] = ea_genmodlist; [~,ix] = ismember(obj.calcsettings.netmap_connectome,modlist); if ~ix ea_error('Something went wrong, connectome disappeared?'); end modType ...
56d25fbf09a4cf4ef38ae857a3292c0fa4e1a4e31ea1ffbe7278eeee9af70ee5
MATLAB
8,149
267
function cm_data=GyRd_r(m) cm = [0.1020 0.1020 0.1020 0.1100 0.1100 0.1100 0.1180 0.1180 0.1180 0.1260 0.1260 0.1260 0.1340 0.1340 0.1340 0.1420 0.1420 0.1420 0.1500 0.1500 0.1500 0.1580 0.1580 0.1580 0.1660 0.1660 0.1660 0.1740 ...
cbd44caac13ef297172247c3781aea0bb4239f5ca7c5bd808d3143b70be4548e
MATLAB
8,149
267
function cm_data=GyBu_r(m) cm = [0.1020 0.1020 0.1020 0.1100 0.1100 0.1100 0.1180 0.1180 0.1180 0.1260 0.1260 0.1260 0.1340 0.1340 0.1340 0.1420 0.1420 0.1420 0.1500 0.1500 0.1500 0.1580 0.1580 0.1580 0.1660 0.1660 0.1660 0.1740 ...
bdc7f3a5e1283c44086e4c98040b7cc6e8e5f05024eb1032a3a894c30ff451ce
MATLAB
8,154
217
function dicm_save(img, fname, s) % DICM_SAVE(img, dicomFileName, info_struct); % % Save img into dicom file, using tags stored in struct, as dicomwrite does. % The img can have up to 4 dimensions, with 3rd typically RGB and 4th frames. % % Comparing to dicomwrite: Advantage 1: DICM_SAVE supports img with any Matlab %...
1521f7a588fdd39bd570745fd7c39ab2250b520dd84c0642bcb74378c2b5e83a
MATLAB
8,156
243
% KMEANS: K-means clustering of n points into k clusters so that the % within-cluster sum of squares is minimized. Based on Algorithm % AS136, which seeks a local optimum such that no movement of a % point from one cluster to another will reduced the within-cluster % sum of squares. Te...
5a965a93c346c417e4209dd3c7b54cc5ffa5062b2608088b66df25e7504bafd3
MATLAB
8,162
344
function [regParams,Bfit,ErrorStats]=ea_absor(A,B,varargin) %ABSOR is a tool for finding the rotation -- and optionally also the %scaling and translation -- that best maps one collection of point coordinates to %another in a least squares sense. It is based on Horn's quaternion-based method. The %function works for bo...
705f429b051fab7da80eece520abb7b1b6a6fd71ccdbe1e164c0e672143f4acc
MATLAB
8,180
245
function [ A ] = PhiIDFullDiscrete(varargin) %%PHIIDFULLDISCRETE Computes full PhiID decomposition of discrete input data % using the MMI PhiID. % % A = PHIIDFULLDISCRETE(X, TAU), where X is a D-by-T data matrix of D % dimensions for T timesteps, and TAU is an integer integration timescale, % computes the PhiID d...
61886d967cef3c30bc7163ae20348a822a1694c6c50fe5222f8804ef03a15055
MATLAB
8,191
208
function varargout=ea_ft_gqi_yeh(options) % __________________________________________________________________________________ % Copyright (C) 2014 Charite University Medicine Berlin, Movement Disorders Unit % Andreas Horn if ischar(options) % return name of method. varargout{1}='Generalized Q-Sampling (Yeh et al....
958f7bb530a713c207bcf85670505b1b033c7a333d0de7eef813a52e3f7995cd
MATLAB
8,193
262
% eeg_pv() - Compute EEG.data 'percent variance ' (pv) of the whole EEG data versus the projections % of specified components. % Can omit specified components and channels from the computation. Can draw a plot % of the scalp distribution of pv, or progressively compute the pv ...
bbbf81c4d3c41cce68288fd686b6f4bf1f629392fd4bbaada5f2a41940b296ae
MATLAB
8,203
195
function tests = testHeadless %TESTHEADLESS Structural sweep: constructs that make the library unusable in CI. % % These are source-level tests, not numerical ones. They exist because the % failure they catch is invisible to any test that calls a function inside % try/catch -- MATLAB does not break into the debug...
1cb9822aa65cfe938404d90d5b53826be3b7c8c6cc714d0adcc986d0943ee7df
MATLAB
8,206
196
% pop_studyerp() - create a simple design for ERP analysis % % Usage: % >> [STUDY ALLEEG] = pop_studyerp; % pop up interface % % Outputs: % STUDY - an EEGLAB STUDY set of loaded EEG structures % ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures % % Author: Arnaud Delorme, SCCN, ...
71b068b85f3670baca3ea65e3db6ec9efbb292f25deb3e4f14a2c09978713da6
MATLAB
8,212
153
% dipfitdefs() - default settings and filenames for dipolefitting % to source in the ICA/ERP package functions. % Insert local dir reference below. % % Note: Edit this file to change local directories under Unix and Windows % % Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 % SMI, ...
3ab076f5681c30eb29e742441ce8ae4862d164fa4c3a72815e91349469430d13
MATLAB
8,219
214
function CFA_CheckNormROI ansct = questdlg('CT mode','CT mode','yes','no','no'); ansWithT1 = questdlg('With T1 mode','With T1 mode','yes','no','no'); PG = uigetdir(pwd,'Check Data(after normalize)'); dir1 = [PG,filesep,'NormBG',filesep]; if ~isfolder(dir1) dir1temp = uigetdir(pwd,'Please Select Normalized Backgrou...
7b286947551b4c5be2b0efe8c72fb2fad726af7b348a6e7e6c58db07b594b795
MATLAB
8,228
236
function baseline = CBIG_MMLDA_hypotest_independent_factors(k, N, betas, stats, output, CI_scale) % baseline = CBIG_MMLDA_hypotest_independent_factors(k, N, betas, stats, output, CI_scale) % % This function will do omnibus and pairwise tests of k factors. % % Input: % - k : number of factors % - N ...
87ffd35f388584a9d5c7a4b7c8905e987c1aad3a4192ff8ad3a40c087f3ae5dc
MATLAB
8,229
183
% eeg_rejmacro() - Internal EEGLAB macro for all pop_ functions that % perform data rejection. % % Author: Arnaud Delorme, CNL / Salk Institute, 2001 % % See also: eeglab() % Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu % % This program is free software; you can redistribute it ...
b5f83781e5ab657d1d3e3a50701f03cb29dde33e8ed1162e7037acda4f9af417
MATLAB
8,232
200
function R = LaBGAScore_check_display(varargin) % % % *USAGE* % % Checks whether the display of the current session is big enough to % produce good figures in a published HTML report, and says what to change % if it is not. % % Why this exists: publish() captures figures from the screen, so the size % and DPI of your X...
14f580af66b8ec8a51b9e140dad3d0ffb7a6f349943d55a7ecfbd97d101924d4
MATLAB
8,234
212
function [output Greg] = dftregistration(buf1ft,buf2ft,usfac) % function [output Greg] = dftregistration(buf1ft,buf2ft,usfac); % Efficient subpixel image registration by crosscorrelation. This code % gives the same precision as the FFT upsampled cross correlation in a % small fraction of the computation time an...
cf7fdcd4f2df19c39e123e60dccd41d0103ca3070d59a2072ee67a9dde272fd1
MATLAB
8,237
210
function y = signals(kind, n, varargin) %SIGNALS Deterministic test signals with known analytic answers. % % y = nonantest.signals(kind, n, ...) returns an n-by-1 column vector. % % Every generator here is implemented from scratch in base MATLAB and is % deliberately INDEPENDENT of the NONAN library. Known-answer...
6421d57c02beebb2a689e82029a7853292e78764e5136e61c46cd7e07a6d85ac
MATLAB
8,238
193
function [timeStamps, waveForms] = BlackrockNEVLoadingEngine(varargin) %% % Blackrock Microsystems NEV loading engine for MClust 3.0. % % Kian Torab % support@blackrockmicro.com % Blackrock Microsystems % % Version 1.3.0.0 % % Version 1.4 by Saman Hagh Gooie - 13 October 2016 % - Modifed to work with the lates...
ad0f1208f6372e499d353b8c5a87f758ab88daa6be6b7f9c1727c66d18bbf982
MATLAB
8,242
268
function cmd =ea_ants_schoenecker(varargin) % Wrapper for ANTs nonlinear registration fixedimage=varargin{1}; movingimage=varargin{2}; outputimage=varargin{3}; if ischar(fixedimage) fixedimage={fixedimage}; elseif ~iscell(fixedimage) ea_error('Please supply variable fixedimage as either char or cellstring'); ...
a0b1b3f8a938387a9e92933b0727d050f6cf2279099be0fe456c7262fab2a0b5
MATLAB
8,244
236
function this = read_gifti_file_standalone(filename, this) % Low level reader of GIfTI 1.0 files % FORMAT this = read_gifti_file(filename, this) % filename - XML GIfTI filename % this - structure with fields 'metaData', 'label' and 'data'. %________________________________________________________________...