sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
92cf4bbd8c82ec386bb8159fe302e53125fcd6c71772915143059de7db101c92 | MATLAB | 3,525 | 96 | function newdata=struct2jdata(data,varargin)
%
% newdata=struct2jdata(data,opt,...)
%
% convert a JData object (in the form of a struct array) into an array
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
% data: a struct array. If data contains JData keywords in the first
% level children, th... |
01b9bd514f351adce1f9d1909013e3418d62aa076e5ea9da8392a4d2937606bd | MATLAB | 3,527 | 92 | % POP_COMPAREERPS - Compare the (ERP) averages of two datasets.
%
% Usage:
% >> pop_compareerps( ALLEEG, datasetlist, chansubset, title);
% Inputs:
% ALLEEG - array of datasets
% datasetlist - list of datasets
% chansubset - vector of channel subset
% title - plot title
%
% Author: Arnaud Delo... |
105fb8cf3d340fd92b17c67f7c1ab936e67766132c77d1277ff8c8e124744e2c | MATLAB | 3,529 | 99 | % Script preprocessing
% Example of fMRI preprocessing - input for model estimation demo
%
% preprocessing
%
%
% See also
% Author: Saskia Bollmann & Lars Kasper
% Created: 2018-05-03
% Copyright (C) 2018 Institute for Biomedical Engineering
% University of Zurich and ETH Zurich
%
% This file ... |
b832fc04ad78b5cf230b96cdc1a1bdc361abafbaffe6f85a35385acbfbb86618 | MATLAB | 3,529 | 88 | % [Generalized Eigenvalue De-Artifacting Intrument (GEDAI)]
% PolyForm Noncommercial License 1.0.0
% https://polyformproject.org/licenses/noncommercial/1.0.0
%
% Copyright (C) [2025] Tomas Ros & Abele Michela
% NeuroTuning Lab [ https://github.com/neurotuning ]
% Center for Biomedical Imaging
% ... |
83bc85d5b4a35ce43bb5edb1409abc3c59ba7d7046cea6b50af0a0b6fc493dcb | MATLAB | 3,530 | 106 | % you can call it with all the required variables set.
% it'll translate it to some kind of fieldtrip format
% and then utilize the m_do_ functions to do the actual correction.
% you can also call this without any parameters, but with only a single
% input varable: the data. this must in any case be given.
% the e... |
ff0d4b8d150e36ab1f38b5cbcb5c2533ccb5d74ad9b17764722722c3f7f382d0 | MATLAB | 3,530 | 127 | function test96()
% function test96()
% Low-rank Euclidena distance matrix completion
%
% We use the tuned geometry, symfixedrankNewYYquotientfactory to solve the
% EDMCP. This test file is different from test file 'test97'
%
% This file is part of Manopt: www.manopt.org.
% Original author: Bamdev Mishra, Dec. 30, 20... |
99941e5756d237bda45c89fd5ba0b81c1b6b92787dc468affc65ec33b80c3f76 | MATLAB | 3,534 | 98 | function varargout = bids_tsv(filename, hdr, begsample, endsample, chanindx)
% BIDS_TSV reads time series data from a BIDS tsv and json file pair. This can for
% example be used to read the header and data from physio and stim files.
%
% Use as
% hdr = bids_tsv(filename);
% dat = bids_tsv(filename, hdr, begsample,... |
346696365b7d61ad53c4d6a5c91932f63bc336d976cc382d54c0f6dd414e583b | MATLAB | 3,536 | 94 | function out = CO_TC3(y, tau)
% CO_TC3 Normalized nonlinear autocorrelation function, tc3.
%
% Computes the tc3 function, a normalized nonlinear autocorrelation, at a
% given time-delay, tau.
% Statistic is for two time-delays, normalized in terms of a single time delay.
% Used as a test statistic for higher order c... |
fae1ab6b114ed3e900bae7b490e8e11ae955aea0555fcde956df9c0054d4ada5 | MATLAB | 3,537 | 94 | function out = CO_Embed2_AngleTau(y, maxTau)
% CO_Embed2_AngleTau Angle autocorrelation in a 2-dimensional embedding space
%
% Investigates how the autocorrelation of angles between successive points in
% the two-dimensional time-series embedding change as tau varies from
% tau = 1, 2, ..., maxTau.
%
% ---INPUTS:
% y, ... |
022d20ca653e34b8ea4fd3384ee81429f6d175090e89632b8154ccd0bbcb1019 | MATLAB | 3,538 | 91 | function [ModelOutput] = fit_waterOspreyParamsToModel(inputData, inputSettings, fitParams)
% This function applies a set of Osprey fit parameters to a water basis
% set.
%
% The function returns the complete fit, the residual, the water data
% that are being fit, and the frequency axis.
%
% USAGE:
% [Mo... |
7d92bab45d7c69b2f5bac6a6cc4732bb8eba71c50e43b37f06a090b432cb6e5f | MATLAB | 3,540 | 112 | function [b, tau, er, exp_t_1_coeff, stats, bestfit, bint] =...
regress_latency_vs_rew(A, nback, plotarg,...
z_arg, hit_arg, blk_arg, varargin)
% regress_latency_vs_rew - regresses trial initiation time against previous
% rewards, a la Wang/Uchida 2013.
% INPUTS:
% A - Rat behavioral data. E.g., BestFitEar... |
1c904212dba257ebd42b96f4a01288a2b7bf723e7dfdfbc268f0a41454b4742f | MATLAB | 3,541 | 104 | function fear_shockTrigCoact_opt_meanShift(basename,varargin)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
% basename='~/data/Fear/triple/booyah180430/booyah180430';
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
... |
237ee62b59c36d8ae4db61151390a419ea10c90f86fd1dc63abf91b6ad6236ca | MATLAB | 3,541 | 89 | function varargout = TMSUtility_GUI(varargin)
% TMSUTILITY_GUI M-file for TMSUtility_GUI.fig
% TMSUTILITY_GUI, by itself, creates a new TMSUTILITY_GUI or raises the existing
% singleton*.
%
% H = TMSUTILITY_GUI returns the handle to a new TMSUTILITY_GUI or the handle to
% the existing singleton*.
%
... |
6245a5272769fefe4087a1de3578e87284950bbe52c60e142061c822a2e98125 | MATLAB | 3,541 | 71 | function plot_gauss2d_with_errorbars(points, sigma_shade)
if nargin < 2, sigma_shade=2.5, end
mlmean = mean(points, 1);
mlcov = cov(points);
hold on;
% plot data points
pointsize=30
h_points = scatter(points(:,1), points(:,2), pointsize, 'red', 'filled', 'MarkerFaceAlpha', 0.75);
% get a... |
44acf4e8606658d7b3913f58ca8dae973509a16dfc716db22545a599532f7c49 | MATLAB | 3,543 | 86 | %{
# Average clip statistics
-> stimulus.MovieClip
---
mean_kurtosis : float # mean frame kurtosis
mean_std : float # mean frame std
std_mean : float # std of frame means
mean_diff : float # mean frame diff
mean_diff_low ... |
b4f60335d092856eb0e806eddca4f2647ff356d40ca9e5949903cc1593b966d3 | MATLAB | 3,543 | 133 | function [y_fft, idx] = tapas_rdcm_filter(y_fft, u_fft, h_fft, Ny, options)
% [y_fft, idx] = tapas_rdcm_filter(y_fft, u_fft, h_fft, Ny)
%
% Specifies informative frequencies and filters the Fourier-transformed
% signal
%
% Input:
% y_fft - intial Fourier-transformed signal
% u_fft - Fourier-... |
3777b1a3743c37b31a653ef4d21557a4ae42a0702d1c2371fb69a71fe6338a82 | MATLAB | 3,545 | 126 | function [ obj ] = remove( obj, idx )
% Remove data (fMRI time series, confounds, DCM network structure, ... )
% and estimation results from HUGE object.
%
% INPUTS:
% obj - A tapas_Huge object.
%
% OPTIONAL INPUTS:
% idx - Only remove data of the subjects indicated in 'idx'. 'idx' must
% be a vector conta... |
14377ed28328e1f219b4312fe1486637d398eacb4706022d02324fc9d4248b97 | MATLAB | 3,547 | 113 | function [Iq, A, W, S, index2centrotypes]=icassoResult(sR,L)
%function [Iq, A, W, S, index]=icassoResult(sR,[L])
%
%PURPOSE
%
%To return results of the Icasso procedure
%
%EXAMPLE OF BASIC USAGE
%
%Get stability index, source and rows of demixing matrix:
%
% [Iq, A, W, S]=icassoResult(sR)
%
%INPUT
%
%[An argument i... |
00b1b3ec4dc007dd2d622eda5de7b9d5e97b5d71239ff418dec3eec008a8827f | MATLAB | 3,548 | 104 | function [blockbins, all] = binBlocks_SS(A, block, numbins, transitionType, idx, trialType)
%select trials from different bins of a certain
%block type. cmc August 2024. Added first quartile up to first
%incongruent sss August 1, 2025
% INPUTS:
% A = behavior data struct.
% block = block type you want to select (1... |
41ba695ef1cb244720b986494e33dfd0b879e18458cc6223c49df73ac89d8486 | MATLAB | 3,548 | 120 | function meta_plot_study_coords(DB, studyname, wh_slice)
% meta_plot_study_coords(DB, studyname, wh_slice)
%
% Plot points on brain slice and then show orthviews for one study
%
% Tor Wager, March 2007
%
% wh_slice can be missing or empty: picks modal slice (most points)
if nargin < 3, wh_slice = []; end
wh = find(st... |
6c2d24e5864008aa88080e9abbe8ee67fb67dfd327838a6a3b902bb34a44f769 | MATLAB | 3,548 | 101 | function [ ] = corrplot_imagesc( data, varnames1, varnames2 )
% mimics the corrplot function from the econometrics toolbox, which I sadly
% do not have. data has to be a table, and varnames the names of the variables
% that should be correlated. if present, will use varname_cilow and varname_cihigh
% to plot confidence... |
e3883a5b777d498462e99d1835b9cc0c4853694fd1854717ee2fdcc11fe9a129 | MATLAB | 3,548 | 85 | % This MATLAB script can be used to reproduce the result of EEG spectral power increase and decrease
%
% Please download BBCItoolbox to 'MyToolboxDir'
% Please download dataset to 'NirsMyDataDir' and 'EegMyDataDir'
% The authors would be grateful if published reports of research using this code
% (or a modified version... |
5c19295f1a5e192f057719933906cc1ff03efa6663c57e380a775cc18b7f3441 | MATLAB | 3,549 | 91 | function [DataMatrix] = generate_IVIM_T2_phantom(PhantomPars,outputDir,outputFile,saveOutput)
% This function creates a 2D IVIM phantom dataset using the input
% parameters in the phantom struct. Only a single repetition is created for
% efficiency
%
% USAGE:
% [DataMatrix] = generate_IVIM_T2_phantom(Phan... |
524be3f483cf236a025509783d1223193ccb487c32a20b4d8dd79021a1d17040 | MATLAB | 3,553 | 99 | % op_getcoilcombos_specReg.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% coilcombos=op_getcoilcombos_specReg(file_or_struct,tmin,tmax,point);
%
% DESCRIPTION:
% This funciton finds the relative coil phases and amplitudes. Coil phases
% are found by fitting in the time domain. (In the original
% op_getcoilcomb... |
9ff581f5765c2549f755423e6d41555682423b72fe75450fe1ae764e7dd5083d | MATLAB | 3,553 | 108 | %% MakeAFMmap_ConcentricGrid.m 11/01/2021 Julia Becker
% This script creates a concentric grid of measurement points around a
% centre point.
%
% required INPUT:
% - Script asks for folder of experiment. In contrast to other map-making
% scripts,'overview.tif' (RGB colour) in 'Pics/calibration' is not r... |
6fc50846e50351baefe0653176991b4137f76e81b9bed8978b7681aa1f1d071a | MATLAB | 3,554 | 122 | function findBasinsOfAttraction(DensityLandcape, gridx1, PCmin, PCmax, sigma, Params, fig_folder, add_fig_info, oneFigureHandle)
% DL1_Zmin = 0.55; % got these from gridx1(70) using original spacing
% DL1_Zmax = -1.45; % got these from gridx1(110) using original spacing
DL1_Zmin = 4;
DL1_Zmax = -2;
... |
007368c270391c67afa04e2af792442bd6f7a2a689c947986487af0a68dcfa5c | MATLAB | 3,556 | 117 | function analyzebehavior_nsd_visualize(ppdirs,outputdir)
% load
alldata = {};
for p=1:length(ppdirs)
file0 = [ppdirs{p} '/behavioralresults_nsd.mat'];
alldata{p} = load(file0);
end
% internal constants
expectedtriggers = 188;
% look at tricky trigger stuff
totaln = [];
mdf = [];
realstart = [];
ok = [];
for p=1:... |
84157bdc294eb6d8e2ed899fff6131b2f1256d935a74529b03db5e7a592aab92 | MATLAB | 3,556 | 123 | function [outputArg1,outputArg2] = PlotSubjectMeans_All(sn, TitleStr, lp_Color, hp_Color, bb_Color)
% Plot subject means for all stimulus conditions.
% sn = subject data, e.g. NH{1} --> first subject in NH cohort
% TitleStr = title
% lp/hp/bb_Color = color vectors to use for denoting the stimulus
% conditions
% --- Se... |
ce9f93577532d2c93eafcefc13b778c3dddff9fb7268b135007491bfbe9cee7d | MATLAB | 3,556 | 113 | function data = SurfStatReadData( filenames, dirname, maxmem )
%Reads data (e.g. thickness) from an array of .txt or FreeSurfer files.
%
% Usage: data = SurfStatReadData( filenames [, dirname [, maxmem ]] );
%
% filenames = .txt, .mgh or FS file name (n=1) or n x k cell array of file
% names. If the .mgh... |
fc280758182a7a468938157ae5de800f94380a7a7eebfdb856b11587c50f7284 | MATLAB | 3,557 | 97 | % READEGILOCS - look up locations for EGI EEG dataset.
%
% Usage:
% >> EEG = readegilocs(EEG);
% >> EEG = readegilocs(EEG, fileloc);
%
% Inputs:
% EEG - EEGLAB data structure
%
% Optional input:
% fileloc - EGI channel location file
%
% Outputs:
% EEG - EEGLAB data structure with channel loca... |
51b1e97c1d7f6a5ba545fe0cb55e96929218fc5d6c7fe4d31263be4f09ebd53f | MATLAB | 3,559 | 119 | function grad = compute_grad(M,options)
% compute_grad - compute the gradient of an image using central differences
%
% grad = compute_grad(M,options);
%
% 'options' is a structure:
% - options.h is the sampling step size on both direction (default 1).
% - options.h1 is the sampling step size on X direction (def... |
6028a2d144541019cd5224a2123eb32fda3e1d1eb76242d477feebeceef42603 | MATLAB | 3,561 | 113 | %mutual information between spikes and trial-level behavior/outcome stimuli
%% choose a neuron and its glm fit, as well as place to save
%% paths to stuff on local machine
datadir = '~/projects/ofc/data/published/'; %where raw data is stored
%where will feature space data be stored. and where glm fit file is store... |
c5434e26544516c8348b55ce176f05fa83a849529816f68878b80df3717315aa | MATLAB | 3,561 | 83 | function theta = subspace(A,B)
%SUBSPACE Angle between subspaces.
% SUBSPACE(A,B) finds the angle between two
% subspaces specified by the columns of A and B.
%
% If the angle is small, the two spaces are nearly linearly
% dependent. In a physical experiment described by some
% observations A, and a s... |
297fb81a2b6286d563e430570c54e0b809eba5a29085910aa77b1a03eb88e028 | MATLAB | 3,563 | 123 | function [x,w,P,Z] = fnnlsb(XtX,Xty,P_old,Z_old,tol)
%FNNLSb Non-negative least-squares.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % %
% % Please note this version of NNLS is for advanced users %
% % Please refer to the m-file FNNLS for a simpler fast %
% % version of NNLS ... |
7f2c2617fb17974df0c5907c326afd76fc1a69542bccd6123523546847f1fd10 | MATLAB | 3,563 | 106 | function [fit,cfg] = fit_MixtureModel(x,data,cfg)
% [fit,cfg] = fit_MixtureModel(x,data,cfg)
%
% fit mixture model by maximizing log-likelihood
if nargin < 3
cfg = struct;
end
if ~isfield(cfg,'fitmean')
cfg.fitmean = false;
end
if ~isfield(cfg,'offset')
if isfield(cfg,... |
63cbefd8438bc6c29518e7f30097ec80f958a610c0a39ecab72410cdf1371d62 | MATLAB | 3,564 | 103 | function fear_icaReac_CCG_exHFO(basename,varargin)
% basename='~/data/Fear/triple/achel180320/achel180320';
load([basename '.basicMetaData.mat']);
fprintf('start %s\n%s loading data for %s \n', mfilename, datestr(now), basicMetaData.SessionName)
load([basicMetaData.Basename '.Sleepstate.states.mat'])
load([basicMetaDa... |
bb18d00cb51b9fbac937a9b3ab2da10827316ffc7b1f133457b9f6189e9d8534 | MATLAB | 3,564 | 92 | % BIDS_WRITETINFOFILE - write tinfo file
%
% Usage:
% bids_writetinfofile(EEG, tinfo, fileOut)
%
% Inputs:
% EEG - [struct] EEGLAB dataset information
% tinfo - [struct] structure containing task information
% notes - [string] notes to store along with the data info
% fileOut - [string] filepath ... |
9b2f1dbe808e94720a5b3fbf787de17e004a22b8d28e75d98051ec156684b8e5 | MATLAB | 3,566 | 109 | function fear_cueTrigSpk(basename,varargin)
% load('~/data/Fear/triple/hoegaarden181115/hoegaarden181115.basicMetaData.mat')
% basename=basicMetaData.Basename
%%
param.tBinSize=0.1; %in sec
param.tBinRange=[-20,80]; %in sec
param.smSD=0.5; %in sec
param=parseParameters(param,varargin);
%%
load([basename '.basicMetaDat... |
b6cbf89291482e5c1f5aa6a3f8e9d27cfdf26526f9e3227ea51c0adba2319224 | MATLAB | 3,566 | 105 | function denoisingSpatialChunk(h5Path,varargin)
%% mocoMovies
% SYNTAX
% [mov_corrected,mov_shifted,summary]=mocoMovies(movie4corrections,movie4shifts)
% [mov_corrected,mov_shifted,summary]=mocoMovies(movie4corrections,movie4shifts,'Parameter',Value,...)
%
% HELP:
% Perform motion correction from the green movie, whi... |
cef9a332daa2ccdd31ca4f728d8545e5261f59604116d9e01c8b5a1d173d6d1e | MATLAB | 3,566 | 115 | function y = randwithcorr(x,rho,muy,sigmay)
% randwithcorr - random vector y with a given correlation coefficient against vector x
% usage: y = randwithcorr(x,rho,muy,sigmay)
%
% arguments: (input)
% x - vector (or array) of numbers, with any general distribution
% (must have numel(x) >= 3, and x may not b... |
eac874bea4e6ab668faaa5462c48f06716e84a1003b1c28088afceb367b32da8 | MATLAB | 3,566 | 88 | function dataNdConcat = concat(this, dataNdArray, concatDims, tolerance)
%Concatenate an array of MrDataNd along one specified dimension
%
% Y = MrDataNd()
% dataNdConcat = Y.concat(dataNdArray, concatDims, tolerance)
%
% This is a method of class MrDataNd. It is very similar to combine with
% the difference that n... |
9f8772cbd51038870d6751a07d227cd6f9fb24634b295f148e6d10a88073cfaa | MATLAB | 3,567 | 98 | function [clout,o1,ovec1,ovec2,xyzo] = overlap_closest(cla1,cla2,k,varargin)
% function [clout,o1,ovec1,ovec2,xyzo] = overlap_closest(cla1,cla2,k,[v1,v2])
%
% tor wager
% o1 and o2 are overall measures of overlap
% ovec1 and 2 are for each cluster - how many voxels in that
% cluster overlap with the other set
% cla1... |
e7a7fe19b6e8e522ce9471a514085b8a8ff6ab469e74c5d98bf4b51e14121436 | MATLAB | 3,567 | 74 | % demonstrate usage of covariance functions
%
% See also covFunctions.m.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2022-04-04.
% File automatically generated using noweb.
clear all, close all
n = 5; D = 3; x = randn(n,D); xs = randn(3,D); % create a data set
... |
4c689620df0968f9c4674ada49e2cea1a988be528f2e825ddfce81458a641f2a | MATLAB | 3,568 | 81 | function out = DT_IsSeasonal(y)
% DT_IsSeasonal A simple test of seasonality.
%
% DEPRECATED: no longer in the default feature library (deregistered from
% INP_mops_hctsa.txt and INP_ops_hctsa.txt), because thresholding the R^2 and
% amplitude of a sinusoid fit into a binary output discards information that is
% av... |
67700b0d003584ccfde3c0fbaa5aa3ee2dde92a5e49bfb9d3afe863fc62e2a9c | MATLAB | 3,568 | 110 | % listValidBasisFunctionNames.m
% Georg Oeltzschner, Johns Hopkins University 2022
%
% USAGE:
% allMets = listValidBasisFunctionNames
%
% DESCRIPTION:
% This function keeps a record of all valid metabolite names.
% If there is more than one common name for a metabolite, they are grouped
% inside another cell array.
%... |
69ef7d8967f7a1edd62103e3a8448b7d07284fe09cae9ece8ff413a818ab1bbe | MATLAB | 3,568 | 149 | clc
clear all
close all
processedpath = input('Enter processed_data location(such as /home/EV_Eye_dataset/processed_data) to use Pixel_error_evaluation: ', 's');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%left pixel_error_each_user %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
session_2... |
e09785dc25b98b9aef2880621c5aa401a499a5b164034a8d8605d23300f10749 | MATLAB | 3,569 | 102 | % This script collects a trials x cells x samples matrix for repeated Monet
% trials and runs the oracle predictor
% animal 10469 scans 1 and 2 are 90 minute Monet recordings with 30 unique and 60 repeated trials
key = struct(...`
'animal_id', 10469, ...`
'session', 1, ...`
'scan_idx', 2, ...`
'extrac... |
5babf5dfdab7f0380532f31364a3a9e62458312ea4d398d217374133129dcf44 | MATLAB | 3,571 | 93 | %% unwrappedField = UnwrapPhaseMacro(wrappedField,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% wrappedField : original wrapped phase image, in rad
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of t... |
f2e0c81aa8aeb8b5f681841a7e6beee4b213f9a3186d856d50ac8fa54f694ae6 | MATLAB | 3,572 | 128 | function doxywrite(filename, kw, statinfo, docinfo)
%DOXYWRITE Write a 'search.idx' file compatible with DOXYGEN
% DOXYWRITE(FILENAME, KW, STATINFO, DOCINFO) writes file FILENAME
% (Doxygen search.idx. format) using the cell array KW containing the
% word list, the sparse matrix (nbword x nbfile) with non-null value... |
05e3f9e9316e0d71bec45c0200c6b99e577ecd938b7198e5373a03e57a081d89 | MATLAB | 3,573 | 65 | % Specialized plotting functions for FMAToolbox.
%
% Interactive commands
%
% Browse - Interactively browse the data in one or all subplots in a figure.
% UIAddLine - Interactively add horizontal/vertical line to existing plot.
% UIInPolygon - Find points in interacti... |
95c0ade9e30c05494cfe9de609b39b8f14e180c58d78b286a6ef59e1d112eea2 | MATLAB | 3,576 | 93 | % EEG_LATENCYUR - transform latency of sample point in the continuous
% data into latencies in the transformed dataset.
%
% Usage:
% >> lat_out = eeg_latencyur( events, lat_in);
%
% Inputs:
% events - event structure. If this structure contain boundary
% events, the length of thes... |
073b4b661fcbee0af9cb9f5593296909fa4b04f138f188ce5347483c94919deb | MATLAB | 3,577 | 100 | % MATPERM - transpose and sign rows of x to match y (run after MATCORR )
%
% Usage: >> [permx indperm] = matperm(x,y,indx,indy,corr);
%
% Inputs:
% x = first input matrix
% y = matrix with same number of columns as x
% indx = column containing row indices for x (from MATCORR)
% indy = column containi... |
71f2600df911fbca703b650685190bab9b31dcbc7897269b697b48c8178224e1 | MATLAB | 3,577 | 83 | function plot_metrics_allAcq(plotStructs, plotColors, figure_save, saveLocation, ...
y_param, x_axis_lim, y_axis_lim, x_axis_ticks, y_axis_ticks, y_axis_label, ...
pulse_width, optional_outline_color, specific_num, custom_stats, each_acq, acq_range, ...
x_axis_label, x_tick_labels, y_tick_labels, groupLabel... |
03cd91039fe99513b893ae0e64d30e4f9c2d8198d5b1ebb9e249653ccef7f19c | MATLAB | 3,578 | 97 | % (C) Copyright 2019 bidspm developers
clear;
clc;
% set your directories and initiate bidspm
bidspmDir=fullfile(fileparts(mfilename('fullpath')),'..', 'lib','bidspm');
addpath(fullfile(fileparts(mfilename('fullpath')),'..', 'lib','bidspm'))
bidspm();
bids_dir = fullfile(fileparts(mfilename('fullpath')),'..', '..','... |
9f09109e697a9f950d524ab7c487372b049e185b53ae559a8c3e9449eb6771e5 | MATLAB | 3,581 | 85 | % controls the user interface with keyboard and mouse callback for
% analyzing a FOV as quickly as possible; check the
% switchImage()-subfunction for further details and a brief manual
%
% open window of FOV which allows to zoom and pan and select neurons
% manually ('f' for freehand) or automatically ('x' for
% cross... |
32a562cf6bd146a8c3b7d3ca05e16a145637ed3828ec2b06c7d1e6c0afe8d610 | MATLAB | 3,583 | 104 | function [node,elem,face]=cgalv2m(vol,opt,maxvol)
%
% [node,elem,face]=cgalv2m(vol,opt,maxvol)
%
% wrapper for CGAL 3D mesher (CGAL 3.5 or up)
% convert a binary (or multi-valued) volume to tetrahedral mesh
%
% http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Mesh_3/Chapter_main.html
%
% author: Qianqian Fang (fangq... |
3f50d4645148d8df65c76f2bde335214dac1d61c9453e15f55435c8a4c64fcca | MATLAB | 3,583 | 119 | function [summary]=export_figure(figure_handle,filename,folder,varargin)
% Exporting diagnostic figures for VIA preprocessing.
% SYNTAX
%[output_arg1,summary]= export_figure(figure_handle,filename,folder) - use 4, etc.
%[output_arg1,summary]= export_figure(figure_handle,filename,folder,'optionName',optionValue,...) - p... |
4204df2321c28c23d16738456e6077562c83917e71130e245c82d77de80119f1 | MATLAB | 3,583 | 116 | function allplots_cortex_BS_5_view(cortex, data_in, colorlimits, cm, unit, smooth, printfolder, varargin)
% (C) 2018 Stefan Haufe
%
% If you use this code in a publication, please cite
%
% Haufe, S., & Ewald, A. (2016). A simulation framework for benchmarking
% EEG-based brain connectivity estimation methodologies. Bra... |
da6a0f2d39b89e285fe821337182256220c09cd434b3b5749c8f1f645fbb92e3 | MATLAB | 3,583 | 88 | function header = tapas_uniqc_read_par_header(filename)
% Returns Par-file header (Philips), based on GyroTools ReadRecV3
%
% header = tapas_uniqc_read_par_header(fileName)
%
% IN
% fileName .par/.rec file
%
% OUT
%
% EXAMPLE
% tapas_uniqc_read_par_header
%
% See also
% Author: Saskia Bollmann & Lars Kaspe... |
dfea7f3d2444133475ef7f7c4b5926f3ece3b665749fddd16c2ed9a2d74b4840 | MATLAB | 3,585 | 79 | function signal = clean_flatlines(signal,max_flatline_duration,max_allowed_jitter)
% Remove (near-) flat-lined channels.
% Signal = clean_flatlines(Signal,MaxFlatlineDuration,MaxAllowedJitter)
%
% This is an automated artifact rejection function which ensures that
% the data contains no flat-lined channels.
%
% In:
% ... |
7a64fc5ee6059c9b052bfc4e79f004e8e65e65eb3c0560a2791f78f7bebc9ae5 | MATLAB | 3,587 | 91 | function net = uncompiled_network_evaluation(net, inputs)
% % get path information
% pluginpath = fileparts(which('pop_iclabel'));
%
% % activate matconvnet
% run(fullfile(pluginpath, 'matconvnet', 'matlab', 'vl_setupnn'))
%
% % load network
% netStruct = load(fullfile(pluginpath, 'netICL.mat'));
% net = dagnn.DagN... |
4cd25ee002aa10cec49839148323ed8b79a8a5cb370032e88c0d2412b8cdaa37 | MATLAB | 3,588 | 112 | function [consolidated,target] = ConsolidateIntervals(intervals,opt)
%ConsolidateIntervals - Consolidate intervals.
%
% Consolidate overlapping intervals, e.g. replace [10,20] [15,25] with [10,25].
%
% USAGE
%
% [consolidated,target] = ConsolidateIntervals(intervals,<options>)
%
% intervals list of interva... |
829016e818114a823850f9df482f7802400e5e113baa3835541f7f423e9f6e4a | MATLAB | 3,588 | 114 | classdef nnpool < nntest
properties
x
end
properties (TestParameter)
type = {'avg', 'max'}
poolx = {1 2 3}
pooly = {1 2}
pool = {1 2 3}
pad = {0 1 2}
stride = {1 2 3 4}
stridex = {1 2 3}
stridey = {1 2}
padLeft = {0 1 2}
padRight = {0 1 2}
padTop = {0 1 2}
padB... |
2a5d82df154690436e20603f418c7db60458440139ba8fbaa21e9a14d6a0a9da | MATLAB | 3,589 | 96 | % EEGPLOT2EVENT - convert EEGPLOT rejections into events
% compatible with the eeg_eegrej function for rejecting
% continuous portions of datasets.
%
% Usage:
% >> [events] = eegplot2event( eegplotrej, type, colorin, colorout );
%
% Inputs:
% eegplotrej - EEGPLOT output (TMPREJ;... |
7e76fff413a90bbb6098421fa56f5780136813edbde55d1f78fda5fdfdda4a28 | MATLAB | 3,589 | 100 | function [hfig, lme, atbl] = peslme(T)
% PESLME LME + publication-style boxplot with custom layout and colors.
%
% - One box per age (12=orange, 16=black, 21=blue)
% - Layout identical to example figure (clean axes, spacing)
% - Satterthwaite p-values printed on top-right corner
% - Asterisk (*) if Age m... |
c41516165edb283012a27a79c687963c0852e00db1b96732f5c88b389d5d56fc | MATLAB | 3,589 | 93 | %% review_program
% Scripts for testing feature importance
px2cm = 0.169;
%% Feature Importance - Fine Distance Regressor
resultPath = 'D:\Data\Lobster\FineDistanceResult_syncFixed_May';
filelist = dir(resultPath);
sessionPaths = regexp({filelist.name},'^#\S*.mat','match');
sessionPaths = sessionPaths(~cellfun('isemp... |
e4874019ad2e4168e04219a3c997ac551bf113dc2150abbfd0f9ec896aa9e4d0 | MATLAB | 3,590 | 111 | function plotEC_chGroups_imagesc(params, M, EC_info, selCh_groups, subjTag)
% plots effective connectivity (EC): a-la spectra
% works only for 2 groups !!!
% tbd ?
% (c) Jiri, Nov22
if ~isfield(EC_info, 'methodName')
EC_info.methodName = params.connectivity.connectivityMeasure{1};
end
%% channels group selection... |
214e3369728f3f2bf845812a46dbd4960a2c689db3238e35f0f47b7a4e86e54e | MATLAB | 3,591 | 78 | %{
# Optical Flow for all frames using Lucas-Kanade method
-> stimulus.MovieClip
---
frame_up : mediumblob # positive X component of velocity
frame_right : mediumblob # positive Y component of velocity
frame_down : mediumblob # negative X component of velocity
fram... |
73cb95299ef14809a24e5e5ba01622ddb5ff9d3fde56377e511b4dd3fe428dfb | MATLAB | 3,591 | 121 | function [ varargout ] = tapas_rdcm_spm_dcm_generate(syn_model, SNR)
% Generate synthetic data from a DCM specification
% FORMAT spm_dcm_generate(syn_model,source_model,SNR)
%
% Input:
% syn_model - Name of synthetic DCM file
% SNR - Signal to noise ratio (default=1)
%
% This routine will update ... |
41b1ea4c5a89bc4920e932b15837ee0ee0a447b5faa0335eae7ffaebd80a9ecc | MATLAB | 3,592 | 40 | function [EEG, Sorig, Sclean, f, amps, freqs, g] = cleanline_check(varargin)
% CLEANLINE_CHECK confirms CLEANLINE input parameters without actually
% running the function.
% Reason for a sseprate function is the incompatibility of two backend
% fucntions, one for handling the inptu arguments (ARG_GUIDIALOG) and the
% o... |
0729e9d766bdc2ff41abfae0343b60148caae22033192b24f8aebe2410120d1c | MATLAB | 3,595 | 127 | %% function [chi, lambdaOptimal] = qsmIterativeLSQR(localField,mask,matrixSize,voxelSize,varargin)
%
% Description: compute QSM based on iterative LSQR
%
% Input
% _____
% localField : local field perturbations
% mask : user-defined mask
% matrixSize : image matrix size
% voxelSize : ... |
a019477dc8603945f2e3ac978981c2c6e0f3ccc58bb64780c3ca1fbeedf45f62 | MATLAB | 3,595 | 92 | % POP_FILEIODIR - import directory into EEGLAB using FileIO
%
% Usage:
% >> OUTEEG = pop_fileiodir; % pop up window
% >> OUTEEG = pop_fileiodir( folder );
%
% Inputs:
% folder - [string] folder name
%
% Optional inputs:
% 'channels' - [integer array] list of channel indices
% 'samples' - [min max] sampl... |
568c182de28361cebbd7e61ab11c980f330ef7cb8fbff12c9daa804b7b06f6ce | MATLAB | 3,598 | 112 | function [elec] = read_bioimage_mgrid(mgridfile)
% READ_BIOIMAGE_MGRID reads BioImage Suite *.mgrid files and converts them
% into a FieldTrip-compatible elec datatype structure with electrode
% positions in xyz coordinates (equals voxel coordinates in mm)
%
% Use as
% elec = read_bioimage_mgrid(filename)
% where th... |
74935ff03b0f5a518bb373c93b21862da1e89c3a8ceff26286a06f4b963d22d7 | MATLAB | 3,598 | 103 | M_clust = length(unique(rez.st(:,end)));
stop=0;
prompt = {'Automatic (0) or Manual (1)','Number of cycle:'};
title = 'Input';
dims = [1 40];
definput = {'','1'};
opts.Resize = 'on';
opts.WindowStyle= 'normal';
ops.Interpreter = 'none';
answer = inputdlg(prompt,title,dims,definput,opts);
mode = str2double(answer{1});
N... |
9fae88c31460fb63830dd9dd84cba3a10275ba8aa519b6efa78a7200f0510277 | MATLAB | 3,600 | 97 | function out = ST_SimpleStats(x, whatStat)
% ST_SimpleStats Basic statistics about an input time series
%
% ---INPUTS:
% x, the input time series
%
% whatStat, the statistic to return:
% (i) 'zcross': the proportionof zero-crossings of the time series
% (z-scored input thus returns mea... |
5903c1986abf1928da537eb47833decdd5deeb42e6386285c736764c0e23fdcd | MATLAB | 3,601 | 142 | % [Generalized Eigenvalue De-Artifacting Intrument (GEDAI)]
% PolyForm Noncommercial License 1.0.0
% https://polyformproject.org/licenses/noncommercial/1.0.0
%
% Copyright (C) [2025] Tomas Ros & Abele Michela
% NeuroTuning Lab [ https://github.com/neurotuning ]
% Center for Biomedical Imaging
% ... |
bd7152cf23d92d6eab986eae492d634315af56b03699528a45e96b8b1c5220c8 | MATLAB | 3,601 | 101 | load(fullfile('\\constantinoplelab.cns.nyu.edu\server2\PhysiologyData\Maggie\Chronic_implant\Npxl\Optotagged_cells','OFC-DS_projection_neurons_non-Stimulated.mat'));
DLS = 1:length(all_SU_DS);
xvec_200 = -4:0.2:8;
xvec_100 = -4:0.1:8;
xvec = -4:0.05:8;
%get d' of DS projectors usign 200ms bins
win = [-2,6];
trials_DS ... |
07d230f6510b60b589e00922d745e1adaf54bfce38c632257622fe78de54b230 | MATLAB | 3,604 | 69 | function handles = update_focus_display(handles)
% Values for the spectrogram are already calculated in renderEpochSpectogram
s_f = handles.data.page_spect.s_display(:,handles.data.page_spect.t > handles.current_focus_position(1) & handles.data.page_spect.t < sum(handles.current_focus_position([1,3])));
ti_f = handle... |
46d43db44828359030f215a903593084784d14b01f488a8b4e373bde8a577fbd | MATLAB | 3,604 | 86 | % Please cite this paper if you use any component of this software:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017.
% Re... |
6d02023bd096cf1ec1b363de5b92f44b818fac6f11490bc2a0abe7b46a6e051c | MATLAB | 3,604 | 77 | % STD_READSPEC - load spectrum measures for data channels or
% for all components of a specified cluster.
% Called by plotting functions
% STD_ENVTOPO, STD_ERPPLOT, STD_ERSPPLOT, ...
% Usage:
% >> [STUDY, specdata, allfreqs, setinds, cinds] = ...
% ... |
c6a7a5735cf7e19abdbc584fc4f064a5e3a4e3b5a548ce0f1f3b186dd8fb333d | MATLAB | 3,606 | 77 | % NEWTIMEFITC - Function to compute inter-trial coherence (phase locking
% factor is another name for it) from single trial spectral
% estimates.
%
% Usage:
% >> itc = newtimefitc(tfvals, itctype);
%
% Inputs:
% tfvals - [3-D or 4-D array] single-trial spectral estimates
% ... |
cc964bd783feead43fd79889bf18b27bf9dce7063cd34a7fb553257155f0faff | MATLAB | 3,608 | 125 | function f = cvnmapsurfacetovolume_helper(data,vertices,res,specialmode,emptyval)
% function f = cvnmapsurfacetovolume_helper(data,vertices,res,specialmode,emptyval)
%
% <data> is the data with dimensionality D (datasets) x V (vertices).
% <vertices> is 3 x V with the X-, Y-, and Z- coordinates of the vertices.
% <res... |
dbbd457e9ac79fb9ce4d216722428c1db0bfd0afbd57a48c94b56e406ab3c3b6 | MATLAB | 3,608 | 79 | function varargout = binaryLaplaceGP(hyper, covfunc, lik, x, y, xstar)
% binaryLaplaceGP - Laplace's approximation for binary Gaussian process
% classification. Two modes are possible: training or testing: if no test
% cases are supplied, then the approximate negative log marginal likelihood
% and its partial derivati... |
67bdad79ddc0a94378196d04b8e626fb47a2fa1dce799d484d4a40b73f210661 | MATLAB | 3,609 | 103 | function PlotExtendedData2(datadir, codedir)
%PlotExtendedData1 - Plots Extended Data 2.
% INPUTS:
% datadir - Local directory where ProcessData_ExtendedData2.mat was saved after running ProcessData_ExtendedData2
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = pa... |
90aff59a3818ced8d561da506f1ac89467fe940a242e9cac5c2126cc7334fa09 | MATLAB | 3,610 | 80 | function [regressorScans,regressorNames] = create_fMRIregressors_otherRPEactPass(tau, data, R, initialISIandSetup)
% an extract of fit_happy_model_otherRPEactPass(mtx,happyscore,constant)
% without fitting
if ~exist('tau','var'); error('Do use Tau'); end
plotFlag = 0;
%needs all blocks to be the same size
decayvec =... |
f5bfbd74a5049ab7fe5cd388b8a880e27b78570b1d65aca7f3ad79995a8f6bf8 | MATLAB | 3,611 | 106 | function run_permuranova1_examples
%RUN_PERMURANOVA1_EXAMPLES Run one-way permutation RM ANOVA examples.
% Generates random repeated-measures data for 5 conditions along the
% columns of X. Each condition has a mean value of 0, except for the
% first condition which has a mean value of 1. A random subject baseli... |
b6093d3361191c9b16a700cc24c339a48a2afa2b599fefec01318d2044546738 | MATLAB | 3,612 | 166 | function [imo,rois,labels,targets] = fast_rcnn_train_get_batch(images, imdb, batch, opts)
% FAST_RCNN_GET_BATCH_TRAIN Generates mini-batches for Fast-RCNN train
% opts.numFgRoisPerImg = 128;
% opts.numRoisPerImg = 64;
% opts.maxScale = 1000;
% opts.bgLabel = 21;
% opts.visualize = 0;
% opts.scale = 600;
% opts.interp... |
4ddc36bc5b3bfe7c44ca7766b3bb2b6991a903ec7213f29fd15a99b7a5aeced2 | MATLAB | 3,613 | 119 | function [stats] = plotFitness(populations)
% outputs psi-loss and psi-performance correlations and p-values.
% get number of populations and performance measure names
numPops = length(populations);
measures = {'loss'};
% create output variable: Spearman's rho, p-value, fdr
for m = 1:length(measures)
sta... |
e350998e98672598742391b0bdd4470c2025b40bd0afcccac669177b43b180c2 | MATLAB | 3,613 | 91 | function [M, Mx, My, Mz] = diffusionTermCylindrical3D(D)
% This function uses the central difference scheme to discretize a 2D
% diffusion term in the form \grad . (D \grad \phi) where u is a face vactor
% It also returns the x and y parts of the matrix of coefficient.
%
% SYNOPSIS:
%
%
% PARAMETERS:
%
%
% RETURNS:
%
%... |
f9037eb74a676c8bd7324bf80c18e593124dc0cb0da5240aa6cd703364059cac | MATLAB | 3,613 | 77 | function plotTargetXTPerformanceAll(outputs)
% Matrix plot for cross time condition decoding performance
% vertical axis is time in trial, horizontal is training time bin
% Figure
fig;
hold on;
axis off;
w = 50;
h = 50;
hspace = 7.5;
wspace = 15;
% Plot line at cue
tPts = -100:10:1000;
bins = linspace(0,w,length(tPts... |
3535632d6038cb382048d30faa5a9b536af1b2172894299a68f7f97bbcb072da | MATLAB | 3,614 | 85 | function OutVolume=TMSreslice(SampleDir,DataDir,OutDir,space,writeout)
%Resample 3D matrix, such as in REST mask resampling operation
%-----------------------------------------------------------
% Copyright(c) 2016~2020
% Department of Psychology, Anhui Medical University
% Written by Gong-Jun JI
% <a href="jig... |
14e83123c4c069ef565911594fc3ba9165a2aedcbcc2f4fda4776c0451060636 | MATLAB | 3,615 | 99 | function [img, mmPerVoxNew, dimOrder, dimFlip] = applyCannonicalXform(img, img2std, mmPerVox, insertMarkerFlag)
% Applies the cannonical xform specified in img2std to img
%
% [img, mmPerVoxNew, dimOrder, dimFlip] = ...
% applyCannonicalXform(img, img2std, mmPerVox, insertMarkerFlag)
%
% Applies the cannonical xform ... |
372f705e4f5d60050cbda9158ec51a367fd2423db91d416d5071982406197103 | MATLAB | 3,616 | 82 | % [Generalized Eigenvalue De-Artifacting Intrument (GEDAI)]
% PolyForm Noncommercial License 1.0.0
% https://polyformproject.org/licenses/noncommercial/1.0.0
%
% Copyright (C) [2025] Tomas Ros & Abele Michela
% NeuroTuning Lab [ https://github.com/neurotuning ]
% Center for Biomedical Imaging
% ... |
bba2d0ed0f61dbff4f548cbb03b45f5362b785522bcdac8f92e1cde414f9ac15 | MATLAB | 3,616 | 99 | %% Testing the ensembles detection method using subsampling
% 1.- Generating synthetic data
T = 50000;% recording time
N = 300; % number of neuron
nens = 10; % number of ensembles
fr = 0.2; % maximal neuron firing rate
ncellsperens = repmat(N*0.05,[1 nens]); % cells per ensemble
ntimesperens = repmat((0.7)/nens,[1 nens... |
eb816fe7684af39cf4b8316848fa8d934fa7f7bb164e5a5e515cc662f7401ee8 | MATLAB | 3,616 | 101 | % VASO realignment plots
%
% This script computes the motion parameter plots for realigned vaso time
% series. BOLD and VASO motion parameters are shown in the same plot. This
% helps the identification of inconsistent bold and vaso motion
% corrections.
% array of of input time series
rp_bold = {
'/data/pt_01880/... |
002c7fdc2fa73a164cef7d746a141b48d3f11fa70b0591ccbc87123e09601ef5 | MATLAB | 3,617 | 95 | % RSADJUST - adjust l-values (Ramberg-Schmeiser distribution)
% with respect to signal mean and variance
%
% Usage: p = rsadjust(l3, l4, m, var, skew)
%
% Input:
% l3 - value lambda3 for Ramberg-Schmeiser distribution
% l4 - value lambda4 for Ramberg-Schmeiser distribution
% m - mean of the... |
02ed6c17eca87fdeddd9bf74ba3ebbb21875aed01802441e538617547bf10682 | MATLAB | 3,617 | 96 | function spikes = ThresholdSpikes(amplitudes,factor,varargin)
%ThresholdSpikes - Post-hoc threshold correction for spike detection.
%
% USAGE
%
% spikes = ThresholdSpikes(amplitudes,factor,<options>)
%
% amplitudes [time, electrode group, cluster, amplitude] <a href="matlab:help samples">samples</a>
% ... |
52cd3760765a8721c74f1daf99a3a17c38f8e5c9479ef58606d9a930405f1293 | MATLAB | 3,617 | 88 | function figureDendrogram(RDM, userOptions, localOptions)
% Generates a dendrogram representation of an RDM and handles the figure
% according to user preferences.
%
% figureDendrogram(RDM, userOptions, localOptions)
%
% RDM --- The distance matrix basis for the dendrogram.
% RDM should be in squ... |
a0444186f066040530eb47d9820a71d4378207d03b23af0ebafff0d17a7c003a | MATLAB | 3,619 | 118 | function obj = update_mean(obj)
if isfinite(obj.nm0)
% ---------------------------------------------------------------------
% Maximum likelihood (nm0 == 0) or Variational posterior (nm0 > 0)
% ---------------------------------------------------------------------
% ----------------
% U... |
721266461d743af2ab6a418aa0cb198538b0f9fac2b6e091645a8a15d92ee03f | MATLAB | 3,622 | 108 | function this = gifti(varargin)
% GIfTI Geometry file format class
% Geometry format under the Neuroimaging Informatics Technology Initiative
% (NIfTI):
% http://www.nitrc.org/projects/gifti/
% http://nifti.nimh.nih.gov/
%_____________________________________________________________... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.