sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
8ed168bee1f1fa957224bd39017f021ab3d1f3a2563ead8dccf4715121b38a73 | MATLAB | 13,787 | 305 | function CBIG_ASDf_check_example_results(output_dir, log_file)
% CBIG_ASDf_check_example_results(output_dir, log_file)
%
% This function compares the output after you run the example code with the
% reference output to ensure that you have properly downloaded codes in
% Tang2020_ASDFactors and the example code works fi... |
6073fde5ff132c65bc5f28f4f7635436728c6c6a2a1bf876fa9cd111f34e97ce | MATLAB | 13,792 | 203 | function [warped] = ft_warp_apply(M, input, method, tol)
% FT_WARP_APPLY performs a 3D linear or nonlinear transformation on the input
% coordinates, similar to those in AIR 3.08. You can find technical
% documentation on warping in general at http://bishopw.loni.ucla.edu/AIR3
%
% Use as
% [warped] = ft_warp_apply(M... |
869e3f7081550e0974a514015f315ebb1af4dac222bffcd6c072d4d4973dc05b | MATLAB | 13,795 | 280 | function restartEeglabFlag = plugin_extract(type, pluginlist, page)
if nargin < 3, page = 1; end;
% type may be 'import' or 'process'
restartEeglabFlag = false;
pluginsPerPage = 15;
% check the presence of unzip
%str = evalc('!unzip');
%if length(str) < 200
% error([ '"unzip" could not be found. Instal unzip an... |
c5ff9935a50230410003fb95836737f41166c8337276c50c5dac78aef8c736d1 | MATLAB | 13,802 | 391 | function [all_data] = ParseData(metadata_file, counts_raw, biomass_raw, counts_dataFormat)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically relevant behaviors of the e... |
7da2779a0148dfd5fedab5aa8a45381892ca8d109e8263af2e854ffc5c4d3def | MATLAB | 13,814 | 315 | function [output, Greg] = dftregistration_min_max_3d(buf1ft,buf2ft,usfac,min_shift,max_shift,phase_flag)
% 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
% sm... |
f2e3c4806a02e7e3138adacbdcbda0b6e871eb67a55ce244e1b89791743605cc | MATLAB | 13,833 | 329 |
function [armChoice] = getArmChoice(varargin)
% Compute T maze performance and gets timestamps
%
% USAGE
%
% [armChoice, behavior] = getArmChoice(varargin)
%
% INPUTS
%
% digitalIn digitalIn structure with T maze convention:
% 1. Basler, 2. maze LEd,
%... |
b7e51b061981191a71b750f16d50a7fecb15f7dfe08c29947829e0ff7e4e8d02 | MATLAB | 13,875 | 307 | function ea_exportisovolume(elstruct,options)
% this function exports an isovolume to a nifti file. It is largely based
% on ea_showisovolume
% __________________________________________________________________________________
% Copyright (C) 2015 Charite University Medicine Berlin, Movement Disorders Unit
% Andreas Ho... |
e2c444812667081f85461357a7c1fa2fa4c599ebade55359ef4288cb5c29ae05 | MATLAB | 13,899 | 314 | %% Step 2 Tiny Dancers: Epoching and artefact rejection
clear
clc
addpath 'C:\Users\tnguyen\OneDrive - Fondazione Istituto Italiano Tecnologia\Documenti\MATLAB\functions'
addpath 'D:\MUSICOM_EEG/onsets'
addpath('D:\MUSICOM_EEG/EEG/')
addpath('C:/Users/tnguyen/OneDrive - Fondazione Istituto Italiano Tecnologia/... |
4d553b58b88d8c39cd34adf226db718aef246617cc5a2c208f637a6167b3110f | MATLAB | 13,934 | 434 | function palm_mediation(varargin)
% Perform a mediation analysis using the strategy proposed by
% Baron & Kenny (1986).
%
% palm_mediation -indep <file_independent_variable> ...
% -dep <file_dependent_variable> ...
% -med <file_mediator_variable> ...
% -o <outp... |
53b3b6d744ea774e2da45f3492c8682af01697e57063800445e8b5e276b8a00c | MATLAB | 13,943 | 349 | classdef VBoxFlex < uix.VBox & uix.mixin.Flex
%uix.VBoxFlex Flexible vertical box
%
% b = uix.VBoxFlex(p1,v1,p2,v2,...) constructs a flexible vertical box
% and sets parameter p1 to value v1, etc.
%
% A vertical box lays out contents from top to bottom. Users can
% resize contents by d... |
492286ab49b1744e5372169f2205d7fab5b1b5ef8239cd0c5fbb9c0987b50732 | MATLAB | 13,946 | 389 |
function [tracking] = LED2Tracking(aviFile,varargin)
% Get LED tracking
%
% USAGE
%
% [behavior] = LED2Tracking(varagin)
%
% INPUTS
% aviFile Avi format video. If not provided, look for it in the
% basepath f
% It requires an avi format video and a digitalin.dat file in the
% basepath folder.
%
% (OPT... |
a23d251a6b7e983363975e90ea333c1f662d22a1dbafed6af72558a6af290f41 | MATLAB | 13,976 | 438 | % Name: Robert Kim
% Date: 11-15-2023
% Email: robert.f.kim@gmail.com
% plot_two_modality.m
% Description: Render the 4x4 lesion-effect boxplot grids for the one-layer
% TWO-modality (instr2) RNNs. Produces four panel figures:
% 1) Cue/attention fixed to MOD 1, comparing anti vs. pro performance
% 2) Cue/attention ... |
425d6da5eda8adcb85b87a58fa0cff868effe59de6504ee45c8899cb25a681a6 | MATLAB | 13,978 | 301 | function ea_gentrackingmask_brainmask(options,threshold)
directory=[options.root,options.patientname,filesep];
% BIDS: Place masks in preprocessing/dwi/ subdirectory
maskDir = fullfile(directory, 'preprocessing', 'dwi');
if ~isfolder(maskDir)
mkdir(maskDir);
end
% BIDS FIX: Generate brainmask directly from native... |
097c646437bf19dbba944fcf4b1d254f70380f24781c1612033ef0a79db80f1e | MATLAB | 13,988 | 395 | function [headers, fid] = readPLXHeaders(filename, fullread)
% readPLXHeaders - Read file headers and channel information from PLX file.
%
% [headers, fid] = readPLXHeaders(filename)
%
% readPLXHeaders will read the header data from a PLX file and return a
% structure with fields corresponding to each piece of he... |
3d7c6bc8769439adafd38f5bf1e5b1c7b38fc0f774c9d7bc4c2a7e35118ca601 | MATLAB | 13,996 | 275 | function [nPeaks, nTroughs, spatialDecaySlope, waveformBaseline, scndPeakToTroughRatio, mainPeakToTroughRatio, peak1ToPeak2Ratio, ...
troughToPeak2Ratio, mainPeak_before_width, mainPeak_after_width, mainTrough_width, peakLocs, troughLocs, waveformDuration_peakTrough, ...
spatialDecayPoints, thisWaveform, spatia... |
96eeb369c2a5ecb7a385235045ff2f4d38787b223b26d9b727135405f9f391c3 | MATLAB | 13,998 | 267 | function cm_data=Reds(m)
cm = [1.00000000000000 0.960784313725490 0.941176470588235
1 0.959705128350638 0.939629628612132
1 0.958511007910601 0.937912657833264
1 0.957203697901046 0.936028646871820
1 0.955784947412394 0.933980694962960
1 0.954256508716620 0.931771911206714
1 0.952620136858533 0.929405413831769
1 0.9508... |
d1126858cd5488cc0d26bc55616b91db9fcc9fdad766856209d8001d002d99d3 | MATLAB | 14,002 | 349 | classdef HBoxFlex < uix.HBox & uix.mixin.Flex
%uix.HBoxFlex Flexible horizontal box
%
% b = uix.HBoxFlex(p1,v1,p2,v2,...) constructs a flexible horizontal
% box and sets parameter p1 to value v1, etc.
%
% A horizontal box lays out contents from left to right. Users can
% resize content... |
ff7af98a0ce9285304f92dfb7877156285993ec5b3b64e0505e32ce046a7b901 | MATLAB | 14,003 | 351 | % eeg_interp() - interpolate data channels
%
% Usage: EEGOUT = eeg_interp(EEG, badchans, method);
%
% Inputs:
% EEG - EEGLAB dataset
% badchans - [integer array] indices of channels to interpolate.
% For instance, these channels might be bad.
% [chanlocs structure] channe... |
ebc18d53147c2b4f35059dd28c668a8117e04000d1eb4bfa72d20b4d58fb4c5b | MATLAB | 14,016 | 391 | function CBIG_ArealMSHBM_dMSHBM_estimate_group_priors_child(s, mesh, tmp_dir)
% CBIG_ArealMSHBM_dMSHBM_estimate_group_priors_child(s, mesh, tmp_dir)
%
% This is the child script to estimate group priors for the distributed individual
% areal-level parcellation generation. To speed things up, we parallize the script
% ... |
74c9a26d0fd891fac0eab826cf143afccfa85bd30ff9fdf79e9f7c60dcc4541a | MATLAB | 14,024 | 267 | function cm_data=romaO(m)
cm = [0.451373874666344 0.223458709918417 0.341870799965347
0.454179360348631 0.222444238181896 0.336099154085492
0.456964522293290 0.221583601522335 0.330427574767728
0.459745820461505 0.220901628723239 0.324833950490025
0.462508758064081 0.220345584246605 0.319346410115490
0.465268902882544 ... |
5494ddd366c977b21e7beae434968dd087e9d5fdf83a1a6800d5fbcc257d5a51 | MATLAB | 14,027 | 368 | function ea_lcm(options)
% the order may be crucial since VAT-seeds are resliced in fMRI
if options.lcm.struc.do
% main wrapper for lead connectome mapper runs
if strcmp(options.lcm.seeddef,'vats')
originalseeds=options.lcm.seeds;
options.lcm.seeds=ea_resolvevatseeds(options,'dMRI');
if... |
fdd5a90986443f60548c8eedb48875fb120b3b0749c3bb09e80ab0c7a457ade9 | MATLAB | 14,042 | 342 | function [rt,drr,cte,cfs,edt] = irStats(filename,varargin)
%IRSTATS Calculate RT, DRR, Cte, and EDT for impulse response file
%
% RT = IOSR.ACOUSTICS.IRSTATS(FILENAME) returns the reverberation time
% (to -60 dB) using a method based on ISO 3382-1:2009. The function uses
% reverse cumulative trapezoidal integrat... |
a9fd873e5b540750f499e90a7d3e1ce2a77759f04c3ca5ca212f3ea3ed57223b | MATLAB | 14,043 | 268 | function cm_data=romaO_r(m)
cm = [0.451373874666344 0.223458709918417 0.341870799965347
0.454179360348631 0.222444238181896 0.336099154085492
0.456964522293290 0.221583601522335 0.330427574767728
0.459745820461505 0.220901628723239 0.324833950490025
0.462508758064081 0.220345584246605 0.319346410115490
0.46526890288254... |
3f664f222728b562b76de0d8a77f3daca6d1a11b25b675d27337d9d7cf6cee82 | MATLAB | 14,050 | 267 | function cm_data=Greys(m)
cm = [0.999999999999999 1.00000000000000 0.999999999999999
0.998921286769884 0.998921286712843 0.998921286900039
0.997783943144798 0.997783943036194 0.997783943392610
0.996588863839843 0.996588863684974 0.996588864193220
0.995336944779459 0.995336944583446 0.995336945226716
0.994029083008960 0... |
31d83d0a66acceac42b032e097fe4a1d9481412f100e62425fa326059736aeed | MATLAB | 14,065 | 401 |
%%%Calculate power spectral density and peak theta frequency for each animal.
%%%In a given subregion and frequency range
%%%%Concatenates data across valid time windows.
%animals = {'3xTg136' 'WT162' 'WT78-0' '3xTg75-1' 'WT77-0' '3xTg79-0' 'WT89-0' 'WT98-0' '3xTg77-1' 'WT158' 'WT153' 'WT157' '3xTg125' 'WT126' ... |
a97c5128ce2ab400145c60f1ff86ff8be607ca688cecccbad6272697dde74ab4 | MATLAB | 14,071 | 313 | function obj=set_continuous_color(obj,varargin)
%set_continuous_color Force the use of a continuous color
%scheme
%
% Parameters as name,value pairs:
% 'colormap' set continuous colormap by
% name: 'hot,'cool', or any built-in colormap by name
% 'LCH_colormap' set colormap by Lightness-Chrom... |
fbcaf75756f7e2511fb0c538976009e7c775e8072f073b8af1875aead2d406e1 | MATLAB | 14,074 | 359 | function AutoClustering(fbasename,elec,varargin)
% USAGE:
% clu = AutoClustering(fbasename,elec)
%
% AutoClustering automtically cleans the clu file defined by fbasename and
% electrode numbers. The program will look for the files
% fbasename.fet/res/spk.elec in the current folder.
%
% INPUT:
% fbasename: ch... |
1f37a1cb23f3a27fec6a7bb645a43b78da0e1f5726811d23266629fed2ef7704 | MATLAB | 14,079 | 267 | function cm_data=Blues(m)
cm = [0.968627450980392 0.984313725490196 1.00000000000000
0.964656366161119 0.982499525237751 0.998545304647616
0.960768327516364 0.980670003315503 0.997135974026422
0.956960891280014 0.978825749020644 0.995770494154677
0.953231600456055 0.976967341297978 0.994447353714228
0.949577985409927 0... |
82af203f19ada686605230a8aa99d83ebc7360953b4c23d9a0be908b1a1f77b7 | MATLAB | 14,121 | 326 | function tracksReform = removeSplitMergeArtifactsChronological(tracksIn,thresholdTime)
%REMOVESPLITMERGEARTIFACTSCHRONOLOGICAL removes potentially artifactual merges and splits, resulting for instance from detection false positives
%
% SYNOPSIS tracksReform = removeSplitMergeArtifactsChronological(tracksIn,thresholdTim... |
e0f25cd1035f0df565b9d80bb3dc87161317d2cd012aae12afbb143ea1035b0e | MATLAB | 14,121 | 363 | function [data,stats] = PhasePrecession(positions,spikes,phases,varargin)
%PhasePrecession - Compute spike phase precession.
%
% Compute spike phase precession using the methods of O'Keefe and Recce (1993),
% i.e. spike phase vs position, and Harris et al. (2002), i.e. spike phase vs
% spike rate. Single-lap phase pre... |
efd0b5eebe55b07744b2c126aab22aafacec89551f62c213dc82679fd5fafc5d | MATLAB | 14,124 | 382 | function spm_reslice(P,flags)
% Rigid body reslicing of images
% FORMAT spm_reslice(P,flags)
%
% P - matrix or cell array of filenames {one string per row}
% All operations are performed relative to the first image.
% ie. Coregistration is to the first image, and resampling
% of images i... |
f49a1da84b3fb6cfa3f98d9d0f90ebedb4ef12cc4cb67a4192e48bb02a49b78b | MATLAB | 14,124 | 285 | function eps2pdf(source, dest, crop, append, gray, quality, gs_options)
%EPS2PDF Convert an eps file to pdf format using ghostscript
%
% Examples:
% eps2pdf source dest
% eps2pdf(source, dest, crop)
% eps2pdf(source, dest, crop, append)
% eps2pdf(source, dest, crop, append, gray)
% eps2pdf(source, de... |
1d6cd69e1aa1c390d90041a0d86f3c3c2413d608336d1b68432f297ac91093ec | MATLAB | 14,174 | 319 | % std_centroid() - compute cluster centroid in EEGLAB dataset STUDY.
% Compute and store the centroid(s) (i.e., mean(s))
% for some combination of six measures on specified
% clusters in a STUDY. Possible measures include: scalp
% maps, ERPs, spectra,... |
7419b7d0cf788b0f998e2811bb2a92b98e635aa6129d5d526275ab8d0a7e872f | MATLAB | 14,183 | 476 | % Example script that combines cell and ms2 tracking to enable cluster-by-cluster
% analysis
%% requires ReadImageJROI from File Exchange
%% Dylan Muir (2026). ReadImageJROI (https://github.com/DylanMuir/ReadImageJROI), GitHub.
close all
clear all
%% Set Parameters and Select Window Folder
cluster_name = 'Window1Cl... |
16376fa4856a47e265bf9fe64b648848e690d5a5103b574aba635b8f5e8ae719 | MATLAB | 14,204 | 411 | function [phi_sample,B,BD] = splineCountsMCMC(T,data_trajectories,total_count_norm,biomass_norm,scaleFactor,intervene_matrix_filtered,params,nodeNum)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series da... |
97326382ecdf370574191d839a81752aeeed894f3ffe19870564e7a23114d120 | MATLAB | 14,209 | 543 | ccc;
%% Locate daily ratio-combined stat files
STATPATHs = dir("..\MAT Data\granger result stat\PE\[150-250] gamma\single\**\7-10Freq Active\**\*.mat");
STATPATHs = arrayfun(@(x) fullfile(x.folder, x.name), STATPATHs, "UniformOutput", false);
STATPATHs = STATPATHs(:);
if isempty(STATPATHs)
error("No stat files fo... |
0001e0a07d74cbb5d3b591ddf92017aa8dd45b17560db9161f7faaf77a5269cb | MATLAB | 14,210 | 396 | function out = run_absorption_estimation(muA_file, nirsmodel_path, mesh_mat, beta_file, layout_file, opts)
%RUN_ABSORPTION_ESTIMATION Estimate spectral absorption magnitude from reconstructed Δμa and measured GLM betas.
%
% out = fnirspower.pipeline.run_absorption_estimation( ...
% muA_file, nirsmodel_path, m... |
b5fbe53011f1127f08b5d8549ed554cb1b3f41a2b1d71f88fd287a31ab46ec7a | MATLAB | 14,222 | 395 | % Calcium imaging + flight behavior script
% FIRST,
% process the metadata as usual:
% [out filenames] = AF_OF_importer('230511','f3e1');
% fly = AFOFdata_struct_CL(out,filenames); % for exp7
% fly = AFOFdata_struct_CL_2(out,filenames); % for exp8
% fly = AFOFdata_struct_CL_3(out,filenames); % for exp9
% etc.
... |
b3b51d915c6225f90b2235915191c4d20052f9b2a4a066d41c891f041cb43752 | MATLAB | 14,241 | 346 | function varargout = ea_lg_3dsetting(varargin)
% EA_LG_3DSETTING MATLAB code for ea_lg_3dsetting.fig
% EA_LG_3DSETTING, by itself, creates a new EA_LG_3DSETTING or raises the existing
% singleton*.
%
% H = EA_LG_3DSETTING returns the handle to a new EA_LG_3DSETTING or the handle to
% the existing si... |
f411536b96b78aad8e9866d552d8f39c1d061af18c5e73230dfc95ecfa6cc7b6 | MATLAB | 14,245 | 337 | %% calculate "phase precession" as the difference between instantaneous frequency of spike train and LFP
%Adapted by Lauren Vetere from code by Antonio Fernandez Ruiz
%NOTE: In the manuscript, the spike frequency from this script was used and
%compared to the LFP frequency calculated elsewhere using a more acc... |
695e25aab6123f58e456b0be5a9104da74308a97949c15cb788b026741041026 | MATLAB | 14,268 | 436 | function varargout = cvx_version( varargin )
% CVX_VERSION Returns version and environment information for CVX.
%
% When called with no arguments, CVX_VERSION prints out version and
% platform information that is needed when submitting CVX bug reports.
%
% This function is also used internally to return use... |
985c178490c18f9b1b3466870bee70cff4e4739bb047bcb8cfaac064bc3a36c8 | MATLAB | 14,276 | 267 | %% PolynomialElectrodeModel - Class representing a (potentially curved) electrode
% represented by a fitted polynomial ([0,1] -> R^3)
%
% Andreas Husch
% Centre Hospitalier de Luxembourg, Dep. of Neurosurgery /
% University of Luxembourg - Luxembourg Centre for Systems Biomedicne
% 2014 - 2017
% mail@andreashusch.de, h... |
f084f96c0b05bf7a1d3bc4d893fcddcbfe86799eabec8ca6e6a98a7726f819c2 | MATLAB | 14,296 | 328 | function [compTracksOut] = aggregStateFromCompTracksMIQP(compTracks,intensityInfo,numFramesInt)
%AGGREGSTATEFROMCOMPTRACKSMIQP recovers particle oligomeric states from compound tracks by solving a mixed-integer quadratic programming problem (MIQP)
%
%SYNOPSIS compTracksOut = aggregStateFromCompTracksMIQP(compTracks,int... |
0f868d682205af6f61b26cab81140876918ff7eb010fc4d7267c865544d9a6c6 | MATLAB | 14,318 | 326 | %% LaBGAScore_firstlevel_s2b_phMRI_covar_contrasts.m
%
%
% *USAGE*
%
% This scripts performs first-level model contrast definition and estimation
% for covariance analysis with a set of covariates, including spline
% interpolation
%
% It needs to be run after first-level model definition and estimation using
% LaBGAS... |
4f7d0d94dbc2c399ddaa46703da411ada866ff4008f3bc382f1c5649b2c9ab5b | MATLAB | 14,346 | 299 | % pop_chanevent() - import event latencies from the rising and/or falling 'edge'
% latencies of a specified event-marker channel in EEG.data
% Usage:
% >> OUTEEG = pop_chanevent( INEEG ); % select parameters via a pop-up window
% >> OUTEEG = pop_chanevent( INEEG, chanindices, 'key', 'val' ... );... |
999daf246aeefc04e6103d8a8b01713d34df2aa3b1abb78e666f2d675aba2d4e | MATLAB | 14,357 | 404 | function [B,ndx,dbg] = natsort(A,rgx,varargin)
% Natural-order / alphanumeric sort strings or character vectors or categorical.
%
% (c) 2012-2022 Stephen Cobeldick
%
% Sorts text by character code and by number value. By default matches
% integer substrings and performs a case-insensitive ascending sort.
% Options to s... |
7d189fede079064e8892b5066cdb79b26056a97bbce5e47d03415765d6b5d122 | MATLAB | 14,361 | 377 | function NEV = F_openKilosort(fileDir, varargin)
% read spike data from Kilosort and return file data in NEV file structure
% Sorted with Kilosort first!!!!!!
% V1.0 adapted from CortexLab scripts "loadKSdir"
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% INPUT:
% fileDir - kilosort results are in this folder... |
01eb1e8dde53dadbe6123bb810e4194faa776890bf89c40569be18adc8272892 | MATLAB | 14,374 | 361 | cd([ea_getearoot, '/ext_libs/OSS-DBS/sEEG'])
%% Inputs
subjs = {'/home/forel/Documents/data/JB_project/JBK/localized_medtronic_rotated/sub019'};
anchor = 'T1';
removeElectrodeFromRF = true;
space = 'mni';
BIDS_format = false;
cleanup = true; % otherwise some large .nii files might remain
Segment_SVD = false;
regener... |
6016559310ecb3ce682a9e09cb945648b04f01ec06d88f43ac8ea8262fc07a40 | MATLAB | 14,378 | 607 | function result = Clustering8Measure(Y, predY)
% {'ACC','nmi','Purity','Fscore','Precision','Recall','AR','Entropy'}
if size(Y,2) ~= 1
Y = Y';
end;
if size(predY,2) ~= 1
predY = predY';
end;
n = length(Y);
uY = unique(Y);
nclass = length(uY);
Y0 = zeros(n,1);
if nclass ~= max(Y)
for i = 1:nclass
... |
ffe3296c7941cc4bd3a2f5a293a310766f48970a630debb02c1d7a2152485cb5 | MATLAB | 14,400 | 369 | % std_specgram() - Returns the ICA component or channel spectrogram for a dataset.
% Saves the spectra in a file.
% Usage:
% >> [spec freqs] = std_specgram(EEG, 'key', 'val', ...);
%
% Inputs:
% EEG - a loaded epoched EEG dataset structure.
%
% Optional inputs:
% 'components' - [nume... |
36afec57feab413e772624b2cf1d5d65f6a721659964021fb22a2382197aa82b | MATLAB | 14,415 | 480 | % Imbed Zoom, Interp, and Info menu to view_nii window.
%
% Usage: view_nii_menu(fig);
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%--------------------------------------------------------------------
function menu_hdl = view_nii_menu(fig, varargin)
if isnumeric(fig)
menu_hdl = init(fig);
retur... |
6afce6241941636341eeb1d9f7067ec8c9e1fecf4979c48e5b89b00feefe6f08 | MATLAB | 14,420 | 297 | % std_topoplot() - Command line function to plot cluster component and mean scalp maps.
% Displays either mean cluster/s scalp map/s, or all cluster/s components
% scalp maps with the mean cluster/s scsalp map in one figure.
% The scalp maps can be visualized only if ... |
e246feaab8be2e6cee2fac81bc267e6e93c74416a74331ce8cbb02df1badd156 | MATLAB | 14,423 | 726 | function gmsh_to_fem ( prefix )
%*****************************************************************************80
%
%% MAIN is the main program for GMSH_TO_FEM.
%
% Discussion:
%
% GMSH_TO_FEM converts mesh data from GMSH to FEM format.
%
% Usage:
%
% gmsh_to_fem prefix
%
% where 'prefix' is the common filen... |
40756269687e8cd213cf8fed2aff21bb03c5321e90a54f506b8d09493e56a968 | MATLAB | 14,435 | 373 | % pop_loadset() - load an EEG dataset. If no arguments, pop up an input window.
%
% Usage:
% >> EEGOUT = pop_loadset; % pop up window to input arguments
% >> EEGOUT = pop_loadset( 'key1', 'val1', 'key2', 'val2', ...);
% >> EEGOUT = pop_loadset( filename, filepath); % old calling format
%
% Optional inputs:
% 'f... |
9c9279c52f1046cdbc5db3060eef9039cbb70352c3f91d59b017dd05e7f68c38 | MATLAB | 14,450 | 313 | % pop_rejcont() - reject continuous portions of data based on spectrum
% thresholding. First, contiguous data epochs are extracted
% and a standard spectrum thresholding algorithm is
% applied. Regions of contiguous epochs larger than a
% specified siz... |
ff102d2c6cb33521f5ed0b6ac76daee71bab464210cf88d3dc7d4055c06b4884 | MATLAB | 14,451 | 428 | function CFA_template(H)
% function CFA_template
movegui(H.fig,'west');
pathss = which('CFA_template.m');
[pth nam ext] = fileparts(pathss);
ParaSavedir = [pth,filesep,'IOparameter',filesep];
Htemp.ParaSavedir = ParaSavedir;
Htemp.fig = figure('unit','norm',...
'pos',[0.2,0.2,0.6,0.6],...
'menubar','none',...... |
06cf4bb3a8c88e2f3f8868bbe7538a8ff9c9627711df8c41601fe154bd610c47 | MATLAB | 14,453 | 344 | function CBIG_ArealMSHBM_generate_radius_mask(lh_labels, rh_labels, mesh, radius, out_dir, lh_distance, rh_distance)
% CBIG_ArealMSHBM_generate_radius_mask(lh_labels, rh_labels, mesh, radius, out_dir, lh_distance, rh_distance)
%
% This function will be used to generate radius mask for parcels from a given group-level ... |
9b626819ab4a5f978236cde7e771681770b8006c1eb1c223788ea48e9fba2c5f | MATLAB | 14,489 | 335 | function SleepState = SleepScoreMaster(basePath,varargin)
%SleepScoreMaster(basePath,<options>)
%This is the master function for sleep state scoring.
%
%It's strongly recommended that you
% 1) indicate bad (noisy) channels using bz_getSessionInfo(basePath,'editGUI',true)
% before running SleepScoreMaster.
% 2... |
d89f40a74e45a2c28ceb636345bf838e14295a81b18cae76a2aeddffc4196087 | MATLAB | 14,490 | 386 | %% plot trimer raw projection
StdTrimALL = [];
fns = fieldnames(IndivTrimersRAW)
%% options
colorscheme = 3; %1 = green, 2 = purple, 3 = grey
PlotTrimer3D = false;
PlotContours = false;
PlotDensityAllTrimers = false;
%Selected examples to plot
% CTL
selectedIndices = [22 58 88 86 85 82 80 111];
%... |
86f6b83359c74cd3bfe1a55961641c23e562b615b08a89508f72f485dc27e45b | MATLAB | 14,501 | 494 | 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... |
2d31465814386122a1442a7a79fc8c433e121db3c09365457f8e2b252c8987ce | MATLAB | 14,509 | 345 | % 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... |
a40d517054152c7c0ab8c2a98145cf7b1ed43067e365e8f57dd66322d3d2a624 | MATLAB | 14,537 | 314 | function [positionDecodingMaxCorr] = bz_positionDecodingMaxCorr(varargin)
% USAGE
% [] = bz_positionDecodingMaxCorr()
%
% INPUTS
%
% spikes
%
% behavior
%
% lfp
%
% smoothingRange
%
% plotting
%
% saveMat
%
% OUTPUTS
%
% positionDecodingMaxCorr cellinfo struct with the following fields
% ... |
bd83a665ab4873556a0f21f54461d7ee67b41d9425a5bf10ee7e2270a03341d4 | MATLAB | 14,553 | 349 | %% PIPELINE: NoRMCorre (motion correction) and FISSA
clearvars;close all;clc;
prompt = {'Enter data path for a single animal:',...
'Stimulus file stamps? (eg AA0000AAAA_00000_00001_Pulses.mat for each tif: yes=1, no=0):'};
definput = {'F:\PV_2P_Data_Extraction\Mouse#PV14\PV14_NEday10\BroadBand','0'};
answer ... |
07d573bdb66e378575549e6082456d7002f04a83a960b5bfc6ce6f87d2e2af3f | MATLAB | 14,567 | 457 | % signalstat() - Computes and plots statistical characteristics of a signal,
% including the data histogram, a fitted normal distribution,
% a normal ditribution fitted on trimmed data, a boxplot, and
% the QQ-diagram. The estimates value are printed in a panel and
%... |
f49192b9b2e6c61f36b8609cb30cb17247290594fc39e1e738102603a65d1752 | MATLAB | 14,568 | 486 | function CFA_Checkandrun(H)
% function CFA_Checkandrun
pathss = which('CFA_Checkandrun.m');
[pth nam ext] = fileparts(pathss);
IOsetupdir = [pth,filesep,'IOparameter',filesep];
iosetup = dir('SetUpPara.mat');
if isempty(iosetup)
iosetup = dir([IOsetupdir,'SetUpPara.mat']);
if isempty(iosetup)
[fil pg] =... |
ab8c03b8518a57dd230f110771077b711c0f551676cd5c985277d3eee0c19649 | MATLAB | 14,580 | 419 | function [data] = SEV2mat(SEV_DIR, varargin)
%SEV2MAT TDT SEV file format extraction.
% data = SEV2mat(SEV_DIR), where SEV_DIR is a string, retrieves
% all sev data from specified directory in struct format. SEV files
% are generated by an RS4 Data Streamer, or by enabling the Discrete
% Files option in t... |
77f10a3918598cfeeb0a8f7c0e0dcfc6f28df01666baa0cd2f6e05f893602628 | MATLAB | 14,598 | 378 | function [sens] = ft_read_sens(filename, varargin)
% FT_READ_SENS read sensor positions from various manufacturer specific files. The
% following acquisition system and analysis platform file formats are currently
% supported:
%
% asa_elc besa_elp besa_pos besa_sfp yokogawa_ave yokogawa_con yokogawa_raw 4d
% 4d_pd... |
d799cdc7eb702300548030c77357ef3ff0b0002c8759970f87afdecf82e2b058 | MATLAB | 14,603 | 383 | classdef ea_explorer_roi < handle
% ROI class to plot niftis on lead dbs resultfig / 3D Matlab figures
% example:
% figure; pobj.openedit=1; ea_roi([spm('dir'),filesep,'toolbox',filesep,'OldSeg',filesep,'grey.nii'],pobj); a=light; axis('off','equal')
% A. Horn
properties (SetObservable)
nif... |
8f352ca8ff4800ed2ca1cc517bf2e3d6930ecbbdd9150fed93fee73124963811 | MATLAB | 14,615 | 398 |
function [behavior] = linearizeArmChoice(varargin)
% Linearize behavior and add relevant events, acording to the euclidean distance to a virtual maze
%
% USAGE
%
% [behavior] = linearizeArmChoice(varargin)
%
% INPUTS
% (OPTIONAL)
% basePath -(default: pwd) basePath for the recording file, in
% ... |
2b4c416008bb25be1f95e38abff667d8e42e2f8d2188399c00ae69e1878400b9 | MATLAB | 14,619 | 283 | function params = CBIG_hMRF_set_params(lhrh_avg_file, output_folder, varargin)
% params = CBIG_hMRF_set_params(lhrh_avg_file, output_folder, varargin);
% This function parses the input parameters into the output Matlab struct `params`.
% All input arguments are optional; if not specified, the argument would be configu... |
3faf5eab2c5bd44d0b2e5d2d099d804ff1f4cc8cf23fb32aebe999d02484ad14 | MATLAB | 14,629 | 449 | function [modindex, thetarange, gammarange, powPhsDists, bincenters, partial] = thetaModGamma(self,varargin)
% Computes the phase modulation of gamma by theta
% using the method described by Tort et al (2010) J Neurophys.
% In short, it computes the
% entropy in the histogram of powers over phases.
%
%
% INPUT ARGS
% ... |
c0004beaa51c8027b13ac67fa00dd2c90527e2a5b92c53edb219bd6dddd0234e | MATLAB | 14,648 | 402 | function varargout = SpineTrace_IndividualMovie(varargin)
% Last Modified by GUIDE v2.5 06-Feb-2024 16:10:52
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Sp... |
fe0454122dd560e868495c71250550821b18dd94f80f1f440b7f8a41a5f58986 | MATLAB | 14,657 | 312 | % pop_rejspec() - rejection of artifact in a dataset using
% thresholding of frequencies in the data.
% Usage:
% >> pop_rejspec(INEEG, typerej); % pop-up interactive window mode
% >> [OUTEEG, Indices] = pop_rejspec( INEEG, typerej, 'key', val, ...);
%
% Pop-up window options:
% "Electrode|Componen... |
377ab8e21ee7d759bb1586033a08ff5066c154e3ef65034ac8c43810cda3b59e | MATLAB | 14,667 | 317 | %% ============================================================
% Wrapper script for WT and Shank3 structured outputs
%% ============================================================
clear; clc; close all;
%% ---------------- Shared settings ----------------
corr_threshold = [0.15 0.15];
neuron_chosen_signal = 0;
%% ... |
23d3d035cdf84ada5b77f61390ed74c9805963728d406979678174fea1ea34de | MATLAB | 14,682 | 266 | function chosenfluor=crossgenotuning(chosenfluor,chosenred,chosenROIs,chosentemps,chosenFrameRate)
%maybe ask it to skip some ROIs that clearly don't fit?
fig=figure('Position',[1 1 509 458]);
hold on;
fig2=figure('Position',[509, 1, 500, 200]);
fig3=figure('Position',[509, 200, 500, 200]);
fig4=figure('Position',[509... |
8dffeaf40883820dc65b104ec1fbe03a5e12ebe1d040d2cf8923d1b419b4a23c | MATLAB | 14,720 | 391 | %% Multivariate prediction of a continuous outcome
%%
% This walkthrough uses the |predict()| method for fmri_data objects to
% predict a continuous outcome using cross-validated principal component
% regression (PCR / LASSO-PCR).
%
% The |predict()| method can run multiple algorithms with a range of options.
% The m... |
96e113a5a4680f7286f79d66ab20b8c17ce80fce0f29fd67d6b0c8e299630bd4 | MATLAB | 14,725 | 258 | % timefdetails() - details of the timef() function for time/frequency analysis
% of multiple epochs of single-channel event-related data.
%
% Global Description:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% timef() performs normalized time/frequency averaging using eithe... |
1dc39286fed3dc4a25dea09c752756661e05e87701d3d40595c444362783a2e4 | MATLAB | 14,732 | 121 | %EEGLAB graphic interface functions (popfunc folder):
% <a href="matlab:helpwin eeg_addnewevents">eeg_addnewevents</a> - Eeg_addnewevents() Add new events to EEG structure. Both EEG.event and...
% <a href="matlab:helpwin eeg_amplitudearea">eeg_amplitudearea</a> - Resamples an ERP average using spline interpola... |
f3189bb4fc4ea77d70d2c690e719f9495c9ac0e76e38c18976f6a288e2ab3a0e | MATLAB | 14,756 | 468 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [img,hdr] = load_untouch_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB,slice_idx)
if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var')
error('U... |
337767a40eaa977849d180b192b7125252be2c2e36831a6f8843e120efdb68fe | MATLAB | 14,758 | 286 | % pop_icathresh() - main menu for choosing threshold for component
% rejection in EEGLAB.
%
% Usage:
% >> [OUTEEG rej] = pop_icathresh(INEEG, threshval, rejmethod,
% rejvalue, interact);
%
% Inputs:
% INEEG - input dataset
% threshval - values of t... |
d6d9a124cdad282289da139cf088a1b7ea0243606940ba0fa79d24c02968f654 | MATLAB | 14,770 | 243 | %% Demonstration code for the spike sorter derived from the Fee et al.
%% (J. Neurosci Meth (1996) 69: 175-88) algorithm. Requires Matlab
%% version 6.1 or later and the Statistics Toolbox.
%% Last Modified: 8/13/06
%% samar mehta, sbmeh... |
d477da1eaedef8a0cb9153051295ba73899df1b3cfd0d5e79ccbeb5e84f3e5dc | MATLAB | 14,776 | 406 | function hh = ploterr(x, y, xerr, yerr, varargin)
%PLOTERR General error bar plot.
%
%
% Usage for the impatient
% =======================
%
% X, Y: x and y axis values
% xerr, yerr: if matrix relative error
% if cell array lower and upper bound
% LineSpec as in plot. If passed it must be betw... |
864484fc16fce0badf3730b48d557df0d1ea7a960c9d5d22a24f151f98ce7f13 | MATLAB | 14,815 | 393 | % ====================================
%% Help
% ====================================
%
% CBIG_test_MSHBM_Epilepsy
%
% This script tests the MS-HBM model on 14 drug-resistant epilepsy subjects
% from the National Institutes of Health (NIH) dataset using leave-one-run-out
% cross-validation. For each subject, individual... |
24a3c778ded0bb880bd0b8d72a8d7d7783be281a25d8f1cc161f277cda29e6b7 | MATLAB | 14,824 | 267 | function prams=CBIG_gwMRF_set_prams(varargin)
% This function sets the prams file, either from default values or from the input varargin
% some variables and their explenation and/or possible setting.
% If not other specified 1 means true and 0 means False.
%
%
% Input
%
% - start_i... |
9c0693f59ada7fb0449ca8a88e703893bc39e1be587ba3f50508daa6232e9aeb | MATLAB | 14,843 | 392 | function [result,msg] = eps2xxx(epsFile,outFormats,fullGsPath,orientation)
%EPS2XXX Converts an eps file to one or several other formats using GhostScript (GS)
%
% [result,msg] = eps2xxx(epsFile,outFormats,fullGsPath,orientation)
%
% - epsFile: eps file name to be converted to outFormats
% - outFormats... |
9d33427073571250b89f028297e511d86fd1706c0bada57c4ca0fc11b673cf79 | MATLAB | 14,853 | 362 | % std_plottf() - plot ERSP/ITC images a component
% or channel cluster in a STUDY. Also allows plotting scalp
% maps.
% Usage:
% >> std_plottf( times, freqs, data, 'key', 'val', ...)
% Inputs:
% times - [vector] latencies in ms of the data points.
% freqs - [vector] frequencies in H... |
faafb8728aa94d896349284b95d03aa7b81bf29c7ba5cc3eb7a2b5cbc843337d | MATLAB | 14,856 | 373 | function cvx_setup( varargin )
% CVX_SETUP Sets up and tests the cvx distribution.
% This function is to be called any time CVX is installed on a new machine,
% to insure that the paths are set properly and the MEX files are compiled.
global cvx___
try
cvx___ = [];
squares = {}; %#ok
nret = fals... |
2c41bc42e108206262ed74d41e44efce1b8704bde14543223238b28aa11e158d | MATLAB | 14,857 | 493 | % Test routine for mtimesx, multi-dimensional speed and equality to MATLAB
%******************************************************************************
%
% MATLAB (R) is a trademark of The Mathworks (R) Corporation
%
% Function: mtimesx_test_nd
% Filename: mtimesx_test_nd.m
% Programmer: James Tu... |
d2d278b2250a3057358a88cd05ee620cd54fa500814da7cbf6759611e4fe0f0b | MATLAB | 14,882 | 126 | %EEGLAB signal processing functions (sigprocfunc folder):
% <a href="matlab:helpwin acsobiro">acsobiro</a> - A. Chickocki's robust Second-Order Blind Identification (SOBI)...
% <a href="matlab:helpwin adjustlocs">adjustlocs</a> - Read neuroscan polar location file (.asc)...
% <a href="matlab:he... |
b9626e73fce6c853c52c272134d5417c34bf9a4f2eebc0f5a670f55ef69317c5 | MATLAB | 14,888 | 290 | function [qMetric, unitType] = runAllQualityMetrics(param, spikeTimes_samples, spikeClusters, ...
templateWaveforms, templateAmplitudes, pcFeatures, pcFeatureIdx, channelPositions, savePath)
% JF
% ------
% Inputs
% ------
% param: parameter structure. See bc_qualityParamValues for all fields
% and informa... |
a23db28888dc7f542bb54ce14f3f5578592e53652d0ecbe0364d054383d8576e | MATLAB | 14,890 | 350 | function [compTracksAlt,compTracksDef] = convTrackFormatDefault2Alt(compTracks,simultFlag)
%CONVTRACKFORMATDEFAULT2ALT converts compound tracks from default format to alternative format
%
%SYNOPSIS compTracksAlt = convTrackFormatDefault2Alt(compTracks)
%
%INPUT compTracks : Compound tracks, in the format of tracksFi... |
ed0c3e997b2ae49a9afaaa36d8c4e2b2edac04101f679e08510cfe7c2586ac0b | MATLAB | 14,894 | 417 | function [discreteStack, continuouStack] =...
getStacks(spT,alignP,ONOFF,timeSpan,fs,fsLFP,consEvents,varargin)
% GETSTACK returns a stack of spikes aligned to a certain event ''alignT''
% considering the events in the cell array ''consEvents''. The alignment
% can be done with the on-set or the off-set of the trig... |
5b2e8bd7387c23fc9b9105fbdc2bb132884cc298603f4a3d0a786213ffe48898 | MATLAB | 14,895 | 402 | function [tfce_dat, p_img, info] = group_tfce_from_subject_maps( ...
fmri_dat_subj, design, group, covariates, nPerm, varargin)
% group_tfce_from_subject_maps Group-level TFCE permutation inference.
%
% Group-level TFCE permutation inference starting from subject-level
% contrast images, with optional Freedman-Lane... |
00f7e957b2077803bbc891aa6f015f7c52c966a3d30a76ae9c0401ea737a0e63 | MATLAB | 14,906 | 546 | classdef Text < matlab.mixin.SetGet
%uix.Text Text control
%
% t = uix.Text(p1,v1,p2,v2,...) constructs a text control and sets
% parameter p1 to value v1, etc.
%
% A text control adds functionality to a uicontrol of Style text:
% * Set VerticalAlignment to 'top', 'middle' or 'bottom'
... |
b848f0eb6c3b4201b2febcac98f41263090ad87584333e8582cbb7a6e1ee3bf7 | MATLAB | 14,917 | 296 |
%For each animal and frequency
%This function calculates average power during running, during running
%using threshold for running speed, and during non-running.
%Also finds difference between power during running vs. non running.
%Repeats for each layer, and time window, plus calculates a value that is
%average... |
5fe1e72f5ccaf3e99b757e59404089eeb0976d0aa20a9f10c09de89b121c4404 | MATLAB | 14,920 | 473 | function [control_f, f] = VisualizeLFP(self)
% GUI for visualizing LFP properties
% load all LFP files into object with waitbar if not already loaded
% if load_lfp && length(self.b_lfp)~=length(self.path_lfp)
% hwaitbar = waitbar(0,'Loading LFP data...');
% for i = 1:length(self.path_lf... |
c7b43a9f9da3229629424c7c6fcd9554758ff9c5f82aa581d33a0eab2a19c3cb | MATLAB | 14,938 | 295 | function [boxedSpeckleList, boxedSpeckleMean, actinPropPerTimeBoxed, spkImg, boxedSpeckleSum, spkIdPerBox] = ...
gridActinPropPerTimeInt(actinPropPerTimeInt, speckleField, varargin)
% GRIDACTINPROPPERTIMEINT: split movie frame into non-overlapping boxes and get speckle information within each box
%
% SYNOPSIS: [box... |
2963b9f5712862eaddd2619afc2995429233c59528ec62220ab8dcabda065345 | MATLAB | 14,950 | 360 | %% LaBGAScore_prep_graphvar_input_from_conn.m
%
%
% *USAGE*
%
% This script creates the necessary input files for graph theoretical
% analysis with the GraphVar toolbox from ROI-to-ROI connectivity analysis
% performed with the CONN toolbox
%
% NOTE: this script is not based on LaBGAS standard data structure for fmri
%... |
5ca89cebdf6cdfa0480362ab6696f8bc3ee3368a53a268f663a5b73ff7aa7d5f | MATLAB | 14,986 | 430 | function [ripples] = bz_FindRipples(varargin)
%FindRipples - Find hippocampal ripples (100~200Hz oscillations).
%
% USAGE
% [ripples] = bz_FindRipples(lfp.data,lfp.timestamps,<options>)
% OR
% [ripples] = bz_FindRipples(basepath,channel,<options>)
%
% Ripples are detected using the normalized squared signal... |
ea9371da36e76595fd562fd8e6a6474d7a6f0918d6efbb1df98c3ca51cd3ac9c | MATLAB | 14,995 | 364 | %% LaBGAScore_secondlevel_roi_run_plot_PLSR_pipeline.m
%
%
% *USAGE*
%
% This script serves as a simple wrapper to run the PLSR (PLS regression)
% neuroimaging pipeline function and its plotting function on fMRI ROI
% data saved by the prep_3a_run_second_level_regression_and_save script.
%
% To control for covariates, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.