sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
af3e50312a9c64b35c11ba5e170d1bfb7f56494e4920061619ad0558cfc620b3 | MATLAB | 8,287 | 249 | %% SWISMWIIOWrapper(input,output,algorParam)
%
% Input
% --------------
% input : input structure containing filenames
% output : output directory that stores the output
% algorParam : structure contains method and method specific parameters
%
% Output
% --------------
%
% Description: This i... |
39f44c996dc40d0be954f0f555a504b7f045114081bb041a48cb30cb48bd5670 | MATLAB | 8,292 | 243 | function [data,stats] = SurveyPhasePrecession(group,clusters,channel,subsessions,varargin)
%SurveyPhasePrecession - Compute and plot phase precession plots for all subsessions.
%
% USAGE
%
% [data,stats] = SurveyPhasePrecession(group,clusters,channel,subsessions,<options>)
%
% group electrode group (e.... |
e22b163cc999fd1bd2c6e462ce10fe9e6a482c2f91c7f535610be3b58486e4f0 | MATLAB | 8,296 | 218 | % EEG_EPOCHFORMAT - Convert the epoch information of a dataset from struct
% to array or vice versa.
%
% Usage: >> [epochsout fields] = eeg_epochformat( epochs, 'format', fields, events );
%
% Input:
% epochs - epoch numerical or cell array or epoch structure
% format - ['struct'|'array'] conver... |
301cb52472a566e282839a88862328dcfd804c537ef437de8f6a4505903b4090 | MATLAB | 8,303 | 229 | function paramBC = bc_qualityParamValuesForUnitMatch(ephysMetaDir, rawFile, ephysKilosortPath, gain_to_uV, kilosortVersion)
paramBC = struct;
if nargin < 5
kilosortVersion = 4;
end
%% calculating quality metrics parameters
% plotting parameters
paramBC.plotDetails = 0; % generates a lot of plots,
% mainly g... |
5040a7e1a660d15ff2a94e2b182008b04851c08ca50b89797d23070ea65c4a20 | MATLAB | 8,304 | 212 | function out = MF_GP_FitAcross(y, covFunc, npoints)
% MF_GP_FitAcross Gaussian Process time-series modeling for local prediction.
%
% Trains a Gaussian Process model on equally-spaced points throughout the time
% series and uses the model to predict its intermediate values.
%
% Uses GP fitting code from the gpml tool... |
5a53fa68d2f468f0a806b0c46f222c0dc039941956a2d58d16e745a959fd7e3c | MATLAB | 8,305 | 212 | function [ ] = corrplot( data, varnames1, varnames2, groupvar)
% 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 confidenc... |
d304949ba2b1d6aec7bd14267f99c46527dd5d3661990d342e99b2877155e96d | MATLAB | 8,324 | 286 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Reproduces Figure 3-figure supplement 1
%
% Visualises ROI condition estimates (obtained from GLM2 used for RSA)
% and compares full and reduced models of ROI activity (group-average or
% mixed-effects approach)
%
% Dan Bang danbang.db@gmail.co... |
f1b4124d313f7e6507e7acb93bda77886a2c8954147a1e82c31e8d8f0807640f | MATLAB | 8,324 | 185 | function [SSQs, DFs, MSQs, Fs, Ps]=mixed_between_within_anova(X,suppress_output)
% simple function for mixed (between- and within-subjects) ANOVA
%
% Based loosely on BWAOV2 (http://www.mathworks.com/matlabcentral/fileexchange/5579-bwaov2) by Antonio Trujillo-Ortiz
% (insofar as I used that function to figure out... |
e0f136d10e5f2b3eba860fe844ce41f33d5559c1903c23d5504393fbf1f4972f | MATLAB | 8,326 | 267 | function regionalcorrsvr(indnodes,Fitted_Subgroup,Age2,roi_num,Gradeintsall,finalYCorr,typeofstat,result_name,resssname,finalYCorrcov,dirpath);
Rslopecorrall=[];Fitted_ageind=[];tempcolornode=zeros(roi_num,(length(Age2)-1));
Fitted_ageind=1:1:max(Fitted_Subgroup);
Fitted_Subgroupforbin=[ round(length(Age2)/1100) rou... |
cd1be616c8321bec7ff647955838f5552ae2923639dd9c21a3ef4adea7bc9377 | MATLAB | 8,327 | 280 | % MOVAV - Perform a moving average of data indexed by xvals.
% Supports use of a moving non-rectangular window.
% Can be used to resample a data matrix to any size
% (see xadv NOTE below) and to regularize sampling of
% irregularly sampled data.
% Usage:
% >> [outdata,outx] = ... |
950350b16172c7078cc543b7302ceaaf9252867acd9c0c36588011fba3c79187 | MATLAB | 8,331 | 233 | function [result] = fit_happy_model_nogain_guiltenvy_utl(mtx,happyscore,constant)
%assumes that each row of the cell array is a different subject
rptfit = 100; %repeat N times jittering the betas
tempf=fieldnames(mtx);
for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end;
data = mtx;
... |
27738f54ad573b1c255954dc56a541cc257eac12f7f13760efc87a11d604fbe8 | MATLAB | 8,332 | 295 | function FigureS2(datadir, codedir)
%FigureS2 - Trial initiation times depend on previous trial outcome
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'IgnoreCase', ispc);
if ~onPath % only add code di... |
0aa3fd2267e102a5f56c5f9b17bfd627aabcf2e6e07b6d882f72de9243e86b89 | MATLAB | 8,335 | 233 | function dataMatrixNorm = BF_NormalizeMatrix(dataMatrix,normMethod,isTraining)
% BF_NormalizeMatrix Normalizes all columns of an input matrix.
%
%---INPUTS:
% dataMatrix, the input data matrix
% normMethod, the normalization method to use (see body of the code for options)
% isTraining, learn the normalization param... |
3a7c9889ce82b4c74c505f20f303a05b7d49eb952461dae8328768c0119c619f | MATLAB | 8,337 | 256 | % make this a function that outputs all the desired metrics, also.
% x, the data(n-chan by m-pointsintime)
% regs, the regressors
% window, the window that should be used (m timepoints long!)
% delay_in_samples (if this is set, expand all the regressors to all time
% points for each channel).
% fix_delay, a matrix of n... |
b6ea87f422627eb97e907e3bf71eac26835d2fee2eea3473298a59c7d78d9470 | MATLAB | 8,337 | 209 | function [eta, Heta, hesscalls, stop_str, stats] = arc_conjugate_gradient(problem, x, grad, gradnorm, sigma, options, storedb, key)
% Subproblem solver for ARC based on a nonlinear conjugate gradient method.
%
% [eta, Heta, hesscalls, stop_str, stats] =
% arc_conjugate_gradient(problem, x, grad, gradnorm, sigma, o... |
e8b581dcf05d41915ec207286587e4d44677cb4743ed73cd51cc2cdd25405b72 | MATLAB | 8,337 | 210 | function app = setAppParams(app, Params)
%SETAPPPARAMS Load saved parameters and add them to GUI
% INPUTS
% -------------------------
% app : matlab app object
% Params : structure
% OUTPUTS
% ------------------------
% app : matlab app object
%
% NOTES
% ---------------------------
% Might be easier to store a... |
054d783646e0648449858c0482ebd0d943f3531c48721ead4d74177246e83d31 | MATLAB | 8,338 | 241 |
%% load activity
clear;
mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble';
sub_pool = [1:28, 30, 32, 33, 34, 35];
cur_struct = MRIread('/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/brainmask/mask_HPC_2mm.nii');
cur_erc_ima = cur_struct.vol;
mask_index = find(cur_erc_ima==1);
expo... |
6b10d9abbf6a0ae0a2cf0d7a75567debead213c6362b201a664445b7f04ff972 | MATLAB | 8,349 | 177 | set_up_paths_and_data_directories;
bold_suffix = 'space-MNI_desc-ppres_bold.nii';
tr_length = 1.3;
stim_names = {
'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ...
'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ...
'Superhero', 'Tears_of_St... |
633b2a1d95b21e44a0aaa6693eca8523caa3432de9d337df1990311f928706c0 | MATLAB | 8,359 | 192 | %% ms SEI table - anatomy area (AA) in brainAtlas (Yeo NN: Yeo7 or Yeo17)
% lists how many channels from each Yeo NN fall into an AA
% AA can be:
% - neurologist label
% - Mars atlas, ...
% (c) Jiri, Oct23
%% settings: v1 - relaxed conditions (p-level, length of significance, ...)
dirSuffix = '_msFig_AA_v1_relaxC... |
85d58ada08a91ecbf3e9ec5f19939bc6013d23826e7cf5b6613680e2e1eb8764 | MATLAB | 8,362 | 188 | function c = tapas_hgf_binary_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF)
% for binary inputs in the absence of perceptual uncertainty.
%
% The HGF is the model introduced in
%
% Ma... |
89312dfba5916cb18a2317b09fb1cbc9283a3b22a08e258491b849a4117de553 | MATLAB | 8,363 | 222 | function [f,J,D] = tapas_ceode_fx_cmc(x, u, P, M, xtau)
% [f,J,D] = tapas_ceode_fx_cmc(x, u, P, M, xtau)
%
% Computation of the dynamical (state) equation for a neural mass model
% (canonical microcircuit). Compatibile with continuous extension for ODE
% methods. Adapted from spm_fx_cmc.m (original function license be... |
9a0771ce60992e5e3e88ca909aa86d898899a0653552cdfd6127ef265cf00119 | MATLAB | 8,370 | 208 | % DFTFILT3 - discrete complex wavelet filters
%
% Usage:
% >> [wavelet,cycles,freqresol,timeresol] = dftfilt3( freqs, cycles, srate, varargin)
%
% Inputs:
% freqs - vector of frequencies of interest.
% cycles - cycles array. If cycles=0, then the Hanning tapered Short-term FFT is used.
% If one... |
6bee7a97fc7cbba433675fbe8c2a8238fa8fb9820e9db9ebf8a5c013e0a0c49b | MATLAB | 8,371 | 190 | function [hc] = read_ctf_hc(filename)
% READ_CTF_HC reads the MEG headcoil marker positions from an ascii file
% and computes the coordinate transformation required to get from from
% dewar to head-coordinates
%
% the definition of head coordinates is according to CTF standard:
% - the origin is exactly between LPA an... |
0ca791c008d47edb1243a7f2d731946b8e251bd4887652ae53eec052f7c23521 | MATLAB | 8,382 | 258 | function [mov_corrected,template]=motionCorr1Movie(inputData,varargin)
% with output > [mov_corrected]=motionCorr1Movie(input)
% without output > motionCorr1Movie(pathG,'nonRigid', false,'isRawInput',false,'dcRemoval',false);
%
% options.isRawInput=[];
% options.dcRemoval=false; % useful if not treating a bp m... |
e00b4a04f736410d03d70e3204eb5be42b04c27e747189427a72cf7e3c9c575d | MATLAB | 8,382 | 259 | function [err,Info, opt] = New_HEAD (opt)
%
% [err,Info, Opt] = New_HEAD (Opt)
%
%Purpose:
% A function for the likes of Greg Detre.
% It makes the creation of an AFNI dataset
% from a 3 or 4 dimensional matrix in matlab a breeze.
%
%
%
%Input Parameters:
% opt is an options structure with the following field... |
6256d4fe245f37790f61cdd0c0539cf608dbd73430eff45c6583998f80769e00 | MATLAB | 8,389 | 256 | function out = SB_MotifTwo(y, binarizeHow, tau)
% SB_MotifTwo Local motifs in a binary symbolization of the time series
%
% Coarse-graining is performed by a given binarization method.
%
% ---INPUTS:
% y, the input time series
% binarizeHow, the binary transformation method:
% (i) 'diff': incremental time-serie... |
12e009e51ae7cce45b4a13cf4b4849df1ea1b2e82bf2b74a0d0623e028a91342 | MATLAB | 8,391 | 226 | function varargout = Meta_analyze_data(y,varargin)
% varargout = Meta_analyze_data(y,varargin)
%
% Inputs
% =========================================================================
% Weights:
%'w' % followed by weights
% Analysis types:
%'chi2' % weighted chi-square... |
c391373ae1e2d00c553f2a0bb580d903f79109404eacd06752ea4b3c266113ec | MATLAB | 8,399 | 247 | function [dat] = ft_fetch_data(data, varargin)
% FT_FETCH_DATA mimics the behavior of FT_READ_DATA, but for a FieldTrip
% raw data structure instead of a file on disk.
%
% Use as
% [dat] = ft_fetch_data(data, ...)
%
% See also FT_READ_DATA, FT_FETCH_HEADER, FT_FETCH_EVENT
% Copyright (C) 2009-2013, Jan-Mathijs Scho... |
9de91fe656e2d4a635265dd0bd1be9bed85c9f5a2c4184c9703fedbd2956fd23 | MATLAB | 8,400 | 198 | % STD_BUILDDESIGNMAT - Build the design matrix for an specific design
% specified in the structure ''design'' provided as input
%
% Usage:
%
% [tmpdmat,colLabels,catflag] = std_builddesignmat(design, trialinfo, 1)
%
% Inputs:
% design - Design structure as in the STUDY
% trialinfo - Structure of trial informa... |
e301d2368b2282c04e9f1e6ddf445e79a515d241bab81e22677d73c320ca23bd | MATLAB | 8,400 | 226 |
clear; close all;
homerOnlyDir = '[path-to...]/pruningComparisonsMatlab/stats/brightHomerOnly';
qtOnlyDir = '[path-to...]/pruningComparisonsMatlab/stats/brightAllParams';
%specify ages to include in analysis
ages = {'05', '08', '12', '18', '24'};
%specify other info about data
tasks = {'hand', 'social'};
cohorts =... |
6b7dac8f993a7e95657588c489939bf95c08eb728f2bae4cb356264ab58a69be | MATLAB | 8,401 | 267 | function [u,OUT] = density_pdf(n,n2,radius_mm,iterations,varargin)
%function [u,OUT] = density_pdf(n,n2,radius_mm,iterations,[opt] RESUME)
%
% given a brain mask and n coordinate points, this function computes
% a null hypothesis probability density function based on the number
% of iterations specified, and returns s... |
b2410860af2cdd0beee20db8d0aa8f864952e34114d68ad025a956430d9b6793 | MATLAB | 8,401 | 161 | %% h = sepia_handle_panel_qsm_HEIDI(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other hand... |
f745a3d0e527c02f86dd638ff34e3f4b0d05f80b273adee377b4004dfb7658de | MATLAB | 8,401 | 200 | function lambdas = hessianspectrum(problem, x, usepreconstr, storedb, key)
% Returns the eigenvalues of the (preconditioned) Hessian at x.
%
% function lambdas = hessianspectrum(problem, x)
% function lambdas = hessianspectrum(problem, x, useprecon)
% function lambdas = hessianspectrum(problem, x, useprecon, storedb)
... |
0c2de07fcad062aa53affb1a36c6c3b78eceb6ac06195762098e1873a8df763c | MATLAB | 8,402 | 211 | function [MRSCont, retMsg,reordered] = osp_detDataType(MRSCont)
%% [MRSCont, retMsg] = osp_detDataType(MRSCont)
% This function determines the MRI vendor and datatype of the filenames
% provided in the MRSCont.files cells. A warning is flagged if the
% vendor (and filetype) is not identical between all files.
%
%... |
df14545b689c93997b716e25f5032fb4bfcd0d4e5b0f657de462b61416dd7798 | MATLAB | 8,402 | 250 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Implements confidence model illustrated in Figure 4A
% and reproduces Figure 4B
%
% "Private confidence" is computed by training multinomial regression on
% data from prescan session and then applying weights to data from fMRI
% session while s... |
30c0d3b48cf48473ccbd75e36ef8b595f49ed341ec6affe1de6c50804e3e2dd7 | MATLAB | 8,404 | 205 | %% h = sepia_handle_panel_utility_convert_realImaginary2phase(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h ... |
71f94e56b62fcb1b5e5e104c6e387277e6525406f599a882829e4dd3af52f68d | MATLAB | 8,404 | 217 | function varargout = TMStarget(varargin)
% TMStarget GUI by Gong-Jun JI
%-----------------------------------------------------------
% Copyright(c) 2016; GNU GENERAL PUBLIC LICENSE
% Laboratory of Cognitive Neuropsychology, Department of Medical Psychology, Anhui Medical University
% Written by Gong-Jun JI
%
% See ... |
f19652d49780a0507c9fc3256e5300da5d9bd8f443091a9b7837059f45de9705 | MATLAB | 8,407 | 204 | function [varargout] = fMRIDataMasking(fullBrainVols, binaryMasks_nS, betaCorrespondence, userOptions);
% fMRIDataMasking is a function which takes a full set of fMRI brain scans and
% masks them according the the masks specified by the user (if any). If no
% masks are specified then no masking is done.
%
% [response... |
34887cf981bd90617ae06569c2ee2f97f7fdbd909ab072951d574e68ac8a5245 | MATLAB | 8,408 | 195 | function TOL_fig_harley1979(config,params,dat)
% TOL_fig_harley1979, figure of Harley (1979) apparatus and design
% Figure S3 for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80
% years on: A meta-analysis reveals poor replicability and little evidence for
% shortcutting. European Journal of Neuroscience. DOI: ... |
7f1f1492173c328cc4a5f96c221d4d4150ffdf20ac98a809c16b4eaa5c0cf7af | MATLAB | 8,413 | 202 | function [R, movement, verbose] = tapas_physio_create_movement_regressors(...
movement, verbose)
% Reads realignment parameters, creates derivative/squared & outlier regressor
%
% [R, movement, verbose] = ...
% tapas_physio_create_movement_regressors(movement, verbose)
%
% The 6 realignment parameters can be ... |
4eb019e1e1e6d383f8783680100c1e2d9622e9217b56a9af61893c04d7a5e9cd | MATLAB | 8,414 | 210 | % DEMO1_RSA_ROI_simulatedAndRealData
%
% This function computes the results in the main Figures of
% Nili et al. (PLoS Comp Biol 2013)
clear;clc; close all hidden;
returnHere = pwd;
cd ..;addpath(genpath(pwd));cd(returnHere)
userOptions = defineUserOptions;
mkdir('DEMO1');
userOptions.rootPath = [pwd,filesep,'DEMO1']... |
a72369dbf29377e96450e9cc3883adccefd31de584b88ad9b2102361357ee50c | MATLAB | 8,417 | 212 | % POP_RMDAT - Keep or remove continuous data around specific events
%
% Usage:
% >> OUTEEG = pop_rmdat( EEG); % pop-up a data entry window
% >> OUTEEG = pop_rmdat( EEG, typerange, timelimits, invertselection);
%
% Graphic interface:
% "Time-locking event type(s)" - [edit box] Select 'Edit > Event values'
% ... |
f6266013e3037caf86e0581015e6ca55539d8f3e7e8db9cef6e39e79fa01a1c9 | MATLAB | 8,418 | 229 | % pop_writebva() - export EEG dataset
%
% Usage:
% >> EEG = pop_writebva(EEG); % a window pops up
% >> EEG = pop_writebva(EEG, filename, 'key', val);
%
% Inputs:
% EEG - eeglab dataset
% filename - file name
%
% Optional input:
% 'DataOrientation' - ['VECTORIZED'|'MULTIPLEXED']
% ... |
9ff49d1006c904fdbcc2af75f14008d27a821f693cf4c0de82a6925f195b00ba | MATLAB | 8,436 | 183 | % STD_GETDATASET - Constructs and returns EEG dataset from STUDY design.
%
% Usage:
% >> EEG = std_getdataset(STUDY, ALLEEG, 'key', 'val', ...);
%
% Inputs:
% STUDY - EEGLAB STUDY set
% ALLEEG - vector of the EEG datasets included in the STUDY structure
%
% Optional inputs:
% 'design' - [num... |
9cd314ea4ee62f4a20cb01c0735c5221f82d515cad99ed3a4204588aec94cd94 | MATLAB | 8,446 | 240 | function [cTics, c, cSignals, extTriggerSignals, stringChannels, verbose, dtTics] = ...
tapas_physio_split_data_per_channel_siemens_tics(C, ecgChannel, verbose)
% Splits column data of Siemens Tics format according to their channel
% label in the 2nd column
%
% [cTics, c, cSignals, extTriggerSignals, stringCha... |
019f8e57457ee76445541e596171435a7665ab7147c4c6359fad7ca2bc0fa77d | MATLAB | 8,448 | 230 | function [spectrogram,t,f,phase] = WaveletSpectrogram(lfp,varargin)
%WaveletSpectrogram - Compute LFP wavelet spectrogram
%
% The spectrogram is computed using the <a href="http://paos.colorado.edu/research/wavelets/">wavelet toolbox by C. Torrence and G. Compo</a>.
%
% USAGE
%
% [spectrogram,t,f,phase] = Wavelet... |
9001f57e2d3007a57e0d91731c6a8e64a667ece6373715dbc384b8b0c51df46c | MATLAB | 8,449 | 170 | % POP_ERPIMPARAMS - Set plotting and statistics parameters for
% computing and plotting STUDY mean ERPimages and measure
% statistics. Settings are stored within the STUDY
% structure (STUDY.etc.erpimparams) which is used
% whenever plotting... |
640e26e7e4c9ef2a2f7958443986b00b0f2b1dce80d8b7e7da5cca77567a0f1d | MATLAB | 8,451 | 261 | % function lineStyles = linspecer(N)
% This function creates an Nx3 array of N [R B G] colors
% These can be used to plot lots of lines with distinguishable and nice
% looking colors.
%
% lineStyles = linspecer(N); makes N colors for you to use: lineStyles(ii,:)
%
% colormap(linspecer); set your colormap to h... |
8013444467f4f390e73661e39fed0a8fc883423cb1a970436e2a4ca9d929a881 | MATLAB | 8,452 | 219 | function out = MF_steps_ahead(y, model, order, maxSteps)
% MF_steps_ahead Goodness of model predictions across prediction lengths.
%
% Given a model, characterizes the variation in goodness of model predictions
% across a range of prediction lengths, l, which is made to vary from
% 1-step ahead to maxSteps steps-ahe... |
d1e29e025bd63af28c579953640800ca9d1ae8cdbdba559265376b36b86b4c1c | MATLAB | 8,452 | 258 | function test_matrixcompletion()
% cd proposed;
% addpath(genpath(pwd));
% cd ..;
clear; clc; close all;
%% Sample data geneteration and problem specifications and options
n = 100;
m = 500;
true_rank = 5;
over_sampling = 5;
r = true_rank;
noiseFac = 1e-6;
c... |
db345e50e8f29753d53e34ad2eaafc40fcd63f344020f57f4f9a84e238e0880e | MATLAB | 8,457 | 221 | %PRINT2EPS Prints figures to eps with improved line styles
%
% Examples:
% print2eps filename
% print2eps(filename, fig_handle)
% print2eps(filename, fig_handle, options)
%
% This function saves a figure as an eps file, with two improvements over
% MATLAB's print command. First, it improves the line styl... |
28d101a1b93ce9b897a6404d29931a339464d99529623b18c570df600000551c | MATLAB | 8,460 | 261 | function [ stat_out ] = nmri_statistics( all_subjects, opt, params )
%[ all_subjects ] = nmri_statistics( all_subjects, opt, params )
% Will do generate a tabulated overview of metrics (all that are readable)
% via nmri_load_metrics for any number of subject
%
% all_subjects = cell array of subjects (see nmri_... |
828655103e15c9ada7f539f9e5a10cd2103358d57206889b792dabf0ae60a8d9 | MATLAB | 8,461 | 227 | function [] = plot_linear(xvals, yvals, name, pathstr)
%% plot_linear plots worm tracks collected from a linear gradient
%% Make a plot with all the tracks, then save it.
global info
fig = DrawThePlot(xvals, yvals, name);
movegui('northeast');
ax=get(fig,'CurrentAxes');
if contains(info.assaytype, 'Thermo_22')
s... |
463c0db9ac220376f402d60477fd6172c8054bc440a8519cce3579ea18f4b1c0 | MATLAB | 8,463 | 336 | function OUT = db_cluster_table(clusters,DB,varargin)
% function OUT = db_cluster_table(clusters,DB,varargin)
%
% tor wager
% counts studies and contrasts in each cluster
%
% clusters is a struct in which XYZmm field has list of points
% --should be output of database2clusters, which contains all fields
% DB is databas... |
f3ca761cad03f66180eab595d738c916da971a38daba9e350994090f1c32a002 | MATLAB | 8,474 | 295 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% These are vars that should probs be input when running this as a function
% md_subj=26;
% hc_subj=22;
n_sess=2;
num_rois=214;
% Add paths
baseloc="C:\Users\dk818\OneDrive - ... |
2c79277257f5a0c59387aa75e63dba5967c8dee25c445ad3c8bec00af76299c2 | MATLAB | 8,480 | 306 | function [f,p,ci,stats,tbl,dist] = permuanova2(x,reps,varargin)
%PERMUANOVA2 Two-way permutation-based analysis of variance (ANOVA).
% F = PERMUANOVA2(X) performs a balanced two-way permutation-based ANOVA
% for comparing the means of two or more columns and two or more rows of
% data in matrix X, and returns th... |
fc52d9aa51f03d29aa8951c34af5e9fbf5e2d1afaf6ef75e05a46e69e5f08ace | MATLAB | 8,480 | 222 | % ======================= Configuration =======================
DET_STIM_MODULE_FLAG = 1;
CTRL_STIM_OUTPUT_FLAG = 1;
maxRetriesVisa = 5;
visaRetryDelay = 2;
maxRetriesTcp = 10;
tcpRetryDelay = 1;
% ===================== Detect stimulation module =====... |
987e16bf9d613f325c995a6f3c586b69cdf433ec8b6f2b81452f4df30b807076 | MATLAB | 8,490 | 155 | function c = othercolor(n,m)
% OTHERCOLOR alternative colormaps from various sources
%
% OTHERCOLOR(N,M) returns a M-by-3 matrix contaning a colormap given by
% the name N. OTHERCOLOR, by itself, is the same length as the current
% figure's colormap. If no figure exists, MATLAB creates one.
%
% Supported colo... |
e978e126cdca7163d6740068c62ba1b7ecdd7201b484026ba31bb522c79ec3c1 | MATLAB | 8,498 | 196 | function out = PP_SchreiberDenoise(y, m, d, numIter, neighborhoodStd)
% PP_SchreiberDenoise Nonlinear noise reduction, and how it changes the series.
%
% Applies Schreiber's simple nonlinear noise-reduction method -- replace each
% embedded point by the average of its state-space neighbors -- via TISEAN's
% 'nrlazy' ... |
b71248e3a931b388c4a2d8e4bae315d73143c011d682730973aefd5bd6338787 | MATLAB | 8,500 | 256 | function M = grassmanngeneralizedfactory(n, p, B)
% Returns a manifold struct of "scaled" vector subspaces.
%
% function M = grassmanngeneralizedfactory(n, p)
% function M = grassmanngeneralizedfactory(n, p, B)
%
% Generalized Grassmann manifold: each point on this manifold is a
% collection of "scaled" vector subspace... |
2a520763542a46ea93d180675f2a2c332034f2cd0a9a85ed786e851157b118e9 | MATLAB | 8,518 | 174 | function [varargout] = likSech2(hyp, y, mu, s2, inf, i)
% likSech2 - sech-square likelihood function for regression. Often, the sech-
% square distribution is also referred to as the logistic distribution not to be
% confused with the logistic function for classification. The expression for the
% likelihood is
% li... |
4cfbf45e7a906541fd18ed7c65db9167c4663da7b34986d9621cd4fa0211f8f0 | MATLAB | 8,526 | 192 | function poolSubjects_anatomyAreas(params, AA_type)
% sorts channels into defined anatomical areas, defined by 'AA_type'
% pools together subjects and frequency bands processed by a given job
% settings (subjects, directory names, ...) are stored in 'params'
% (c) Jiri, Jan18
disp('Pooling results over all subjects .... |
864fb0ca96b27bdcd5aacb5f688543467da90002eaf97022eace364833d0335b | MATLAB | 8,527 | 227 | function [ output_args ] = CALCIUM_FLUORESCENCE_PROCESSING( CALCIUM_FLUORESCENCE_file , varargin )
%CALCIUM_FLUORESCENCE_PROCESSING( CALCIUM_FLUORESCENCE_file , varargin )
%
%
% === Jan Moelter, The University of Queensland, 2018 ===================
%
narginchk(1,Inf);
fprintf( 1 , [ '\n' ] );
%% > PRINT FUNCTION-... |
3ac51cc35f23694d9349d8403bb10a0b8d12b23e6a01433d7b1dac1096e35cef | MATLAB | 8,529 | 386 | function output_args = estimate( graph , opts )
%ESTIMATE( graph , opts ) Program to calculate the number of communities in
% a network using the method of Newman and Reinert, which calculates a
% posterior probability by Monte Carlo simulation of the integrated
% likelihood of a degree-corrected stochastic block... |
6e14420124ab17c26c5e5938882fa700a3dc831b2fbc6b63960496252a1103f9 | MATLAB | 8,535 | 224 | function SuppFigure_FFmodel_I0(varargin)
%SUPPFIGURE_FFMODEL_I0 Generate supplementary figure for feedforward model I0 analysis
%
% Purpose:
% Creates a figure showing feedforward model analysis with different I0 values,
% comparing inhibitory neurons and random networks under different current offset conditions.
... |
8298c8e142cb0fbb03841eaf707eb3f4c2bf74dde817c262470992490ed35cb5 | MATLAB | 8,538 | 198 | %% h = sepia_handle_panel_qsm_FANSI(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other hand... |
927ce30e3d1f9f9b4aef87944269a349fe4ceb8c420307b48f8a2c7d196bb843 | MATLAB | 8,541 | 296 | function h = plot_points_on_brain(XYZ,varargin)
% function handles = plot_points_on_brain(XYZ,varargin)
%
% This function plots a 3-column vector of xyz points (coordinates from
% studies) or text labels for each point.
%
% - option to plot on a glass brain. Four different views are created in 2 figures.
% - same opti... |
58cf5b8c2c13b743e04ab982e71aa6027788fbcd26c7cd6db07761b85528cf74 | MATLAB | 8,542 | 258 | %function ch2roi_stackedFreqBands(params, groupInfo)
% groups channels into defined ROIs (anatomic areas), averages & plots
% FIG:
% - subplots = freqBands x ROIs
% - 1 subplot = 1 class imagesc of stacked FB (y-axis) x time (x-axis) x activations (c-vals)
% based on the following criteria:
% - selected anatomic... |
bbbc13d460c2116c8bc56944720e44352934c6151b919e8070e90a30156be869 | MATLAB | 8,546 | 206 | % STD_RMDAT - remove datasets from STUDY
%
% Usage:
% >> [STUDY,ALLEEG] = std_rmdat(STUDY, ALLEEG, 'key', val);
%
% Inputs:
% STUDY - EEGLAB STUDY set
% ALLEEG - vector of the EEG datasets included in the STUDY structure
%
% Optional inputs:
% 'datinds' - [integer array] indices of datasets to ... |
ec4c858a6c24058e5cbcf89c831f79b20a6342f9a22471708fa75af6c421a81a | MATLAB | 8,548 | 284 | function FigureS3(datadir, codedir)
%FigureS3 - Wait times are not affected by previous trial outcome
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'IgnoreCase', ispc);
if ~onPath % only add code dir ... |
780a2af11f319fb8f353ae2932ad9cb3dc23b5a27f8d6b83ebe7768fdf5831dd | MATLAB | 8,550 | 226 | %Axon analysis and quantification code associated with Gutman-Wei et al.,
%2025 - function for analysis of horizontal segment and layer-specific data
%Function for computing descriptive data on a subset of a cell tracing,
%to be applied to vertically-segmented portions of an axon tracing
%Calculates total length, bran... |
9acc9f417df91bd22131de0a31b499f9d0d6e23696318cb511f091b3a96876c8 | MATLAB | 8,558 | 141 | %% ########################################################################
% - MASTER_demo_ripples_1_f_noise -
% #########################################################################
% Master script: MASTER_demo_ripples_1_f_noise.m
% Author: Frank J. van Schalkwijk
% Contact: Fran... |
e7e9d1b42dc207dc1bae9673c28a360aac620d1b0133897d6e27cb5cff71be69 | MATLAB | 8,565 | 185 | function [FitResults,FitQuality,Params,ROIstat] = IDEALfitIVIM_data(Data_raw, Mask, path_Data, Params,path_Mask,path_ROI)
%IDEALfitIVIM_exp(path_Data 'string', Params 'struct', path_Mask 'string', path_ROI 'cell')
%
% Fit a bi-exponential or tri-exponential model to DWI data using the
% Iterative Downsampling Adap... |
0eaafdbbb557e94213cc51fb01635d5a183d4b0838cb6d27b5cf1a2fb2d758df | MATLAB | 8,567 | 246 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells. Fraction of cells are selected
% according to their phase such that grid cells with closer phases are averaged within the same voxels
% and fraction that is selected randomly.
% ... |
afb418cac1b71999ed65a6589ca63feade1847e6028199afd5a2ad3d63737c21 | MATLAB | 8,572 | 235 | function [varargout]=paq2lab_silent(varargin)
% function [varargout]=paq2lab(varargin);
% Read binary files acquired with PackIO into MATLAB workspace
% Return recording of each channel as a vector array
% Based on paqread (used in DaqViewer)
% Usage: [data, names, units, rate,filename, fposition]=paq2lab;
% Adam Pack... |
70cb4eed98a3adbd4d649f2cbe8108f0efc8102bfdab9311f86ae4af2e4ab29f | MATLAB | 8,574 | 248 | function M = stiefelfactory(n, p, k, gpuflag)
% Returns a manifold structure to optimize over orthonormal matrices.
%
% function M = stiefelfactory(n, p)
% function M = stiefelfactory(n, p, k)
% function M = stiefelfactory(n, p, k, gpuflag)
%
% The Stiefel manifold is the set of orthonormal nxp matrices. If k
% is larg... |
8fb6e33906fae70d3dafdc73793a998c2e14d59a88a41b1b624a0f538c0d5c9c | MATLAB | 8,574 | 172 | function [MRSCont] = osp_LoadBrukerFid(MRSCont)
%% [MRSCont] = osp_LoadBrukerFid(MRSCont)
% This function reads raw data from Bruker FID datasets.
%
% USAGE:
% [MRSCont] = osp_LoadBrukerFid(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS... |
7cc3163adfe1e9eccca32617b3daec662cd48b3bd7a3c29ab8fdc2c4bed16237 | MATLAB | 8,577 | 233 | function out = SD_MakeSurrogates(x, surrMethod, numSurrs, extraParams, randomSeed)
% SD_MakeSurrogates Generates surrogate time series.
%
% Method described relatively clearly in Guarin Lopez et al. (arXiv, 2010)
% Used bits of aaft code that references (and presumably was obtained from)
% "Surrogate data test for no... |
5faba5cee0575dc6f023c2a9dc1adcada224c6400b5341e637536c3e36985a61 | MATLAB | 8,579 | 233 | function choise=bttnChoiceDialog(dlgOptions, dlgTitle, defOption, qStr, bttnsOredring)
%% bttnChoiceDialog
% Create and open a button dialog box with many buttons.
% From: http://www.mathworks.co.uk/matlabcentral/fileexchange/37261-generalised-question-dialog--questdlg-/content/BtnChoiseDlg/bttnChoiseDialog.m
%
%% Synt... |
bd57b204b88330a4f4b1a45990f9f00395019405cb68adb7faa8372d2ebf08a3 | MATLAB | 8,582 | 237 | %% 00_Folder creation
% Define BIDS (BIDS-like) root folder path
BIDS_folder = 'F:\BIDS\YC+YT_QSM_BIDS';
% Define derivatives root folder path
derivatives_folder = fullfile(BIDS_folder, 'derivatives');
if ~exist(derivatives_folder, 'dir')
mkdir(derivatives_folder);
end
% Define SEPIA derivatives folde... |
21480cfd1a98726ed40007a1aef2f6cf3e4c12130f4e49e28620e05e74550e22 | MATLAB | 8,585 | 254 | function [data, header] = read_bdf(filename, varargin)
% READ_BDF Read EEG data from a Biosemi BDF file
%
% [data, header] = read_bdf(filename)
% [data, header] = read_bdf(filename, 'Param', value, ...)
%
% Inputs:
% filename - BDF filename (including .bdf extension)
%
% Outputs:
% data - EEG data matrix (Nc... |
d256acaf710a463fad079ce64af7716437dc05ef5925e2a123cef906a7246abb | MATLAB | 8,587 | 225 | % SHOW_EVENTS - Display events in epochs. Events selected by
% MAKE_TIMEWARP function can be optionally highlighted.
% Each epoch is visualized as a row in the output image with
% events marked by colored rectangles.
%
% Usage:
% >> im = show_events(EEG, 'key1',val... |
9b930d390e01f9834d66d545f54c8cf758ccd90a406af6c45c0c0474ff7f6c44 | MATLAB | 8,589 | 196 | % This makes some nice prepared versions of the data:
% ~/ext/figurefiles/nsd/datab3nativesurface_subj[01-08].mat
% ~/ext/figurefiles/nsd/datab3nativesurface_subj[01-08]_[lh,rh,subcortex,func1pt8mm,cerebellum]_betas.hdf5
%
% In the .mat file, we have:
% <ord> is 1 x NTRIALS with 10k indices
% <ordU> is 1 x NIMAGE... |
475552628135ac5032f257de36c3635b4cd06276a983deedef72f2e0a0d444b1 | MATLAB | 8,606 | 279 | function [ ] = test( )
% Unit testing for methods of class tapas_Huge
%
% Author: Yu Yao (yao@biomed.ee.ethz.ch)
% Copyright (C) 2019 Translational Neuromodeling Unit
% Institute for Biomedical Engineering,
% University of Zurich and ETH Zurich.
%
% This file is part of TAPAS, wh... |
f5d3679848234bc90f6d9521a66f7718601a929679fcb9acfc4364fca168b036 | MATLAB | 8,607 | 169 | function osp_plotAllPDF(MRSCont, Module)
%% osp_plotModule
% Callback function on print figure button click.
%
%
% USAGE:
% osp_plotModule(MRSCont, Module)
%
% INPUT: MRSCont = Osprey data container.
% Module = String for the Module
% OPTIONS: - 'OspreyLoad' (def... |
90a84eef5a9b1c982cbe6b4ce2afb6299f0beeb3e4d7230fdfb4023430fea199 | MATLAB | 8,612 | 165 | function [signal,sample_mask] = clean_windows(signal,max_bad_channels,zthresholds,window_len,window_overlap,max_dropout_fraction,min_clean_fraction,truncate_quant,step_sizes,shape_range)
% Remove periods with abnormally high-power content from continuous data.
% [Signal,Mask] = clean_windows(Signal,MaxBadChannels,Power... |
53c21111585f5fc1b0b65a17a8c8bdb94aad6766a7f3c24b860d55ba67525c59 | MATLAB | 8,616 | 258 | % 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... |
94b67abf6dd8d5a2457c03335ee163406df3e82d04d252d82f5dbc7fd26ceb0b | MATLAB | 8,618 | 175 | function bids_RobustCombination(bidsroot, regularization, expression, subjects, target)
% FUNCTION bids_RobustCombination(bidsroot, [regularization], [expression], [subjects], [target])
%
% A BIDS-aware wrapper ('bidsapp') around 'RobustCombination' that reads and writes BIDS compliant
% data. The MP2RAGE images are a... |
55cc590e7b9afdd9d9f150a151d35d01c3327f9685b82613d03bf96687d7442a | MATLAB | 8,619 | 201 | function c = tapas_ehgf_ar1_binary_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the enhanced Hierarchical Gaussian Filter (eHGF)
% for binary inputs in the absence of perceptual uncertainty.
%
% The HGF is the model introd... |
d8075842de9559e79836cb66111543514a596d0c4785b61b1d9586b8b0961bcc | MATLAB | 8,619 | 182 | clear all;
clc;
Num_context=4;
Num_probability=3;
foldapath=['POP_Behavior/PavFo4C4S/ALL'];
allfolda=dir([foldapath,'/*.mat']);
load(['Labnote/Labnote.mat']);
load(['Labnote/Labnote_RAW.mat']);
POP_ChS1_i=0;POP_ChS2_i=0;POP_KiS1_i=0;POP_KiS2_i=0;
for POP_i=1:length(allfolda)
FileName=allfolda(POP_i).name;
... |
36bd59e6441774e886c5700fe96a7c154c7589309dee131da6255088cb4da891 | MATLAB | 8,620 | 258 | % 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... |
76e633d2bac12537c5a26d5d5d3185d4713c1f1541073a98b67da5fbfd8d719e | MATLAB | 8,621 | 204 | %{
tuning.DotRF (computed) # receptive field from the dot stimulus
-> preprocess.Sync
-> preprocess.Spikes
-> tuning.DotRFMethod
-----
%}
classdef DotRF < dj.Relvar & dj.AutoPopulate
properties
popRel = tuning.DotRFMethod * preprocess.Spikes & ...
(preprocess.Sync & (vis.ScanConditions & v... |
cafae5091d84c2d4d85a0ddb578cf9b57a18447384263937622193a1bf0b0a8c | MATLAB | 8,624 | 206 | function out = SP_PhaseAmpCoupling(y, nBands, maxN, nPhaseBins)
% SP_PhaseAmpCoupling Cross-frequency phase-amplitude coupling
%
% Splits the (one-sided, DC- and Nyquist-excluded) spectrum into nBands
% equal-width frequency bands -- the same equal-band convention
% SP_Summaries uses for its band-power fields -- and,... |
9a98254125858043eedcf24133476f010acfc756d9f489f59684cfa6e50feec9 | MATLAB | 8,626 | 257 | function tests = tapas_physio_readin_bids_test()
% Checks whether BIDS reader still works the same on example cpulse and raw
% ppu3T trace signal
%
% tests = tapas_physio_readin_bids_test()
%
% IN
%
% OUT
%
% EXAMPLE
% tapas_physio_readin_bids_test
%
% See also
% Author: Lars Kasper
% Created: 2019-03-14
% Co... |
abe610611903e97c2fdab4a5b695cbf32901543682bce040baf244ebbfa9b699 | MATLAB | 8,626 | 251 | % Save NIFTI dataset. Support both *.nii and *.hdr/*.img file extension.
% If file extension is not provided, *.hdr/*.img will be used as default.
%
% Usage: save_nii(nii, filename, [old_RGB])
%
% nii.hdr - struct with NIFTI header fields (from load_nii.m or make_nii.m)
%
% nii.img - 3D (or 4D) matrix o... |
8daaecee9b416153e2f261e7890cee9ea89bdf1d1ec65c15295eea55eb525447 | MATLAB | 8,637 | 219 | function tapas_hgf_jget_plotTraj(r)
% Plots the estimated trajectories for the HGF perceptual model for
% the JGET project
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyrigh... |
20124c095c7bde406583b37ada763d9695fffdd1a29818cef98002dc2e1d2a40 | MATLAB | 8,638 | 171 | function calculatePassiveParameters = calculatePassiveParameters(wave, pulseRange, channel, show_plots)
%% Background
% I refers to current, which is plotted over time [y axis]
% T refers to a time-related index for the data in the pulse [x axis]
%% Setup
calculatePassiveParameters = [];
... |
872ed03831f1d82cce46160b4e8719670cc60d18c40bbeb6366c50725ecfd5d2 | MATLAB | 8,641 | 252 | function [b,p,ci,stats,dist] = permuregress(x,y,varargin)
%PERMUREGRESS Permutation-based multiple linear regression.
% B = PERMUREGRESS(X,Y) performs a permutation-based multiple linear
% regression of the responses in Y on the predictors in X, and returns
% the estimated coefficients. X is an N-by-P design mat... |
3a23e25ccb8ae1ed914e4ef5cfc3023e3834125678b8b1ebb73eca918ff445eb | MATLAB | 8,651 | 232 | function low_rank_matrix_completion()
% Given partial observation of a low rank matrix, attempts to complete it.
%
% function low_rank_matrix_completion()
%
% This example demonstrates how to use the geometry factory for the
% embedded submanifold of fixed-rank matrices, fixedrankembeddedfactory.
% This geometry is des... |
e890ab6e5bdc6ef55174db5ff2a18e10bc25069ee7273b8b315514a1e05aab35 | MATLAB | 8,652 | 219 | function tapas_ehgf_jget_plotTraj(r)
% Plots the estimated trajectories for the HGF perceptual model for
% the JGET project
% Usage example: est = tapas_fitModel(responses, inputs); tapas_ehgf_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.