sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9d40539d318c4b3549cb45a73075f42e9aa943a93c89a3d12c904119098d109a | MATLAB | 10,217 | 229 | function [ALFFBrain, fALFFBrain, Header] = TMSfalff(AllVolume,ASamplePeriod, HighCutoff, LowCutoff, AMaskFilename, AResultFilename, TemporalMask, ScrubbingMethod, Header, CUTNUMBER)
% Modified from DPABI by JI Gong-Jun, 20200523
% Use ALFF method to compute the brain and return a ALFF brain map which reflects the... |
36e4c6278b04e239f817323f25c393ba6912d4a6fab71dd013682520b1ab79ed | MATLAB | 10,220 | 259 | function brainSlices_plot(brainVolumes, mni_vox, plotInfo)
% plots a single slice (axial, sagital, coronal) into specified axes or a new figure is created
% MRI (or CT) volumes are mapped to colormap/transparency based on their values (intensities)
%
% input
% - brainVolumes{vol} =
% struct with fields:
% ... |
842436dbe77b3f83435f193a7e4fb757fc0c094043bc48ceb0980e5667d920e3 | MATLAB | 10,232 | 398 | function [Model, Info] = linear_sparse_stepwise(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% Notice !!
% Delay embedding is done in this module,
% then input vector shoul... |
8faa3a6d650297e5a87703bc34455e7fffec9c2b665563655d899eada0afe285 | MATLAB | 10,233 | 288 | % EEG_PVAF - Compute EEG.data 'percent variance accounted for' (pvaf) by specified components.
% Can omit specified components and channels from the computation. Can draw a plot
% of the scalp distribution of pvaf, or progressively compute the pvaf for comps
% 1:k, where k = 1 -... |
9a4f1ee3c5e5b5315da155de8527067258b3f0988a53cd32502a5be2a03a1f14 | MATLAB | 10,236 | 317 | function [Iq, A, W, S, index]=icassoShow(sR,varargin)
%function icassoShow(sR,['identifier1',value1,'indentifier2',value2,...])
%
%PURPOSE
%
%To generate explorative visualizations for Icasso
%
%EXAMPLES OF BASIC USAGE
%
% [Iq, A, W, S]=icassoShow(sR);
%
%shows results for as many estimate-clusters as there are (redu... |
b19e615027464d2ce6e44e94a06b6dcca73e0be53d506fa01464b42d5e7fd9be | MATLAB | 10,236 | 261 | %% AssessFits_batchforce_SortCurves_slideshow.m 23/04/2021 Julia Becker
% This script allows the user to view and sort all fitted force curves
% after batchforce.m. The *.png files of one experimental folder which show
% the rawdata and the fitted curve are displayed one after another as a
% slideshow. The user can... |
494817d31458ec3da97f37d70e6cb0f526b79ca83142aca181df729c8f49ef38 | MATLAB | 10,253 | 246 | % pop_xfirws() - Design and export xfir compatible windowed sinc FIR filter
%
% Usage:
% >> pop_xfirws; % pop-up window mode
% >> [b, a] = pop_xfirws; % pop-up window mode
% >> pop_xfirws('key1', value1, 'key2', value2, 'keyn', valuen);
% >> [b, a] = pop_xfirws('key1', value1, 'key2', value2, 'keyn', valuen);
%... |
f7f5cbd7c8dc109982f645191f0cf1bc2e5527b61766a24251fd8470728b74c8 | MATLAB | 10,267 | 199 | function opIDs = TS_GiveMeFeatureSet(whatFeatureSet,Operations)
% TS_GiveMeFeatureSet Outputs a set of Operation IDs corresponding to a given set
%
% INPUTS:
% ---whatFeatureSet, the type of feature set to retrieve/filter.
% ---Operations, the Operations table to match to.
% -------------------------------------------... |
19dcddd280b36409981791f65dea66a624bed586c93df97411d9ca27038c6b99 | MATLAB | 10,269 | 404 | function [Model, Info] = linear_sparse_stepwise_vec(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% Notice !!
% Delay embedding is done in this module,
% then input vector s... |
82fb9f7322749ba6c1f9b718b01a6304df3bbf244760fab07187bdef5e6dc8d0 | MATLAB | 10,271 | 253 | function out = SC_MFDFA(y, scaleRange, qRange, order)
% SC_MFDFA Multifractal detrended fluctuation analysis (MFDFA).
%
% Estimates the multifractal singularity spectrum f(alpha) of a time series
% via the classical MFDFA algorithm:
% Kantelhardt, J.W. et al., "Multifractal detrended fluctuation analysis of
% nonstat... |
cd1ed8e5d51e03609558941834ef7ed710801f4b8c1732a1c9446e5138979528 | MATLAB | 10,274 | 190 | % ----------------------------------------------------------------------- %
% Trial-wise time-resolved analyses of the NSD eye-tracking data.
% M.N. July, 2021
% ----------------------------------------------------------------------- %
% settings
clearvars;
path2logs = '/System/Volumes/Data/misc/data61/naum2/NSD/dat... |
22ef6f3a87dbfc5a4a3fb3ab1d82d4520d53aa416d6d48ed7d8208ea426bd57e | MATLAB | 10,282 | 227 | % [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
% ... |
d8d609a0b39c7029e207ed5a872a3c91257cd763b0bfc54030dda2e3410e92b4 | MATLAB | 10,284 | 335 | %% Prepare the inputs
clear;
clc;
%bids_root_dir = '/mnt/f/BIDS/SVD_demo';
%subject_id = 'SSI0310';
%session_id = 'baseline';
%output_dir = '/mnt/f/BIDS/SVD_demo/derivatives/ExploreASL/sub-SSI0310/ses-baseline';
%
%t1w_filter_filename = 'sub-SSI0310_ses-baseline_acq-highres_T1w';
%asl_filter_filename = 'sub-... |
4f2b5c45cc1d384b41e4dcf50fc05eabf2ccf66b7c1c21e93ae6d6467c775309 | MATLAB | 10,287 | 305 | function [ all_subjects ] = nmri_all_subjects( analysis_dir, use_cache )
%[ all_subjects ] = nmri_all_subjects( analysis_dir, use_cache)
% Load all subject structs that are in the current analyis dir, will also
% re-root moved structs
if ~exist('use_cache','var') || isempty(use_cache)
use_cache=0; % default to alwa... |
a5646c9de1ae9e2ce7a18925ae22f3778bd3e96f09efff9e39b851f37b3c8480 | MATLAB | 10,287 | 223 | % This script generates tile-wise “heatmap-style” montage images (32-bit single TIFFs)
% using (i) per-tile summary metrics stored in a CSV file and (ii) tile coordinates
% stored in an acquisition metadata text file (*.txt).
% Each tile region in the montage is filled with a constant value for each metric.
%
% In... |
df3e01b02e49378338f7b827188a4b18605efef90403fdc914471436b0802e5b | MATLAB | 10,293 | 302 | function smoothed = Smooth(data,smooth,varargin)
%Smooth - Smooth using a Gaussian kernel.
%
% USAGE
%
% smoothed = Smooth(data,smooth,<options>)
%
% data data to smooth
% smooth vertical and horizontal kernel sizes:
% - gaussian: standard deviations [Sv Sh] (optionally,
... |
ecc4f15e662a7ebdb4ac743d285fd341b525472a5dfe93716f956a015a186b81 | MATLAB | 10,302 | 302 | %% corrected_univariate_glm_with_AIC_BIC_Custom.m
clear all; close all; clc;
%warning('off');
% parallel pool safe
p = gcp('nocreate');
if isempty(p)
parpool;
end
pctRunOnAll addpath(genpath(pwd));
% ---------------- I/O and paths ----------------
fullpath = mfilename('fullpath');
if isempty(fullpath)
fullpat... |
ff1821e89d217b10ab76768aac0092e447cd2b6d88976d45bfcb3784ef897664 | MATLAB | 10,302 | 286 | function [alpha, xmin, n]=plvar(x, varargin)
% PLVAR estimates the uncertainty in the estimated power-law parameters.
% Source: http://www.santafe.edu/~aaronc/powerlaws/
%
% PLVAR(x) takes a vector of observations x and returns estimated
% uncertainties in the estimated power-law parameters, based on the
% ... |
0d5e003c1b2c6fb789aaa4ae0ead799f0b18d7b954a960aee0e37cc4205264b5 | MATLAB | 10,308 | 219 | % STD_READPAC - read phase-amplitude correlation
%
% Usage:
% >> [STUDY, clustinfo] = std_readpac(STUDY, ALLEEG);
% >> [STUDY, clustinfo] = std_readpac(STUDY, ALLEEG, ...
% 'key', 'val');
% Inputs:
% STUDY - studyset structure containing some or all f... |
acbc8c1d49ff77e21df56a21b8c9cb66f2fa9092963ed1edc686beb8777a11a7 | MATLAB | 10,318 | 359 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add paths
baseloc="C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC";
% For outputs
str='\Outputs';
outputpath=strcat(baseloc,str);
addpath(outputpath);
% F... |
cf9df66671a922ffb8f90c59bf116064c62e62271282c41639635214df48e7c6 | MATLAB | 10,325 | 251 | % REREF - convert common reference EEG data to some other common reference
% or to average reference
% Usage:
% >> Dataout = reref(data); % convert all channels to average reference
% >> [Dataout Chanlocs] = reref(data, refchan, 'key', 'val');
% % convert data to new referenc... |
7002ce29ef2cdfd09c4c3d34e5dee1c7ba1e5e83bc2880f68a60e36b498e1dee | MATLAB | 10,328 | 402 | function [Model, Info] = linear_sparse_stepwise(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% Notice !!
% Delay embedding is done in this module,
% then input vector shoul... |
ab610c824da56884dd4f19b582cc7ad9cc740b9fff69c592cf88f8d2126b1bdb | MATLAB | 10,330 | 360 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add paths
baseloc="C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC";
% For outputs
str='\Outputs';
outputpath=strcat(baseloc,str);
addpath(outputpath);
% F... |
02019d28370f462bab5c7b91d47f3de9185963af0c426026fa7a28f1bb5f2648 | MATLAB | 10,333 | 263 | % 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 t... |
913f059eb9560c2b1ab0e4d9cb9beb824ba5bcf5649f0645bd031fb3c904fdd4 | MATLAB | 10,333 | 286 | % aa1_lassoglm_1y_ALLx_zScore.m
% Process all groundTruth_* files in ../data/groundTruth.
% Parallelizes over files (one file -> one worker). Per-file GLM loop is serial
% to avoid nested parfor issues.
%
% Optional (set in base before running):
% seedList = [42 101 ...]; % process only matching seeds
% sheetType... |
30f93ee67de8f8e03fe8c7099acd5a4ecda1d685e572735b2ab4ff5dcd9f4cca | MATLAB | 10,334 | 241 | function plot(frame,cfg,varargin)
% Plot the contents of a McsFrameDataEntity object.
%
% function plot(frame,cfg,varargin)
%
% Will either produce a 3D figure of the channel amplitudes at a single
% time point, or a 2D matrix of plots, each showing the signal of a single
% channel for a given time range.
%
% ... |
d4462ad5a411f9c8a66a451e0e3f370cbed9fcf21855bc7424c0a01d44cedd0a | MATLAB | 10,343 | 405 | function [X,Xnms,DB,Xi,alltasknms,condf,testfield,conweights] = Meta_Logistic_Design(DB,varargin)
% [X,Xnms,DB,Xi,Xinms,condf,testfield,conweights] = Meta_Logistic_Design(DB,[control strings])
%
% Set up logistic regression design matrix from DB
%
% needs to set up design:
%DB.(fields) % lists of fields containing ta... |
ccc6c39655987bfa4e4879918d744f8e8e1b9376bbef5d041c227fdfb8f80c52 | MATLAB | 10,352 | 270 | function [ParsedData, Trials, IRs, Licks, Attacks, targetdir ] = BehavDataParser(targetdir)
%% BehavDataParser
% Import Event data from 1) Open Bridge extracted csv files or 2) Tank
% Invalid trial is automatically removed and the remaining is concatenated.
% Thus resulting trial number might differ from the original n... |
9e775660a8c4960bf59cb2de34ff7c5db589ff86a25e9efb6e9085304b7dab6d | MATLAB | 10,355 | 247 | %% BiExpFitModelT2RelaxS0.m
% This function contains a T2 corrected biexponential diffusion model
% modelled as a 2D problem.
%
% lossFunction - calculates loss function for optimizer
% forwardJacobian - calculates the forward jacobian for optimizer
% forwardModel - converts parameter struct into model... |
76fa6867b1d35856a70a7c5f5ffce8a4878c09adac395aad74af5524895da5d5 | MATLAB | 10,357 | 275 | function [grad, elec] = bti2grad(hdr, balanceflag)
% BTI2GRAD converts a 4D header to a gradiometer structure that can be
% understood by FieldTrip and Robert Oostenveld's low-level forward and
% inverse routines. This function only works for headers that have been
% read using the READ_4D_HDR function.
%
% Use as:
% ... |
49898fa072bc4dfef42ed37d2af9bf37033c980fb0ba6d7c7269a8a9c6467d4b | MATLAB | 10,361 | 227 | % set working paths
statdir=[Pathnew,'Forgithub\Code'];
savedir=[Pathnew,'Forgithub'];
Pathnewplot=[Pathnew,'Forgithub'];
cd(Pathnewplot)
load([Pathnew,'Forgithub\Data\Gretna_results\Subset1\gretna_results_subset1.mat']);
load([Pathnew,'Forgithub\Data\Network\Subset1\Matrixallpar500FN_subset1.mat']);
load([Pat... |
b764399b6ffd80e1855874dda88f6fcb6fb9c0b51c22344553267d78d821d53e | MATLAB | 10,361 | 312 | function [x,f,info] = lbfgsb( fcn, l, u, opts )
% x = lbfgsb( fcn, l, u )
% uses the lbfgsb v.3.0 library (fortran files must be installed;
% see compile_mex.m ) which is the L-BFGS-B algorithm.
% The algorithm is similar to the L-BFGS quasi-Newton algorithm,
% but also handles bound constraints via an acti... |
bbe7d2311de7aeee6162535f17e0e33ee4ef0756538f90df947052e8e1fdd8ee | MATLAB | 10,364 | 258 | function [x, cost, info, options] = steepestdescent(problem, x, options)
% Steepest descent (gradient descent) minimization algorithm for Manopt.
%
% function [x, cost, info, options] = steepestdescent(problem)
% function [x, cost, info, options] = steepestdescent(problem, x0)
% function [x, cost, info, options] = stee... |
1d73916e60dba138dc1a32aaa3d3a9d0814c587fa7eb296321aa901c5ae17ba7 | MATLAB | 10,367 | 293 | function H= plot_scalpEvolutionPlusChannel_NIRS(erp, mnt, clab, ival, varargin)
%PLOT_SCALPEVOLUTIONPLUSCHANNEL - Display evolution of scalp topographies
%
%Synposis:
% H= plot_scalpEvolutionPlusChannel(ERP, MNT, CLAB, IVAL, <OPTS>)
%
%Description:
% Makes an ERP plot in the upper panel with given interval marked,
% a... |
8a086ebf61f9653c50f2b1fe30ee143be810afb12c93acfc40fbd8e33c86ef25 | MATLAB | 10,373 | 165 | function [matlabbatch] = first_level_job(path_all, file_dir, out_dir)
%-----------------------------------------------------------------------
% Job saved on 09-May-2018 14:06:33 by cfg_util (rev $Rev: 6942 $)
% spm SPM - SPM12 (7219)
% cfg_basicio BasicIO - Unknown
%---------------------------------------------------... |
a4fbfe17940b1a13bcc79af058a636d2f936dc27d8860f11e68f3421c0354773 | MATLAB | 10,381 | 217 | classdef MrImage < MrDataNd
% An n-dimensional MR image, on which typical image algebra operations
% can be performed (similar, e.g. to fslmaths), but on top, image
% processing operations (e.g. erosion/dilation) of the image processing
% toolbox. Furthermore, interfaces with neuroimaging formats from
... |
efd04d044a1a2e189ece4b32e4a7774e87458bdaffaadf353c8df42ba7ef1924 | MATLAB | 10,390 | 332 | function plotSpikeDetectionChecks(spikeTimes,spikeDetectionResult,spikeWaveforms, ...
Info,Params, figFolder, oneFigureHandle)
%
% Make plots to check that spike detection worked properly, and plots
% spike-related statistics such as the firing rate of each unit / recorded
% from each electrode.
%
% Parame... |
ec95bca745f07ded8ae345846cc34a833424f1c82a192206fa67174b6aed0850 | MATLAB | 10,393 | 302 | function out = CO_FallingSticks(y)
% CO_FallingSticks Physical falling-sticks model of line-of-sight interaction.
%
% As in CO_StickAngles, each time-series value is treated as a rigid stick
% standing on the zero baseline, with sticks grouped by sign into a
% 'positive' set (protruding up from the zero level) and a ... |
3c8a5363cc4b17ecfbedb992d0eae0aac967ca0cd73affa07ddf7dd0d062a17f | MATLAB | 10,400 | 304 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Reproduces Figure 5
%
% "Private confidence" is computed by training multinomial regression on
% data from prescan session and then applying weights to data from fMRI
% session while setting context weights to zero
%
% Visualises functional coup... |
83425a2ce15fb9d0d3b2396cb819bab70a651c2e7791d7e1fef54af8f55b5a47 | MATLAB | 10,400 | 294 | % io_readlcmraw_basis.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=io_readlcmraw_basis(filename);
%
% DESCRIPTION:
% Reads entire LCModel .basis file into multiple FID-A data structures in MATLAB.
%
% INPUTS:
% filename = filename of LCModel .basis file.
% conjugate = apply complex conjugate
%
% OUT... |
7448c51290e998f7a047fb3b7202b1da6da07e591d97795e943f67f022648e61 | MATLAB | 10,403 | 293 | function MRSCont = calcUnfoldingMatrix(MRSCont, niiSOSFile, niiSENSEFile, kk, launchViewer)
%% function MRSCont = calcUnfoldingMatrix(MRSCont, niiSOSFile, niiSENSEFile, kk, launchViewer)
% Calculates the unfolding matrix for a given coil reference image and
% voxel locations specified in MRS_struct.
%
% Input:
% ... |
d2d68792a93624799b2d6b7bf41d646094c770969995cb07298ac774409f4ee1 | MATLAB | 10,406 | 268 | function plot_ieegChnlsInBrain(params, plotInfo)
% plots channels in MNI coordinates in slices (axial, sagittal, coronal)
% uses radiology convention for slices (mirrored axial slices)
% as default plots MRI, optionally CT (or post-implant MRI)
% (c) Jiri, Jan17
%% defaults
if ~isfield(plotInfo, 'labelSlices'), plotIn... |
4b67e9c6bc8ebec80b9bc9c4438160a562e5edd7b00d6c067ff8e7d0b1f554b8 | MATLAB | 10,419 | 256 | function out = SB_MotifThree(y, cgHow, tau)
% SB_MotifThree Motifs in a coarse-graining of a time series to a 3-letter alphabet
%
% (As SB_MotifTwo but with a 3-letter alphabet)
%
% ---INPUTS:
% y, time series to analyze
% cgHow, the coarse-graining method to use:
% (i) 'quantile': equiprobable alphabet by ti... |
1ad454ea91a3ad363dfccc4d30d4318a2bd52f829def70df2881446d64190ac0 | MATLAB | 10,420 | 283 | % STD_READEEGFIELD - read field from ALLEEG structure
%
% Usage:
% >> [dataOut, ~, xvals] = std_readeegfield(datasetinfo, ALLEEG, ...
% designvar, fieldName, 'key', val)
% Inputs:
% datasetinfo - STUDY.datasetinfo structure array corresponding to the
% ALLEEG va... |
0c20a5478c25a1d612f3c68e865f58b2e1d688674706aab427a46c0154488a2c | MATLAB | 10,421 | 278 | function [C2,cfg] = mahal_iem_trialwise(dat,theta,cfg)
% [C2,cfg] = mahal_iem_trialwise(dat,theta,cfg)
% authors: M Stokes, E Spaak, N Myers
if nargin < 2
help mahal_iem_trialwise
error('missing input arguments!')
end
ntrl = size(dat,1); % number of trials
nsens = size(dat,2); % numbe... |
26d70babf9bef83063f90b3bbeb1f9f9bc8f994686505f2804a792b32e58e253 | MATLAB | 10,424 | 286 | % SUBSASGN - define index assignment for eegdata objects
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, wit... |
82f0ddb5f108d1a7122feb0425d8e8d9ff24a8333ddd8cdf9573bed9359b78c4 | MATLAB | 10,455 | 250 | function varargout = nii_xform(src, target, rst, intrp, missVal)
% Transform a NIfTI into different resolution, or into a template space.
%
% NII_XFORM('source.nii', 'template.nii', 'result.nii')
% NII_XFORM(nii, 'template.nii', 'result.nii')
% NII_XFORM('source.nii', [1 1 1], 'result.nii')
% nii = NII_XFORM('sour... |
ff58e0edca6fae55634d25684cb51a00404c5d395cc0112527a87e775370beb9 | MATLAB | 10,455 | 270 | %% Hierarchical Unsupervised Generative Embedding
%% Introduction
% This toolbox implements Hierarchical Unsupervised Generative Embedding (HUGE)
% with variational Bayesian inversion. This demo script provides a quick-start
% guide to using the HUGE toolbox to stratify heterogeneous cohorts via generative
% embeddi... |
2384299d39e10b5f0c52ca09557729656b57d251aedc2961cfd87e4f9023f320 | MATLAB | 10,469 | 202 | %% ms SEI - switching times as x-over time (XT) points on channels (avg over trials)
% low-pass filters trials data
% determines "switching times" as cross-over points = t_switch
% plots histogram of t_switch
% (c) Jiri, Sep23
% based on: msSEI_switchingTimes_xover.m
%% ============================ settings =========... |
33a4985a731a60adfa38b7dd3f7a1eb94b09ac55b01554da366800e07087e10a | MATLAB | 10,476 | 198 | function [post nlZ dnlZ] = infGrid(hyp, mean, cov, lik, x, y, opt)
% Inference for a GP with grid-based approximate covariance.
%
% The (Kronecker) covariance matrix used is given by:
% K = kron( kron(...,K{2}), K{1} ) = K_p x .. x K_2 x K_1.
%
% Compute a parametrization of the posterior, the negative log marginal
... |
eb134231ffcc5117cf895ba07a2450f063af9740b6059d651cc8044c0f881b20 | MATLAB | 10,480 | 212 | function out = SY_SlowFeatureAnalysis(y, numWindows)
% SY_SlowFeatureAnalysis Slow feature analysis of windowed statistics
%
% Splits the time series into numWindows non-overlapping segments (same
% segmentation as SY_RampingWindows), computes five per-window statistics
% -- mean, variance, skewness, lag-1 autocorre... |
49688700d3c7349b5471e4091e1f84eaae5601f2ef49f5447bccfb985defd787 | MATLAB | 10,482 | 252 | % pop_exportbids() - Export EEGLAB study into BIDS folder structure
%
% Usage:
% pop_exportbids(STUDY, ALLEEG, 'key', val);
%
% Inputs:
% bidsfolder - a loaded epoched EEG dataset structure.
%
% Note: 'key', val arguments are the same as the one in bids_export()
%
% Authors: Arnaud Delorme, SCCN, INC, UCSD, Janua... |
93d1dadc082f9a0e050fcee126fc9daad568724e74681a969edf56fe7aa91929 | MATLAB | 10,489 | 251 | % function [onsets,peaks,slope_peaks] = fit_trialBased_ROL(path,elec,condition,deactive,norm)
% edited by Omri on Mar. 23, 2018
%% ROL thr_valueesh
%
% % Load data
% D = spm_eeg_load(path);
%
% % Get "good" trials
% tr_toplot = setdiff(indtrial(D,condition),badtrials(D));
%% Jiri -> Omri
elec = 1:size(trials.d... |
aea385ae83e7950c76d44f036fe44dee6ce7f7ee23aa2e751fa51fd23fbe9de8 | MATLAB | 10,496 | 256 | function out = PH_Walker(y, walkerRule, walkerParams)
% PH_Walker Simulates a hypothetical walker moving through the time domain.
%
% The hypothetical particle (or 'walker') moves in response to values of the
% time series at each point.
%
% Outputs from this operation are summaries of the walker's motion, and
% compar... |
265d62a4c4ce37f9ba0ad5fc64b24c9034f69ad8ef608e92b5f80ffdfeaacc94 | MATLAB | 10,498 | 308 | function fear_detectPfcGamma(basename,varargin)
%%
% clear
% load('~/data/Fear/triple/nostrum200304/nostrum200304.basicMetaData.mat')
% basename=basicMetaData.Basename;
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
[lfpFile,lfpDir... |
6be416b95a56bb6265ddd76ee030c1b7f04a47dd63bf2f5eb93c7ad8b001090c | MATLAB | 10,504 | 329 | function Fig4Sup2_CompetitionTitrations(varargin)
% Fig4Sup2_CompetitionTitrations
% Plots overlayed EC50 dose-response curves for GABA in competition with
% various decoy ligands (1 mM fixed decoy concentration). Each decoy
% condition is shown on a single plot.
%
% USAGE:
% Fig4Sup2_CompetitionTitrations() %... |
6f63e6b019242d371e4001f0b9b30ef680907eaee5ec7b0cf72d602e6e4eb971 | MATLAB | 10,507 | 427 | function [Model, Info] = linear_map_sparse_cov(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% is imposed to get sparse weight matrix
%
% [Model, Info] = linear_map_sparse_cov(X,Y,Model,parm)
%
% --- Input
% X : Input d... |
3f78d83ca2250bb8bcd5f8cb5ece63bd41b6a7ed4d2f32c2a9553fdd6f7493d4 | MATLAB | 10,508 | 271 | function [MRSCont] = osp_LoadNII(MRSCont)
%% [MRSCont] = osp_LoadNII(MRSCont)
% This function reads raw data from NIfTI-MRS files.
%
% USAGE:
% [MRSCont] = osp_LoadNII(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data container.
%
% ... |
3e57de361769394d15964b865246732fc840bbf2e95a4b3abfd4e99ffd50878c | MATLAB | 10,511 | 308 | function [dY, Tension] = myofilament(time, Y, tDrugApplication, Cai_um, fmyo)
% Model parameters
contrflag = 0;
% Metabolite reference concentrations
Pi_ref = 2; %mM Def: 2
MgATP_ref = 5; %mM Def: 5
MgADP_ref = 0.036; %mM Def: 0.036
% MgADP dissociation constant
kdADP = 0.004; % uM
% Set... |
3a003e67ee70ab6cd5ecadb080bf4d65f831c22d5f61dcfcb01b011d7678313a | MATLAB | 10,513 | 236 | % POP_SUBCOMP - remove specified components from an EEG dataset.
% and subtract their activities from the data. Else,
% remove components already marked for rejection. When used
% with the options 'keepcomp', the function will retain [1]
% or reject[0] the... |
3ce7bc7b62ef037a90619fdf46f449ec1acc905ee0330919e8ec8adb8a21aab3 | MATLAB | 10,526 | 465 | function [ps, fe] = ...
tapas_sem_single_subject_estimate(data, ptheta, htheta, pars)
%% Estimates the posterior probability of the parameters using MCMC combined
% with path sampling.
%
% Input
% y Saccade data.
% u Experimental input.
% ptheta Priors of the model
% htheta Kernel transformati... |
e61fad2f843986741b121185a379b84a46f751fb03177820805cdd6cb04699ec | MATLAB | 10,534 | 380 | function varargout=h5load(filename, varargin)
% Load data in an HDF5 file to a MATLAB structure.
% adapted from the EasyH5 Toolbox: https://github.com/fangq/easyh5
%
% SYNTAX:
% data = h5load(filename)
% data = h5load(filename, dspath)
%
% INPUTS:
% - filename - Name of the h5 file to load data from
% - dspath - Dat... |
cadac0d897c0100ac58bc7daae186917fb445780e41dca6b6f7fd88a1989dafd | MATLAB | 10,541 | 244 | function stlwrite(filename, varargin)
%STLWRITE Write STL file from patch or surface data.
%
% STLWRITE(FILE, FV) writes a stereolithography (STL) file to FILE for a
% triangulated patch defined by FV (a structure with fields 'vertices'
% and 'faces').
%
% STLWRITE(FILE, FACES, VERTICES) takes faces and verti... |
33fc57e786b7580e99eb4dd433ee6bfd50e5d5a9c1711aa5888248815cd968b4 | MATLAB | 10,543 | 331 | %% Constant parameters
params.wsfn = ''; % don't look at wavesurfer data (for in vivo, doesn't exist)
params.framesToDisregard = 0;
params.Nplanes = 4;
params.vertSplit = 1;
mov.numToAverage = 0; % Number of files to average for the ROI preview
mov.opto = 0; % Is the file a repeated opto stim file?
%% Add pa... |
ee985caffd179f81f47fb075ac58c0642de09077eee441f93255990583c4089a | MATLAB | 10,545 | 296 |
% plots an axis / calibration
%
% usage: outParams = AxisMMC(start, fin, params)
%
% 'start' and 'fin' are the starting and ending values of the axis
% 'params' is an optional structure with one or more of the following fields
% tickLocations default = [start fin]
% tickLabels default = {'st... |
d8c5bc414359d8760fb8f0965f5b8f6f64ad1db21cf17b34ee76f071fc7c0a26 | MATLAB | 10,547 | 244 | %% ms SEI: suppl. fig - 3D brains (highlight DMN & DAN)
% 25 subj - v31
% (c) Jiri, Jan24
%% settings: v1 - relaxed conditions (p-level, length of significance, ...)
dirSuffix = '_msSEI_supplFig_3D_brains_v1';
t_sel = [-1.0, 2.0]; % the true sel time will be cut by 1 s on edges (= template length): [-2, 2] -> [-1,... |
c7a44781fdcacc6e78242d4e1a7ce82e1eb51f382b2cccd838f3fa42f40c3d6a | MATLAB | 10,549 | 331 | function main(Param)
%% Main 2018/09/03 by T. Ezaki
%% This program estimates a maximum entropy distribution
%% using the maximum-likelihood method.
% Close figures
%close all
if nargin > 0
ProcessType = Param.ProcessingType; % ProcessType
% Energy Landsca... |
a71318abd229ff8889f9162c372d91c4dedbba2c036410bb6ab1ed785ecd66ad | MATLAB | 10,550 | 350 | %Open windows and run experiment
function [alltrials] = RunExperiment_Fine(subjectID, trials, nstaircases, stimdur, block, ped, judge, task, display, alltrials, gpref)
viewdist = 50;
scrnvbl = 27.2;
refdirection = 45;
fixedrefdirection = refdirection;
peddisp = 12;
trialdur = 3; %in secs, total trial duratio... |
cb3fbee135952cbcf4023d6b08abfc3d462f77d998de495efcc8e2abb2fb8df1 | MATLAB | 10,551 | 338 | function [dmt,clusters,dm,mask,CLU] = density(XYZ,u,varargin)
% function [dmt,clusters,dm,mask,CLU] = density(XYZ,u,[radius_mm],[output_filename],[zscores])
%
% XYZ is 3-column vector of coordinates
%
% Tor Wager 2/18/02
P = ['brain_avg152T1.img']; % 2 mm voxels
P = 'scalped_avg152T1_graymatter_smoothed.img';
if... |
9dab33ce8311e104800fd8aebdf39506ac25ad4df871dd8ae4a2dc793c6de009 | MATLAB | 10,557 | 250 | %{
#
-> stimulus.Sync
-> fuse.ScanDone
-> tune.DotRFMethod
%}
classdef DotRF < dj.Computed
properties
popRel = tune.DotRFMethod * fuse.ScanDone * stimulus.Sync & (stimulus.Trial & stimulus.SingleDot)
end
methods(Access=protected)
function makeTuples(self, key)
% get parameter... |
04d2e95336e459bd977c4715f7f1cc3408d813ea9049700dedbd2d0bccd28b64 | MATLAB | 10,558 | 343 | % op_robustSpecReg.m
% Georg Oeltzschner, Johns Hopkins University 2019.
% Mark Mikkelsen, Johns Hopkins University 2019.
%
% USAGE:
% [out,fs,phs] = op_SpecRegFreqRestrict(in, seqType, echo, F0, noAlign);
%
% DESCRIPTION:
% Perform spectral registration in the time domain to correct frequency and
% phase drifts in a r... |
fe5100a06f94dff06563336be5aa38b3cc7c977dc9749556988aa6e583e0b381 | MATLAB | 10,560 | 206 | function [varargout] = gp(hyp, inf, mean, cov, lik, x, y, xs, ys)
% Gaussian Process inference and prediction. The gp function provides a
% flexible framework for Bayesian inference and prediction with Gaussian
% processes for scalar targets, i.e. both regression and binary
% classification. The prior is Gaussian proce... |
335a1aefd9be11394baa217bc99aa3fcaaa9cda4495f8ae338357666015f935e | MATLAB | 10,562 | 278 | function this = MrDimInfo_constructor(this, dimInfoVariants)
% Unit test for MrDimInfo Constructor evoking all 6 variants
%
% Y = MrUnitTest()
% run(Y, 'MrDimInfo_constructor');
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrDimInfo_constructor
%
% See also MrUnitTest
% Author: Sask... |
efe8e55a649ac637387e4a036fe80dc0b7e451bd71b51238aa63056ea0477698 | MATLAB | 10,564 | 397 | function DB = Meta_Chisq(DB,varargin)
% DB = Meta_Chisq(DB,[verbose],[mask image name],[control strings])
%
% NEEDS:
%
% to set up design:
%DB.(fields) % lists of fields containing task conditions for each coordinate point
%DB.pointind % indices of which coord points are in which unique
% contrast
%... |
a7134d3b6902302643227145758c65f6d7a28788e4f37dccedcd281f1409a292 | MATLAB | 10,570 | 257 | classdef MatrixVectorizer < handle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MatrixVectorizer vectorizes a symmetric matrix.
%
% Provides fit/transform separation for ML pipelines: fit() learns the
% edge indices and SMR mask from training data, and transform() applie... |
dfd5d168cdf9095dda479f87a91d4bc3ef1488e69a7e02492b42888c1094e455 | MATLAB | 10,578 | 351 | function fear_detectAmyHFO(basename,varargin)
% (high/fast) gamma in BLA
% wake: 75-95 Amir et al. Pare, 2018 Neuron
% wake: 70-120 Stujenske Gordon 2014 Neuron
%%
% clear
% load('~/data/Fear/triple/nostrum200304/nostrum200304.basicMetaData.mat')
% basename=basicMetaData.Basename;
%%
load([basename '.basicMetaData.mat'... |
b50cbb85c7cfec0cb4c900504eeb73170daa8d8e1f8345f0301ea842219d55a1 | MATLAB | 10,579 | 256 | function [means,p] = HierarchicalBootstrap(data,varargin)
% HierarchicalBootstrap:
%
% The function implements a hierarchical bootstrap as described in
% Saravanan et al. (2021) https://doi.org/10.1101/819334 with the addition
% of a within-subject design bootstrap, where data from the same e.g.
% animal is sampled to... |
423fec0e101d3780b9761e88ca345bdef9d4043cfb114cb7de27af2527bd14f8 | MATLAB | 10,581 | 274 | function [bursts,z] = FindBursts(spikes,varargin)
% FindBursts - Find bursts of action potentials in a spike train
% This function implements the method used by Wierzynski 2009. I.e. smooths
% the mua spike train and identified periods where it surpasses a low-threshold,
% provided that a high threshold is surpassed s... |
cf285f148c3c0c713fd64bb95da1e845a108f259050d030998e705e1a6d9be72 | MATLAB | 10,586 | 300 | %% [localField,maskFinal] = BackgroundRemovalMacroIOWrapper(input,output,maskFullName,algorParam)
%
% Input
% --------------
% input : input directory contains NIfTI (*totalfield* and
% *fieldmapsd*) files or structure containing filenames
% output : output directory that stores the outpu... |
2be3ed4089f4f30d20334f700c36bac63a8b9b1f7c9574cafdcbad7a5a1ad2ca | MATLAB | 10,590 | 359 | function [t,f_new,g_new,funEvals,H] = WolfeLineSearch(...
x,t,d,f,g,gtd,c1,c2,LS_interp,LS_multi,maxLS,progTol,debug,doPlot,saveHessianComp,funObj,varargin)
%
% Bracketing Line Search to Satisfy Wolfe Conditions
%
% Inputs:
% x: starting location
% t: initial step size
% d: descent direction
% f: function v... |
cc75fd41678be4a638d02f28ec6326bae340594aa2141c8cf44ae4f261f69046 | MATLAB | 10,590 | 247 | % CONVERTLOCS - Convert electrode locations between coordinate systems
% using the EEG.chanlocs structure.
%
% Usage: >> newchans = convertlocs( chanlocs, 'command');
%
% Input:
% chanlocs - An EEGLAB EEG dataset OR a EEG.chanlocs channel locations structure
% 'command' - ['cart2topo'|'sph2topo'|'s... |
b635a9f67c57c00a688d8daba28cbdcfae650fd348a7c20d90a24056b3ef396c | MATLAB | 10,599 | 206 | %% [chi] = Wrapper_QSM_LSQRandHEIDI(localField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% localField : local field map (tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of t... |
fe3e0596c6376bfcf6f6e178add54010fd980b8ac29fe57b57e76b4ff5a85028 | MATLAB | 10,609 | 258 | function chanunit = ft_chanunit(input, desired)
% FT_CHANUNIT is a helper function that tries to determine the physical
% units of each channel. In case the type of channel is not detected, it
% will return 'unknown' for that channel.
%
% Use as
% unit = ft_chanunit(hdr)
% or as
% unit = ft_chanunit(hdr, desired)
... |
4dccc4a4f8abc6bf99d5a7280680ffca933e7ab166f895334ea8cbf2d93e0d66 | MATLAB | 10,626 | 234 | classdef McsData < handle
% McsData Read and store the contents of a HDF5 file generated by MCS software.
% Holds a cell array of the recordings present in the file.
% Read a HDF5 file:
%
% data = McsData('Name_of_HDF5_file.h5');
%
% Plot the individual streams contained in the fi... |
f51df72d2b98fe7684d95aefd2204a00f15736cb2a1951fcc597cc0a0faf3f05 | MATLAB | 10,632 | 215 | function support_func_plot_se(xdata,ydata,cmap,varargin)
%% ########################################################################
% - support_func_plot_se(xdata,ydata,cmap,varargin) -
% #########################################################################
% Plot mean ±... |
f744341c360e66f69fdd963ec581280966a30be35d1e7fc1379f973247d58691 | MATLAB | 10,651 | 285 | function demo_roi_quantification_mip()
% DEMO_ROI_QUANTIFICATION_MIP
%
% Public-release demo for ROI-based quantification on 3D abundance maps.
% The workflow is designed for quantifying signal changes in regions such as
% the spinal cord and cisterna magna from spectrally unmixed 3D volumes.
%
% This demo:
% ... |
8bd1acd2bbcce537491f56d7fffc7eca9f2d3d0ebd73ef31320dd078d49a6625 | MATLAB | 10,656 | 290 | function M = sympositivedefinitesimplexcomplexfactory(n, k)
% Manifold of k product of n-by-n Hermitian positive definite matrices
% with the bi-invariant geometry such that the sum is the identity matrix.
%
% function M = sympositivedefinitesimplexcomplexfactory(n, k)
%
% Given X1, X2, ... Xk Hermitian positive defini... |
d05dbefae1aa8de039fee186e2bd20708c81561795f69e7226222aaaa31080e8 | MATLAB | 10,659 | 268 | function varargout = run_NBSPredictWorkspace(varargin)
% RUN_NBSPREDICTWORKSPACE MATLAB code for run_NBSPredictWorkspace.fig
% RUN_NBSPREDICTWORKSPACE, by itself, creates a new RUN_NBSPREDICTWORKSPACE or raises the existing
% singleton*.
%
% H = RUN_NBSPREDICTWORKSPACE returns the handle to a new RUN_NBS... |
70bd692ce75c89755683d675cca42c3b2d16d258daba8822e5a795ed77a1af64 | MATLAB | 10,673 | 275 | function out = CP_ML_StepDetect(y, method, params)
% CP_ML_StepDetect Analysis of discrete steps in a time series.
%
% Gives information about discrete steps in the signal, using the function
% l1pwc from Max A. Little's step detection toolkit.
%
% cf.,
% "Sparse Bayesian Step-Filtering for High-Throughput Analysi... |
9bf11f5915b5d9fd12b2700ab56e07ea1e52ead1efd1fe497b550f6f5d19a5bc | MATLAB | 10,678 | 305 | %
% Compute heart and respiratory rates in Hz.
%
% Parameters
% ----------
% participant: integral number
% Participant to process.
%
% Outputs
% -------
% The outputs are saved as .csv files.
%
% Author
% -------
% Ségolène M. R. Guérin
% March 11, 2025
% URePSSS, ULCO
%
function motimus_compute_hr_respi_time_ser... |
0995deb756fd43b5f0ac7cc9feb2625e5d56b5a50e08d2103feab5eb9fa09b59 | MATLAB | 10,696 | 301 | function [type, dimord] = ft_datatype(data, desired)
% FT_DATATYPE determines the type of data represented in a FieldTrip data structure
% and returns a string with raw, freq, timelock source, comp, spike, source, volume,
% dip, montage, event.
%
% Use as
% [type, dimord] = ft_datatype(data)
% [bool] = ft_... |
bd49761aa06702447b7efb2542d1ead9911b4bf356a40962cf10a42ac1157a95 | MATLAB | 10,706 | 253 | % simBarScript.m - script to simulate bar stimuli and calculate RF responses
% can also apply anatomical transformation to RF responses
% used to generate plots from Fig. 6 of Kuo et al., 2025
%
% Usage - run the script with the appropriate parameters to generate plots from Fig. 6
%
... |
fda94368375e97f6027538a46b694e7a4171b1956a8e14d4df0d9ae5999465e1 | MATLAB | 10,709 | 310 | function [result,msg] = eps2pdf(epsFile,fullGsPath,orientation)
%EPS2PDF Converts an eps file to a pdf file using GhostScript (GS)
%
% [result,msg] = eps2pdf(epsFile,fullGsPath,orientation)
%
% - epsFile: eps file name to be converted to pdf file
% - fullGsPath: (optional) FULL GS path, including the file ... |
b0d6ff198ca7b2e871b7948801fa028323f40b5b43934b20f36b53ac5c3c6609 | MATLAB | 10,713 | 278 | %script MatAFNI_Demo
%
%
%
%Purpose:
% Demonstrate the use of the matlab AFNI library
% The script is echoed onto the screen but it is best
% you read through it with a text editor.
%
%
%Input:
% You must have the data sets
% ARzs_CW_avvr+orig, ARzs_CW_avvr.DEL+orig and ARzsspgrax+orig
% in the working dire... |
c88a4adc60ff8443b8a065079f33432ad3bf38eb5a736fd5cd55c7ae2ade19fe | MATLAB | 10,714 | 336 | function [newax, pointhandles] = plot_points_on_montage(xyz, varargin)
% [newax, pointhandles] = plot_points_on_montage(xyz, varargin)
%
% Plots points on montage of slices
% - Solid brain slices or contour outlines
% - Points or text labels or both
% - Flexible slice spacing, colors, marker sizes/styles, axis layout (... |
df7dfea608e426a564cc2470a576f86cd1f546e1a5c81da79db2fdf629586ebf | MATLAB | 10,724 | 251 | function SetCurrentSession(filename,opt)
%SetCurrentSession - Load all data for a given recording session.
%
% Set current session files and read data from disk. Calling SetCurrentSession
% without parameters will display a file selection dialog. If <a href="www.cellexplorer.org">CellExplorer</a>
% format files are de... |
8c1ded794fd6a22a33d9f8dca49c36034e5fdaa55cbb562ff586e4584f6f2e49 | MATLAB | 10,726 | 231 | function create_tsne_Callback(hObject, eventdata, handles)
% Creates a 2-dimensional t-sne image of calls.
padding = 1000; % Pad the temp image by this amount, so that calls near the border still fit.
blackLevel = 80; % Subtract this value from each call image to make a nicer picture.
% Select embedding type
embeddi... |
bf4ba5c70ef26647b9b4d7f89b52adf9029010fd34e4c7262e5140b54cef211e | MATLAB | 10,729 | 270 | % STD_LM_GETVARS - Retrieve categorical or continuous variables from a
% design in the STUDY structure to build the regressors
%
% Usage:
% >> [var_matrix,catvar_info] =
% std_lm_getvars(STUDY,'S01','design_indx',1);
% >> [var_matrix,catvar_info] =
% std_lm_getvars(STUDY,'S01','desi... |
21b6555801058e1c9a6bfff9fcb1b3efd670da4b86336c6b2589c872d91ce807 | MATLAB | 10,736 | 345 | function M = productmanifold(elements)
% Returns a structure describing a product manifold M = M1 x M2 x ... x Mn.
%
% function M = productmanifold(elements)
%
% Input: an elements structure such that each field contains a manifold
% structure.
%
% Output: a manifold structure M representing the manifold obtained by
%... |
18bcb05d0e9c00d8c04ff04968e1a002a5272dbc479a687fa178b8dcfe298e22 | MATLAB | 10,745 | 244 | % fig5_noGUI.m
% RF parameters:
% C/S size ratio: 0.8 to {N/A, 3, 4.7, 5.2, 5.5, 5,7} deg (resulting center frequencies: 0 for 0 surround amplitude, 0.08 cpd otherwise)
% surround amplitude: {0, 0.2, 0.4, 0.6, 0.8, 1}
clear
close all
% simulated response parameters
deltaFMax = 1;
noiseStd = 0.01;
smoothingSigmaVis =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.