sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
932e22b8404ca382a27224e8c1ebf44c23f1bf6f8077960c1b1b5c8f356dd1ec | MATLAB | 3,622 | 100 | function bidsHarvest
bidsDir = '/Volumes/4tb/bids/';
outDir = pwd;
ext = '.nii.gz';
pth = fullfile(bidsDir, '**',['*lesion_mask', ext]);
lesions = dirVisible(pth);
if length(lesions) < 1
error("Is `%s` the correct file extension? Unable to find lesions %s\n", ext, pth)
end
nOK = 0;
for i = 1: length(lesions)
l... |
0212e653df2945fe644c60268950b0f4e80176ec57721279acd9db6fe7410d54 | MATLAB | 3,624 | 69 | function osp_pop_distrOvQuant_Call(src,~,gui)
%% osp_pop_distrOvQuant_Call
% This function is triggered when the distribution quant popup menu is changed. It refreshes
% the figure.
%
%
% USAGE:
% osp_pop_distrOvQuant_Call(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gu... |
5db131214f018de7da154038c4ecd9f1e61977619c247f2a9339bb2e81e972d9 | MATLAB | 3,624 | 50 | matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'};
matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4;
matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''};
matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1';
matlabbatch{1}.spm.tools.physio.log_files.vendor ... |
809483c87cf3d86fcd19ce043c01f1255d5fc882539a4b49f3db462dd2d6753e | MATLAB | 3,627 | 114 | function [ fHdls ] = pair_plot( obj, clusters, subjects, pdx, maxSmp )
% Generate pair plots for cluster and subject-level parameters from MCMC
% trace.
%
% INPUTS:
% obj - A tapas_Huge object containing estimation results.
%
% OPTIONAL INPUTS:
% clusters - A vector containing indices of clusters for which to mak... |
b682c094ca47bedc61709d93dc405ee2fd08ab6d48ecec8ac785691e97879b44 | MATLAB | 3,627 | 99 | classdef toolsApplyHUMappingTest < matlab.unittest.TestCase
%TOOLSAPPLYHUMAPPINGTEST Unit tests for petraToCT.tools.applyHUMapping.
%
% DESCRIPTION:
% Pins the pseudo-CT Hounsfield unit mapping against accidental
% changes. The background, head (soft tissue), and skull (bone)
% value... |
b98b5b05d9115e7cd567a3287745d51db58c5216f3184b16a8f520f173fea61d | MATLAB | 3,627 | 79 | function handles = render_call_position(handles, all_calls)
%% This function makes and updates the little window with the green lines
% Timestamp for each call
% Initialize the display
if all_calls
CallTime = handles.data.calls.Box(:,1) + handles.data.calls.Box(:,3)/2;
handles.update_position_axes = 0;
% ... |
10ba74d471d2a5d742c13533fd785fde6c5fd6c17da52610943096bfb6ef77bd | MATLAB | 3,629 | 52 | %% function algorParam2 = check_and_set_SEPIA_algorithm_default(algorParam)
%
% Input
% --------------
% algorParam : strcuture variable contains algorithm parameters
%
% Output
% --------------
% algorParam2 : strcuture variable contains all essential algorithm parameters
%
% Description:
%
% Kwok-shing Chan @ ... |
e16a761407e444177390ae934047e45751b893d486f5576cd563cfceb708227a | MATLAB | 3,630 | 134 | function [B, LL, RW, iter, outvals] = fit_MixtureModelEM (X, T, NT, B_start)
% --> www.paulbays.com, modified N. Myers 2023
if (nargin<2 || size(X,2)>1 || size(T,2)>1 || size(X,1)~=size(T,1) || nargin>2 && ~isempty(NT) && (size(NT,1)~=size(X,1) || size(NT,1)~=size(T,1)))
error('Input is not correctly dime... |
ef7de796518ad9cb877c13e48b0617816e1c313fa795ec3aa011744595bcabd0 | MATLAB | 3,630 | 108 | function LCMparam = osp_readlcm_control(controlFile)
%% LCMparam = osp_readlcm_control(controlFile)
% This function reads a LCModel compatible .control file and saves the
% parameters as a struct that can be modified.
%
% USAGE:
% LCMparam = osp_readlcm_control(controlFile)
%
% INPUTS:
% controlFile ... |
012c9de65506ce550919ab43bcf7c01761a70184986ce8b6ddd097a17a417d35 | MATLAB | 3,631 | 100 | % difftopo - compute and plot component decomposition for the difference ERP
% between two EEG datasets. Plots into the current axis (gca);
% plot into a new empty figure as below.
% Usage:
% >> figure; difftopo(ALLEEG,eeg1,eeg2,interval);
% Inputs:
% ALLEEG - array of leaded EE... |
87fb99bdee14766a2e77ea7efd02d8932ddc1134c9fe661300a1c7fc8a038db6 | MATLAB | 3,631 | 102 | function [ EEGOUT, command ] = pop_cwregression_diagnostical( EEG ,varargin)
% UNTITLED1 Summary of this function goes here
% Detailed explanation goes here
command='';
% keyboard;
if numel(varargin)==0
% probably can be removed..
% cfg.cwregression.srate = EEG.srate; %srate=1000;
% cfg.cw... |
036f7028d1dc45d01a2ff27f5430da718f1e37e7b4030fcd173b1abb98f8db9a | MATLAB | 3,633 | 113 | function rfs = getVarReceptiveFields(obj, var)
%GETVARRECEPTIVEFIELDS Get the receptive field of a variable
% RFS = GETVARRECEPTIVEFIELDS(OBJ, VAR) gets the receptivie fields RFS of
% all the variables of the DagNN OBJ into variable VAR. VAR is a variable
% name or index.
%
% RFS has one entry for each variable... |
737076c36b6e9d64569183f7c6c11b1e1fb4ddcbf7db84654d7a5401f4816b04 | MATLAB | 3,633 | 93 | function trials = extractTrials(params)
% extract trials from responses based on triggers
% trials =
% data: [3073x126x500 double] ~ [samples x channels x trials]
% time: [3073x1 double] ~ time in [s], w.r.t. cutting point = 0
% sessTime: [3073x500 double] ~ time in [s] within e... |
7a755f86c35ba819ce7e6af6125af6a174a41078dda4ef82236134277a3401b8 | MATLAB | 3,633 | 69 | %% load libraries
run('set_library_paths.m');
addpath(SPM_PATH); % per spm docs, do not genpath it
addpath(genpath(CANLABTOOLS_PATH));
addpath(genpath(CANLABMASKS_PATH));
%% variables that must be specified before the script is called
% model_path: full path to the level 1 SPM.mat (thus the output will be for 1 subj)
... |
84f98d40c7b5ec8ce86d237ad8ff7489acdd991bbbab39f35cbb221c417196e5 | MATLAB | 3,633 | 118 | function [ options ] = default_options( ~ )
% Set default options for tapas_Huge class.
%
% This is a protected method of the tapas_Huge class. It cannot be called
% from outside the class.
%
% Author: Yu Yao (yao@biomed.ee.ethz.ch)
% Copyright (C) 2019 Translational Neuromodeling Unit
% Institute... |
d369410427cd96c5249f66329116952aa3122b59cd703a16ce26bd81f5ca8188 | MATLAB | 3,635 | 113 | function rfs = getVarReceptiveFields(obj, var)
%GETVARRECEPTIVEFIELDS Get the receptive field of a variable
% RFS = GETVARRECEPTIVEFIELDS(OBJ, VAR) gets the receptivie fields RFS of
% all the variables of the DagNN OBJ into variable VAR. VAR is a variable
% name or index.
%
% RFS has one entry for each variable... |
0ffb353183e84a44396982f8ac8e890d0e0a3ced04a469b5eea22bbb918718c5 | MATLAB | 3,636 | 114 | function plotTargetClassifierPerformanceAll(outputs)
% Plot classifier performance for each subject
% on a single axis with horizontal tiling controlled by xOffset.
xOffset = 100; % default spacing between panels (in ms)
% Figure
fig;
hold on
axis off
colors = [[79,178,61]; [199,72,149]; [128,128,128]]/255;
% Compu... |
1e29355e769b347ab13142afe87678251b33d03db92079b0d39d210d5787c897 | MATLAB | 3,639 | 105 | function varargout = eegsynth_tsv(filename, hdr)
% EEGSYNTH_TSV is called from FT_READ_EVENT to read the events from a tsv file
% written by the recordtrigger module. The .tsv file should also contain a
% synchronization trigger from the recordsignal module.
%
% Use as
% hdr = events_tsv(filename)
% evt = events_t... |
520e667cb73c5dadd048ed1d22cf9907252bb597116ebcc388978f2e5dff0004 | MATLAB | 3,641 | 113 | function [node,elem,face]=surf2mesh(v,f,p0,p1,keepratio,maxvol,regions,holes,forcebox)
%
% [node,elem,face]=surf2mesh(v,f,p0,p1,keepratio,maxvol,regions,holes,forcebox)
%
% create quality volumetric mesh from isosurface patches
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2007/11/24
%
% input parameters:
% ... |
c712fdbb99790fdce54babfcef136629074b63e3cac73beb9c95195840f75e1d | MATLAB | 3,641 | 131 | function [WTOpt, WTMdl, Kappa, RPE, Belief, Alphas] =...
GenerateSynthData_AlphaPHModel(params, ratTrial,...
noise_arg, gen_arg, noise_params)
%GenerateSynthData_AlphaPHModel - generates synthetic wait times for
% dynamic learning rate model
% Inputs:
% params - Parameter vector. [alpha0, D]
% alpha0 -... |
dba08c15890109ca4909ba8f0c66bca4c9d8704e789551f8fd05d5f8d2cc650d | MATLAB | 3,643 | 104 | function [fitted_data] =improved_EEG_fit(name_of_data_file,epoch_length,fitting_range,num_peaks,frequency_resolution)
%Find power spectra for each epoch and run 1/f fit for average spectra per animal
% Output it a data structure with all spectra and fit information
% Input is name of data file to analyze, length... |
2885262ae0499b6c457960a5a6dce3452ffb6f9314c6919309e5762a23ae41a5 | MATLAB | 3,645 | 82 | function this = subsasgn(this, subs, A)
% Subscript assignment for GIfTI objects
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
% $Id: subsasgn.m 3999 2010-07-19 10:54:18Z guillaume $
switch subs(1).type
c... |
a0b1a2baa11ffaccfbd3c895b87bf1c9e7f40056fd97baf07bc99c0278858301 | MATLAB | 3,645 | 59 | function PseudoTransmit_GroupAverageCorrectedMaps(myelinRCFile, myelinAsymmOutFile, avgPTFieldFile, AvgPTFieldAsymmOutFile, GCorrMyelinOutFile, GCorrMyelinAsymmOutFile, ICorrMyelinFile, AvgICorrMyelinAsymmOutFile, IndCorrAllMyelinFile, VoltagesFile, PTStatsFile, rPTNormFile, CSFStatsFile, RegCorrMyelinOutFile, Covariat... |
ada6d3aa6699e574e8797456cd2cd3c8c3879c52f7b201e415c5634187424565 | MATLAB | 3,645 | 101 | function out = SY_StatAv(y, whatType, n)
% SY_StatAv Simple mean-stationarity metric, StatAv.
%
% The StatAv measure divides the time series into non-overlapping subsegments,
% calculates the mean in each of these segments and returns the standard deviation
% of this set of means.
%
% Empirically mean-stationary da... |
71361606bd448c9d120c2e3dbebcdcf7cfe904147b1c1f9ca3df0b3cb51e873d | MATLAB | 3,647 | 95 | %% get_set_echocombine_medinonlinearfitbipolar(h,mode,input)
%
% Input
% --------------
% h : structure contains all handles of SEPIA
% mode : 'set' - extract information from GUI to config file
% 'get' - extract information from config file to GUI
% input : if mode is 'set'... |
ab308ff81649242eefcd08bb6fb03e354858e37f3f1ae99db72a74d890208bfa | MATLAB | 3,648 | 120 | function printEconomicsStyleRegressionTableForGLMs(models, modelNames, titleStr, outputFilename)
%
% GLMs is a cell array of general linear models (from fitglm), or
% generalised linear mixed models (from fitglme).
% GLMnames is a cell array of the names of the models
% outputFilename is preferentially a .csv
%
% JS 9.... |
f78ad76cd45ecfabf6d9927aef0d440826813f7dd7b77a6b50186671e9d6d547 | MATLAB | 3,648 | 100 | function [topology,support] = upgma(dist,labels,doplot,fontsize)
% UPGMA: Unweighted pair-group hierarchical cluster analysis of a distance
% matrix. Produces plot of dendrogram. To bootstrap cluster support,
% see CLUSTER.
%
% Usage: [topology,support] = upgma(dist,{labels},{doplot},{fontsize})
%
%... |
490527633a3bc11baa1c6a6f530dda7fe0a6b404a5d072b47b8ed849d4969379 | MATLAB | 3,650 | 127 | function [Fhemo,options]=FindHBpeak(wave,varargin)
% GOAL: automatically find the heartbeat frequency (Fhemo.Location)
% and amplitude (Fhemo.Prominence)
%
% INPUT:
% - wave (vector): input time trace. Only work for a vector
% - opts (struct): available options
% * FrameRate: sampling frequency of tim... |
361ed2a17c1c9ec79cc2312917eff39da0c590aa255727a0391d969635becbb7 | MATLAB | 3,653 | 95 | function [FaceCMatrix,VertexCMatrix,Cmagnitude]=CalcCurvatureDerivative(FV,FaceNormals,PrincipalCurvatures,up,vp,wfp)
%Author: Itzik Ben Shabat
%Last Update: July 2014
%% Summary
%{
%CalcCurvatureDerivative recives a list of vertices and faces in FV structure
%and the curvature tensor at each vertex and calculat... |
4e7bb19758c1fc4e1f9433571743ba28238e6000c05717a0afc4eb449e99be31 | MATLAB | 3,653 | 96 | function task_clean_c(sii, PATH, cfg)
% Artifact attenuate ICA decomposed single subject EEG data epoched around gait cycle
% by clustering ICs and finding the best fitting cluster close to an a priory defined ROI
% Use repetitive clustering to overcome limits of kmean clustering, as random seeds
% and get more rel... |
6501bd0a701c48be9f686c1475fb54fe3f8584b5eea37e6660bec54376cd26f0 | MATLAB | 3,653 | 78 | function ProcessData_ExtendedData6(datadir, savedir, codedir)
%ProcessData_ExtendedData6 - Process raw data saved under datadir such that it can be plotted by PlotExtendedData6.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_ExtendedData6.mat' from Zenodo was saved
% codedir - Local directory wh... |
7ef8ad11cef77de6a72c3f1e12cf79cb778cddce7976b2e9d8027f73139fe9ab | MATLAB | 3,654 | 112 | function [M] = ROIcmap(nc,opt)
% [M] = ROIcmap([nc],[opt]);
% creates a colormap with
% no color too close to grayscale,
% no two consecutive colors too close
% no colors exeedingly close to another in the map
% no colors too close to a background color (optional)
% nc: number ... |
772a7de50daeb76fc1e8e56357a591699be88347dac89a8a006e4132c739696b | MATLAB | 3,656 | 133 | function [err] = DisplayAfniSlice (Slc, Opt)
%
% [err] = DisplayAfniSlice (Slc, Opt)
%
%Purpose:
%
% OBSOLETE, see DispAFNISlice
% the function is left here for backward compatibility
%
% Display slices a la AFNI.
%
%
%Input Parameters:
% Slc is a structure obtained from the output of function GetAfniSlice... |
52339b6e9e01efe505991b694084ee9f338b7d1018a30789fedf1e066f58f826 | MATLAB | 3,657 | 100 |
function [ uint32le] = VAXF_to_uint32le(floatVAXF)
%VAXF_TO_UINT32LE Converts from VAXF (single precision) to IEEE-LE (UINT32)
% This function converts floating point numbers initialized in MATLAB
% into equivalent raw 32bit unsigned integers (little endian)using the
% specification for the VAXF floating point... |
ed6c88269848ffcc52854be59711435e86bf023bcde377b1de3d5c274cd84176 | MATLAB | 3,657 | 130 | %% Find the camera intrinsic parameters
% Input Parameters
clear
basedir = 'D:\20191122\mouse\calibration\intrinsic\';
cd(basedir)
numcams = 6;
squareSize = 10.0; % Size of Checkerboard squares in mm
ext = '.mp4';
maxNumImages = 500;
videoName = '0';
%% Automated Checkerboard Frame Detection
% Pre-allocate
params_indiv... |
78bffdbf55c30fd05a7186de698aad033f34608201648fa36cfdef31620a5c0e | MATLAB | 3,658 | 119 | function [magn] = read_ctf_sens(filename)
% READ_CTF_SENS reads MEG sensor information from CTF configuration file
%
% magn = read_ctf_sens(filename)
%
% where the returned structure meg has the fields
% magn.pnt position first coil
% magn.ori orientation first coil
% magn.pnt2 position second coil
% m... |
3b1395052558ec20f80783424faddf8d69bfc7c8b6b99857776a6ca8e63fdc1f | MATLAB | 3,659 | 115 | function [hessf, err] = tapas_riddershessian(f, x, varargin)
% Calculates the hessian of the function f at point x according to Ridders' method:
%
% Ridders, CJF. (1982). Accurate computation of F'(x) and F'(x) F''(x). Advances in Engineering
% Software, 4(2), 75-6.
%
% INPUT:
% f Function handle of ... |
cd2279334e33d6fa4d2d9650c85ff3929a86c3aade4e9edafc240e65cdb89b16 | MATLAB | 3,659 | 117 | function AdjustAxes(f,varargin)
%AdjustAxes - Adjust axes limits for all subplots
%
% USAGE
%
% AdjustAxes(f,<options>)
%
% f optional figure handle (default = gcf)
% <options> optional list of property-value pairs (see table below)
%
% ===================================================... |
e3aaaad86a8c2ea9f910447ab2bbf1056d6831c6796be7d0e8c07adb4ece90ca | MATLAB | 3,660 | 112 | % Phantom 2D small example or ones 3x3, compute conductance matrix
% use superposition property
% Compare to point-by-point case generated with:
% example_2D_conductance_pointbypoint.m
% Author: Aina Frau-Pascual
% Set plot_potentials to true if you want to plot all potentials
% WARNING: it is time consuming
plot_po... |
b6713e4bb3b3836b47233d7632bd922a1facacbeccb026e071e72bd443380480 | MATLAB | 3,661 | 103 | %% [chi] = Wrapper_QSM_NDI(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 the data, ... |
866f8ac5affa22a76f8dd213728d3fedc46b7a58eb3c683bdab567f960836710 | MATLAB | 3,663 | 111 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% data = loadData_nii(dwifile,gradfile)
%
% loads dMRI data from 3D or 4D-nifti, if no parameters are
% provided a GUI-dialog pops up asking for the data and the bvec/bval
% files (FSL-style)
%
% dwifile - either a cellarray of 3D nif... |
75c4ce6a8d60c7a451233ee45fbb39bb72b45ed7e8587d1662361dbde99dea32 | MATLAB | 3,664 | 108 | function f = normalizerange(m,targetmin,targetmax,sourcemin,sourcemax,chop,mode,fast)
% function f = normalizerange(m,targetmin,targetmax,sourcemin,sourcemax,chop,mode,fast)
%
% <m> is a matrix
% <targetmin> is the minimum desired value. can be a scalar or a matrix the same size as <m>.
% <targetmax> is the maximum d... |
1fa8cd45827bdf7c7e2ce24437fe81e6f6cdcb5e10632a9828ea670297599beb | MATLAB | 3,665 | 124 | % This script dose a few additional preprocessing steps on top of HCP
% minimal preprocessing pipeline (Glasser et al 2013)
% 1. Spatial smoothing
% 2. Wishart filtering
% And concatenate two runs (L-R and R-L phase encoding)
clear
close all
addpath ../masks
addpath ../functions/wishart
addpath ../functions
% Subcor... |
cd7a2d26ea547bddb8b54aa171e0a375f47eeef29c9b990b55f62ae26f85e296 | MATLAB | 3,668 | 119 | %ISOLATE_AXES Isolate the specified axes in a figure on their own
%
% Examples:
% fh = isolate_axes(ah)
% fh = isolate_axes(ah, vis)
%
% This function will create a new figure containing the axes/uipanels
% specified, and also their associated legends and colorbars. The objects
% specified must all be in the same f... |
7817042a553ee1a8bf7200e912cbb34c63bd6800828aa2c7e30e2e05b61ba2a7 | MATLAB | 3,669 | 102 | function p = MD_PolVar(x, d, D)
% MD_PolVar The POLVARd measure of a time series.
%
% Measures the probability of obtaining a sequence of consecutive ones or zeros.
%
% The first mention may be in Wessel et al., PRE (2000), called Plvar
% cf. "Short-term forecasting of life-threatening cardiac arrhythmias based on
... |
872f408256bade806e6ac366a110b9bd724c3140ffcc267be186dd2585761e4d | MATLAB | 3,670 | 74 | % EEGLAB_NEW - script called when a new dataset is created and require
% input from user. Use workspace variables EEG, ALLEEG,
% CURRENTSET, LASTCOM
%
% Author: Arnaud Delorme, SCCN/INC/UCSD, 2022
%
% See also: EEGLAB
% Copyright (C) 2022 Arnaud Delorme
%
% This file is part of EEGLAB, see... |
ef6711f9b0798a765e04bee7a740ec5319a839b86deb134eddad0486716a82be | MATLAB | 3,671 | 148 | function [width1mat,width2mat,wf_used,xplot,mask] = extractWaveforms(A,fileinds)
%extracts action potential (w1) and afterhyperpolarization (w2) widths
%% load fileinds and cluster ids
%G = load('/Users/dhocker/projects/ofc/data/published/concatdata_ofc.mat')
%neurons with troublesome waveforms. ones found in the fi... |
dcbbc2a9ec369ce8f44bfd63ec714e2c7a303f2466251052b8b5206a4394ec4b | MATLAB | 3,674 | 99 | function this = set_from_dimInfo_and_affineTrafo(this, dimInfo, affineTransformation)
% Creates MrImageGeometry from MrDimInfo and MrAffineTransformation
%
% Y = MrImageGeometry()
% Y.set_from_dimInfo_and_affineTrafo(dimInfo, affineTransformation)
%
% This is a method of class MrImageGeometry.
%
% IN
%
% OUT
%
% EX... |
37143cf7a59d827616ae02a1cac45c8536148401c9d2cfee420110b4756a7798 | MATLAB | 3,675 | 93 | function [st,T]=check_template(DATA,st,T,ops)
M_clust = length(unique(st(:,3)));
nt0 = ops.nt0;
[NT,Nchan,~] = size(DATA);
Nbatch = length(unique(st(:,end)));
batch = unique(st(:,end));
Nrank = 3;%default value for projection hard coded
%calculate the mean of each template
irun = 0;
if(length(st(:,1))>ops.Ns_min)
... |
8996e31f34058e14dca94fa4da88238acde63d9dbabdb1f29550085bf55d05e5 | MATLAB | 3,677 | 121 | function [Z, Zpattern, L, D, U, P, Q, stats] = sparseinv (A)
%SPARSEINV computes the sparse inverse subset of a real sparse square matrix A.
% This function is typically much faster than computing all of inv(A).
%
% [Z, Zpattern, L, D, U, P, Q, stats] = sparseinv (A)
%
% Z is a subset of the inverse a sparse matrix A o... |
cba06ac54791807125c3bc0a16a50cc743c55d5852b924c49d7549905e7ea525 | MATLAB | 3,677 | 84 | % EEG_EVENTFORMAT - Convert the event information of a dataset from struct
% to array or vice versa.
%
% Usage: >> [eventout fields] = eeg_eventformat( event, 'format', fields );
%
% Inputs:
% event - event array or structure
% format - ['struct'|'array'] see below
% fields - [optional] cell arra... |
587ab25ed60ea69fef8a87fe6f545dc7c703e251692a48f0c89aa690f8501a9c | MATLAB | 3,678 | 102 | function c = tapas_ph_binary_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Pearce-Hall (PH) learning model for binary inputs.
%
% The PH model is described in:
%
% http://www.scholarpedia.org/article/Pearce-Hall_error_l... |
b8daeb0384a1d1b735d02d3bb2edfa2df8799f9bcdacbde5ec67e7f20c4b4363 | MATLAB | 3,678 | 99 | function sR=icassoExp(sR)
%function sR=icassoExp(sR)
%
%PURPOSE
%
%To prepare Icasso result structure for exploratory analysis, i.e.,
%to compute (dis)similarity matrix, clustering, and projection.
%
%EXAMPLES OF BASIC USAGE
%
%First we produce an Icasso result structure...
%
% load megdata
% sR=icassoEst('randini... |
0c58d543204d95e46dcabbe5c036db481a25a247274ccb83954264ec9513f568 | MATLAB | 3,679 | 109 | % COPYAXIS - helper function for AXCOPY
%
% Usage: >> COPYAXIS;
% >> copyaxis( command );
%
% Note: The optional command option (a string that will be evaluated
% when the figure is created allows to customize display).
%
% Author: Tzyy-Ping Jung, SCCN/INC/UCSD, La Jolla, 2000
%
% See also: AXCOPY
% Cop... |
4c2887311d66216d72f20031c15d34e1d052e04a705423d2bb1994fcd2453890 | MATLAB | 3,680 | 89 | function [MRSCont] = osp_LoadP(MRSCont)
%% [MRSCont] = osp_LoadP(MRSCont)
% This function reads raw (coil-uncombined) data from GE P (*.7) files.
%
% USAGE:
% [MRSCont] = osp_LoadP(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data con... |
c82aa633e6cf63a37c2aa55669883769d6070c8c76a8bfd0e90df15756ef8eaf | MATLAB | 3,682 | 94 | <<<<<<< HEAD
%%
close all
iChan =[25 28];
del = [];
for i = 1:length(unique(rez.st(:,end)))
if rez.Merge_cluster{i,end}(1) >=iChan(1) && rez.Merge_cluster{i,end}(1) <= iChan(2)
wv_ccg(rez,i)
% plot_ncc(rez,i)
end
end
% [ NaN 14 17 42 62 3 46 18 NaN 44 NaN]
% [ 6 47 48 53 50... |
d56534fabbc3881ad6b072800e5f9602539fbd15f640aab441b66bbd7c09c222 | MATLAB | 3,683 | 77 | function [SIGNAL_subspace_similarity, NOISE_subspace_similarity, SENSAI_score] = SENSAI(artifact_threshold, refCOV, Eval, Evec, noise_multiplier, cov_total, evecs_Template_cov, signal_type, SSI_top_PCs)
% Evaluates GEDAI cleaning quality for a given threshold.
%% Creative Commons License
%
%... |
7f0989d8ba707a44ed536414bb325180476b029c1d79f8ae20261909cf2907b9 | MATLAB | 3,684 | 93 | function gen_stim_detection_reference()
% Generate ground-truth stim-detection fixtures by calling MEA-NAP's own
% detectStimTimes.m + getStimPatterns.m directly on the two testMEAstim raw
% recordings, replicating the params of the OutputData20Jul2026 reference run.
%
% detectStimTimes.m / getStimPatterns.m / checkSti... |
76ebcfedbb9d793b6d186d4b88460c740e1107f57a6d802336719ebf6b38c74a | MATLAB | 3,685 | 155 | function coactPaper_tableS08()
labelWeight=true;
labelCase=true;
labelSize=9;
letGapX=5;
letGapY=5;
fontsize=6;
close all
fh=initFig('width',18.6,'height',2.3,'font','Arial','fontsize',fontsize);
x=1;y=1;
panel_01(x,y,7);
drawnow();
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS08_%s.pdf',datestr(now,... |
034203321165fd6f06b9a85c1575fb640248648d8e687bde273f17d9a2ffc10b | MATLAB | 3,686 | 108 | function [periods,in] = Threshold(x,criterion,threshold,varargin)
%Threshold - Find periods above/below threshold.
%
% Find periods where samples lay above or below a given threshold. Optionally,
% keep only periods of sufficient duration and ignore brief interruptions.
%
% USAGE
%
% [periods,in] = Threshold(x,c... |
6fe866eed90a079f985bd0dd591a04322e3b5148c6a2366c796af9afe9f9d338 | MATLAB | 3,686 | 138 | function coactPaper_figureS12()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
close all
fh=initFig('width',8.9,'height',3,'font','Arial','fontsize',fontsize);
x=25;y=5;
panel_01(x,y,fontsize);
drawnow();
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/figS12_%s.pdf',datestr(... |
115b1bc696e092bbac273bec761923d7f4413e113399a65e44a84c13ea2a59f6 | MATLAB | 3,687 | 144 | clc
clear all
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%left pixel_error_each_user %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
processedpath = input('Enter processed_data location(such as /home/EV_Eye_dataset/processed_data) to use Pixel_error_evaluation: ', 's');
sess... |
1ba8b6556325901a8d9990eab5d7a3b554a3b50e2867e3f16fceb81a40aaee2d | MATLAB | 3,688 | 84 | function [resBasisSet] = fit_resampleBasis(dataToFit, basisSet)
%% [resBasisSet] = fit_resampleBasis(dataToFit, basisSet)
% This function downsamples basis functions (which are usually given in
% higher resolution than the data that is to be fitted) to match the
% resolution and frequency range of the data.
%
% ... |
92a17b062d62927e31e19eedfe91bd9a94e4276d18c3316131ca35fba94fb07a | MATLAB | 3,689 | 126 | function autoqc_fmri(datadir,expecteddim)
ppdir = regexprep(datadir,'rawdata','ppdata');
mkdirquiet(ppdir);
% init
pptc = {}; % cell type x run, elements are pp x volumes (percentile of raw data)
histall = {}; % cell type x run, elements are 1 x bins with counts
mmtc = {}; % cell 1 x type, elements are pp x ru... |
ee96e634e7bbd15fcb6b260c49a8e42639d779c61f5a9f284e269b3ed58e3cce | MATLAB | 3,689 | 92 | function out = EN_PermEn(y, m, tau)
% EN_PermEn Permutation Entropy of a time series.
%
% "Permutation Entropy: A Natural Complexity Measure for Time Series"
% C. Bandt and B. Pompe, Phys. Rev. Lett. 88(17) 174102 (2002)
%
% ---INPUTS:
% y, the input time series
% m, the embedding dimension (or order of the permuta... |
51541202db192a44e088b9f58ed2ee3c723c32c6664f7b77e38fc050d77ac645 | MATLAB | 3,690 | 89 | % ENV - return envelope of rows of a data matrix, or optionally
% of the data interpolated to a different sampling rate.
% Usage:
% >> envdata = env(data);
% >> envdata = env(data, timelimits, timearray);
%
% Inputs:
% data - (nchannels,ntimepoints) data array
%
% Optional Inputs:
% timelimits - (... |
8f68bc619a5c2ff9b9cb96c7746c9cbbdbfa6f6a345a0546e180bfbab700f5cd | MATLAB | 3,690 | 131 | %% function [totalField,N_std] = estimateTotalField_MEDI(fieldMap,magn,matrixSize,voxelSize,varargin)
%
% Description: compute the unwrapped total field from complex-valued
% multi-echo data
%
% Input
% ----------------
% fieldMap : wrapped field map across echoes
% magn : mag... |
13576601a74faf2d4f5dc932c870a78a6878a6afa1739d370650f220547d14e2 | MATLAB | 3,693 | 107 | function ax = PiecewiseLinearAxis(x,axis,varargin)
%PiecewiseLinearAxis - Label axis using piecewise linear values.
%
% USAGE
%
% ax = PiecewiseLinearAxis(x,axis,<options>)
%
% x axis values
% axis optional axis: 'x' or 'y' (default = 'x')
% <options> optional list of pro... |
26aa25d2500c393d82edcc84169b20e0a9e3d5b7f67f1dde70f7309a67d8f787 | MATLAB | 3,693 | 131 | function step4CreateContrastMaps(maps, funcFWHM2Level)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step 3 was producing mean classification accuracy
% and standard deviation map
% Here Step 4 is omitting the change level from the maps and make
% contrast maps
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
563eaf31639af0ed5f6e14989e285d4ba41a02efec3fc2543cbc6677b6f8ad09 | MATLAB | 3,693 | 107 | function [data, event] = edf2fieldtrip(filename)
% EDF2FIELDTRIP reads data from a EDF file with channels that have a different
% sampling rates. It upsamples all data to the highest sampling rate and
% concatenates all channels into a raw data structure that is compatible with the
% output of FT_PREPROCESSING.
%
% Us... |
b1a576c69da8b9e630458be23aa3d056d5ed5bba85a3074507bbdc69fb075ea0 | MATLAB | 3,693 | 131 | function [unmixsource,umxcoeff,options]=umxRLR(source,reference,varargin)
% GOAL: Unmix the two signal using robust linear regression method.
%
% INPUT:
% - source: source trace 'sce' to be unmixed from the reference trace 'ref'.
% - reference:
% - options (as input struct or variable arguments):
% ... |
35be209c6aa0f9bac8829bb87a348cb3e5b8408b1a9d1c3e9467dbbce8a95baa | MATLAB | 3,695 | 106 | function map = colormap(arg1,arg2)
%COLORMAP Color look-up table.
% COLORMAP(MAP) sets the current figure's colormap to MAP.
% COLORMAP('default') sets the current figure's colormap to
% the root's default, whose setting is PARULA.
% MAP = COLORMAP returns the three-column matrix of RGB triplets defining
% t... |
06c1dd826a16a0d04df9ac7a3765721139013c9e07fed20d47e3780b2288d83b | MATLAB | 3,696 | 97 | % Regenerates the network-metrics ground-truth fixtures used by
% test_pipeline_step4.py. Calls MATLAB's own BCT functions
% (findNodeDegEdgeWeight, strengths_und, density_und, clustering_coef_wu,
% distance_wei/charpath, efficiency_wei, betweenness_wei) directly on the
% real thresholded adjacency matrices saved in a ... |
6191b5bb6af1270abea36f9b4530c993a60dfdd4e40cede306697aef0d843ad8 | MATLAB | 3,699 | 99 | function [K,dK] = covOU(i, hyp, x, z)
% covOU i-times integrated Ornstein-Uhlenbeck process covariance function
%
% [K,dK] = covOU(i, hyp, x, z)
%
% The hyperparameters are:
%
% hyp = [ log(ell)
% log(sf)
% log(sf0) ]
%
% For i=0, this considers the stochastic differential equation
%
% ell * f'(x) + ... |
7fe57437d15b686db417b5bc824e44241f81026e0dd537ebf6de3a3b65afc780 | MATLAB | 3,699 | 79 | function [rawdata, headerinfo] = readnewforcecurve (filename)
%% OPEN THE FILE
forcefile=fopen(filename);
%% THE FOLLOWING READS THE HEADERINFOS
index = textscan (forcefile,'# index: %d',1);
xposition = textscan (forcefile,'# xPosition: %f',1);
yposition = textscan (forcefile,'# yPosition: %f',1);
approachI... |
c7341e69d6b92f19170985abe9dd8604eae0732cc812b36d27f9c18e9f9b3f12 | MATLAB | 3,699 | 110 | function [Y,smoothedYfilename]=spatiallySmooth4DfMRI_mm(Y_OR_Yfilename,volSize_OR_mask,gaussianKernelFWHM_mm,voxSize_mm)
% spatially smooths a 4D fMRI data set stored in variable Y in matlab data file
% Yfilename.mat as a time-by-voxel matrix of dimensions specified in triple
% volSize = [xwidth, ywidth, zwidth].
%
% E... |
d0d2ee13ce35c934451754db268c26c630553e98fe428a7b152a78bb0980c693 | MATLAB | 3,700 | 114 | function h = PlotRepeat(X,Y,pattern,varargin)
%PlotRepeat - Plot repeated (tiled) copies of the data.
%
% USAGE
%
% h = PlotRepeat(X,Y,pattern,<options>,<options2>)
%
% X abscissae
% Y ordinates
% pattern 'xxy','xyy' or 'xxyy' depending on repeated axes
% <options> ... |
b3a56c755e1a25d1afc68ebcad23c1a7f6961e3e6443d77dc5e84b74bf78ddc8 | MATLAB | 3,701 | 97 | %function ch2roi_allFreq(params, groupInfo)
% TBD
% groups channels into defined ROIs (anatomic areas), averages & plots
% FIG:
% - subplots = freqBands x ROIs
% - 1 subplot: time x clz
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected freq. band
% - significance (differe... |
8eba32cbadad5161311d5d10f11f4b324813c9104b84e50afcb67441bdef04e3 | MATLAB | 3,702 | 144 | function newcl = database_point_probe(DB,XYZlist,r,varargin)
% newcl = database_point_probe(DB,XYZlist,r,varargin)
%
% given a point list (n x 3 mm coordinates) and a radius r,
% gets a clusters structure with points within r mm of any input coordinate in the
% list
% prints a table of unique contrasts within studies t... |
647b7c018a792cf4ef73c4df0510f3ebf6ffe1f4d0ac34f731b0738be922dbe7 | MATLAB | 3,703 | 125 | function [unmixsource,umxcoeff,options]=umxHDM(source,reference,varargin)
% GOAL: Minimization of the energy within the heartbeat frequency band. This
% function works on vector variable only.
%
% INPUT:
% - source: input signal to be unmixed
% - reference: input reference.
% - options (as input struct o... |
5a60f12970a735b149915c493024335cac84f839939a1ef15a7bd7fed052c5a7 | MATLAB | 3,706 | 88 | % eeg_importchanlocs - import channel info from channels.tsv and electrodes.tsv%
% Usage:
% [EEG, channelData, elecData] = eeg_importchanlocs(EEG, channelFile, elecFile)
%
% Inputs:
% 'EEG' - [struct] the EEG structure
%
% 'channelFile' - [string] full path to the channels.tsv file
% e.g.... |
664b6cefb35f9a686b56f571706f93b2d0c32c71f8f16544b73666d07494cf0c | MATLAB | 3,706 | 94 | % READEDF - read eeg data in EDF format.
%
% Usage:
% >> [data,header] = readedf(filename);
%
% Input:
% filename - file name of the eeg data
%
% Output:
% data - eeg data in (channel, timepoint)
% header - structured information about the read eeg data
% header.length - length of header to jump to... |
9bbea2d92bf0024482c13e0cc69a10bf7b6a16b128755c1a587d132e14602c56 | MATLAB | 3,706 | 116 | function tapas_hgf_ar1_mab_plotTraj(r)
% Plots the estimated or generated trajectories for the HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_ar1_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyright (... |
313f425fee8dbb4f964d0613cf631140f7b70f4cbf77d9f5e03f5a53e399caac | MATLAB | 3,708 | 103 | % (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')),'..', '..','... |
3d2ccf3434387909e75b67ebaf40966b516772d0e1eaa24ea36ef956f83ce967 | MATLAB | 3,709 | 175 | function obj = plot(obj)
if obj.verbose < 2
return
end
f = findobj('Type', 'Figure', 'Name', 'BRCA');
if isempty(f)
f = figure('Name', 'BRCA', 'NumberTitle', 'off');
end
set(0, 'CurrentFigure', f);
clf(f);
nrow = 4;
ncol = 3;
i = 1;
% ----
% mean
... |
57899ce9adb7abba94a5e5ce0fc9507e20bb17e8410ee4b6254d23d345e45876 | MATLAB | 3,711 | 73 | % STD_MOVEOUTLIER - Commandline function, to reassign specified outlier component(s)
% from a cluster to its outlier cluster.
% Usage:
% >> STUDY = std_moveoutlier(STUDY, ALLEEG, from_cluster, comps);
% Inputs:
% STUDY - EEGLAB STUDY set comprising some o... |
e7be99d9eb83e45cb7cb0249deaaa8452c6c604a794bf9d154bbc985d24c089d | MATLAB | 3,711 | 162 | function [Model, Info] = linear_fit(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
%
% [Model, Info] = linear_fit(X,Y,Model,parm)
%
% --- Input
%
% X : Input data ( M x T )
% Y : Output data ( N x T )
% N = # of output
% M = # of input
% T = # of data
%
% parm :... |
77a8eb2e47fdd62dc17c35c19c7b3c43e375328849e6037ff495ea773d74581a | MATLAB | 3,712 | 115 | function M = symmetricfactory(n, k)
% Returns a manifold struct to optimize over k symmetric matrices of size n
%
% function M = symmetricfactory(n)
% function M = symmetricfactory(n, k)
%
% Returns M, a structure describing the Euclidean space of n-by-n symmetric
% matrices equipped with the standard Frobenius distanc... |
3d8ebeb3dfd3072077f40d4176c5ad74aa0dfdf5a7114ae63a1aa77d469555f8 | MATLAB | 3,714 | 99 | % PLOTMESH - plot mesh defined by faces and vertex
%
% Usage:
% plotmesh(faces, vertex);
%
% Input:
% faces - array of N x 3. Each row defines a triangle. The 3 points
% in each row are row indices in the matrix below.
% vertex - array of M x 3 points, (x = first column; y=second column
% ... |
f6fe6d44313dba066677079f8146c499c32815632ab0e28aa7f8192b0776adf5 | MATLAB | 3,714 | 142 | function tnet = vl_simplenn_tidy(net)
%VL_SIMPLENN_TIDY Fix an incomplete or outdated SimpleNN network.
% NET = VL_SIMPLENN_TIDY(NET) takes the NET object and upgrades
% it to the current version of MatConvNet. This is necessary in
% order to allow MatConvNet to evolve, while maintaining the NET
% objects clea... |
4d0be3d6bfc7f569527df411c6652df53fdc96367c5683f3f69a2c917348a662 | MATLAB | 3,715 | 99 | % std_cell2setcomps - convert .sets and .comps to cell array. The .sets and
% .comps format is useful for GUI but the cell array
% format is used for plotting and statistics.
%
% Usage:
% [ struct sets comps ] = std_cell2setcomps(STUDY, clustind);
%
% Author: Arnaud... |
649ae13877669c4de1fc94eedde28cbc0ec79cd8080eb15d608ebb642d6f3aa2 | MATLAB | 3,715 | 108 | function [F1, adjM, adjMci] = adjM_thr_checkreps(spikeTimes, method, lag_ms, tail, fs,...
duration_s, rep_num, oneFigureHandle)
% Description: This function generates synthetic spike times from original
% events and randomizes them using circular shift. All synthetic data is
% created from existing events.
%
% It t... |
98bcc2e2453234aaba905bbbea237192e9abf0a27a2f797af19f21c93c4d1b64 | MATLAB | 3,715 | 119 | function [proj] = elproj(pos, method)
% ELPROJ makes a azimuthal projection of a 3D electrode cloud on a plane tangent to
% the sphere fitted through the electrodes. The projection is along the z-axis.
%
% Use as
% proj = elproj([x, y, z], 'method');
%
% Method should be one of these:
% 'gnomic'
% 'stereogra... |
6a9fa5f70255be7c4f950d7db633e5585169733822eff72c5728f6dae15fd304 | MATLAB | 3,716 | 112 | function [data] = GetData(PathName) % by Julia Becker, 01/04/2020
%GETDATA Imports all .mat file and additional information
% Also reads sensitivity, spring constant and setpoint in V from .txt
% file and computes bead radius used.
%% Get all .txt files in 'files and labfile' in this folder
invent = dir(full... |
4f605dddb7cc56f7db35d47b6787d6cb7cda6eefa41ca885db4ef64ed84b5bee | MATLAB | 3,717 | 60 | % smoothAnatBars - (use with bar simulations) interpolates RF responses from visual coordinates to given anatomical coordinates
% also smooths responses if they are provided in grid format
%
% Usage - [allRandRespsAnat,allRandRespsAnatSmoothed] = smoothAnatBars(respMat,rfParams,anatSampling,smoothSigma... |
2dd66e2f4f92e48f0bc3ac9b4d8f590c837a769f705d6a80ab25220e9b2a84ff | MATLAB | 3,718 | 120 | function icassoDendrogram(sR,L)
%function icassoDendrogram(sR,[L])
%
%PURPOSE
%
%To visualize the clustering and similarities between estimates as
%a dendrogram and a corrgram.
%
%EXAMPLE OF BASIC USAGE
%
% icassoDendrogram(sR,25)
%
%INPUT
%
%[An argument in brackets is optional. If it isn't given or it's
% an empty... |
0842d927695f93d32eca537bf5bb4d8b96863f4570fe6762e658049c98d60efb | MATLAB | 3,721 | 91 | % load reference maps: output for statistical analysis of HD-EEG
% 256 channels (cohen's d)
analysis_dir = '/home/uni10/nmri/projects/cstier/channels_analysis';
results_analysis = '/home/uni10/nmri/projects/cstier/channels_analysis/results';
% in this case only for the theta band
rootfolder = ('/home/uni10/nmri/proj... |
52ae0dc6973b3141766d667ff68c6a5c1974375b80a61864b782cefb8f88283a | MATLAB | 3,721 | 144 | function tapas_findreplace(file,otext,ntext,varargin)
%FINDREPLACE finds and replaces strings in a text file
%
% SYNTAX:
%
% findreplace(file,otext,ntext)
% findreplace(file,otext,ntext,match)
%
% findreplace : This function finds and replaces strings in a text file
%
% file: text file name (with or w... |
8308d18b613907783c80c75597f520505ca9a93bacd04f26fc773149a0c81d3f | MATLAB | 3,722 | 91 | function S = GetMD5_helper(V)
% GetMD5_helper: Convert non-elementary array types for GetMD5
% The C-Mex function GetMD5 calls this function to obtain meaningful unique data
% for function handles, java or user-defined objects and sparse arrays. The
% applied processing can depend on the needs of the users, therefore i... |
04e17bc757cfe4d99e5f282b9d096e4b4b9708f48334399f1f89b3ad7f2fd46a | MATLAB | 3,723 | 117 | function [x,m,e] = RunningAverage(X,Y,varargin)
%RunningAverage - Compute running linear or angular average.
%
% Computes the running average of y=f(x). Variable y can be linear or circular
% (use radians). The error bars are standard errors of the mean for linear
% data, or 95% confidence intervals for circular data.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.