sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ca5b68c1c3b222ce419423ef0bc2a7745442434505d47960ac4b8c9efda6ff58 | MATLAB | 7,107 | 160 | function [communities_reshaped,temporal_activation_sequence,dwell_time_total,dwell_time_average,instantaneous_correlation_tensor,community_modularity,transition_cost] = get_communities_louvain(connectivity_subsampled,connectivity_complete,community_iterations)
% Extracts the main meta-states from the connectivity tens... |
c817bf77f15362368ba0c6c0e24a9417a2ff110e6250512915c4e15f8c8da198 | MATLAB | 7,113 | 172 | function [ subject ] = nmri_load_subject_most_advanced( subject, params )
%[ subject ] = nmri_load_subject_most_advanced( subject )
% Will load the most advanced subject struct based on step-hirarchy
% check if subject struct is okay
if ~isfield(subject,'id') || ~isfield(subject,'exam_id') || ~isfield(subject,'analy... |
0e046a3bd1142dcbccb6453c09cf2f39c4f9a8394297e78b9cbdd626d05b0e36 | MATLAB | 7,117 | 222 | function val = niftiGet(ni,param,varargin)
%
% Get a value from a nifti structure
%
% val = niftiGet(nii,param,varargin)
%
% USAGE
% val = niftiGet(nii,'Data');
%
% INPUTS
% Nifti struct - The structure read in by niftiRead
% param - String parameter specifying the value to retrieve
%
% RETURNS
% Value (or values... |
88cd1d84e7d2a794f511582dfae1cfd6c075ba7c0f18a88b23eee88fa3341df1 | MATLAB | 7,119 | 161 | function [MRSCont] = osp_LoadTwix(MRSCont)
%% [MRSCont] = osp_LoadTwix(MRSCont)
% This function reads raw (un-combined) data from Siemens TWIX files.
%
% USAGE:
% [MRSCont] = osp_LoadTwix(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS d... |
f4eb5bca900b1ad951b6469f6346971ef7677b52af7341101421fc9c321fdcfc | MATLAB | 7,119 | 187 | % fit_makeMMBasis.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [BASIS] = fit_makeBasis(folder, addMMFlag, sequence, editTarget)
%
% DESCRIPTION:
% Generates a basis set in FID-A structure. The code will search all *.mat
% files in the input folder for FID-A structures with simulated spectra. It
%... |
9907e25857bac9734a6877d54211d6b22c81e0ace0811ff050ec44095100a885 | MATLAB | 7,121 | 191 | function [S, Serr, per, tau, exctn, lambda] = ARFIT_armode(A, C, th)
%ARMODE Eigendecomposition of AR model.
%
% [S,Serr,per,tau,exctn]=ARMODE(A,C,th) computes the
% eigendecomposition of an AR(p) model that has been fitted using
% ARFIT. The input arguments of ARMODE are output of ARFIT.
%
% The columns of the out... |
43ed1db85ee7cd94f50b6fe8b393c9b9bd5b189ba19eadaac14e53412448875b | MATLAB | 7,122 | 200 | function M = multinomialdoublystochasticfactory(n)
% Manifold of n-by-n doubly-stochastic matrices with positive entries.
%
% function M = multinomialdoublystochasticfactory(n)
%
% M is a Manopt manifold structure to optimize over the set of n-by-n
% matrices with (strictly) positive entries and such that the entries o... |
f2ba8585358c4768c003a1bd123f84a6dd08f1ea42c5534e46278dec2af8db67 | MATLAB | 7,123 | 180 | function [subtypes,Connections]=graphical_model_train(N, P, dHausdorff, alpha, unpairedC, thd1, thd2, thdm, K, gamma, iters)
%%
% graphical model training
%
% Inputs:
% N: total number of training data
% alpha: weights between spatial and temporal penalty
% unpairedC: unpaired cost for the patch matching algori... |
cee7dad21a140dab74674ef7310f7ce9eb2e3e29bc4afba59217c01e2f0ac7aa | MATLAB | 7,124 | 216 | function M = elliptopefactory(n, k)
% Manifold of n-by-n psd matrices of rank k with unit diagonal elements.
%
% function M = elliptopefactory(n, k)
%
% A point X on the manifold is parameterized as YY^T where Y is a matrix of
% size nxk. As such, X is symmetric, positive semidefinite. We restrict to
% full-rank Y's, s... |
18c58f16554d8cb61333f096041d18e74339dc0f5e58fde578fd029d36e60d32 | MATLAB | 7,125 | 176 | function [np_info] = np_readfileinfo (filename, option)
%
% function [np_info] = np_readfileinfo (filename, option)
%
% Purpose:
%
% np_readfileinfo reads out header information from a NEURO PRAX
% data file (*.EEG).
%
% Syntax:
%
% [np_info] = np_readfileinfo(filename);
% [np_info] = np_readfileinfo(filename,'NO_... |
6dc343f226bda5a32f76ed2253982cc84360034676ec15f9c789eb666e68f306 | MATLAB | 7,125 | 221 | function [NdCartDiv, PopNumNC] = NodeCartography(Z, PC, lagval, e, FN, Params, figFolder, oneFigureHandle)
% This also makes a plot
% node cartography
% see Guimera and Amaral, 2005
% 'Functional cartography of complex metabolic networks'
% author RCFeord 2020
% Updated by Tim Sit
%
% Parameters
% -------... |
e85da278b6a20c5472eb624bffa9d1d1b7b1d54f1811416cfb24a6ed3d5bcfb6 | MATLAB | 7,126 | 196 | % RSFIT - find p value for a given value in a given distribution
% using Ramberg-Schmeiser distribution
%
% Usage: >> p = rsfit(x, val)
% >> [p c l chi2] = rsfit(x, val, plot)
%
% Input:
% x - [float array] accumulation values
% val - [float] value to test
% plot - [0|1|2] plot fit. Using 2... |
f78f8ee8fbbb984f109a5182a74f3c7fc444fec98f827b20b1fac565192e13e7 | MATLAB | 7,126 | 157 | %{
preprocess.PrepareGalvoMotion (imported) # motion correction for galvo scans
-> preprocess.PrepareGalvo
-> preprocess.Slice
---
-> preprocess.Channel
template : longblob # stack that was used as alignment template
motion_xy : longblob # (... |
75995c628aa4ff75004ddf78748eae306868b74d6bc4172b3926deb1bb7583c9 | MATLAB | 7,127 | 259 | function [traj, infStates] = tapas_hhmm(r, p, varargin)
% Estimates a hierarchical hidden Markov model (HHMM)
%
% This function can be called in two ways:
%
% (1) hhmm(r, p)
%
% where r is the structure generated by fitModel and p is the parameter vector in native space;
%
% (2) hhmm(r, ptrans, 'trans')
%
% ... |
3e189743dd4e779f2be5b1f122d5652206c23df1da89359318a95d027a1ec791 | MATLAB | 7,134 | 163 | function [varargout] = fMRIDataPreparation(betaCorrespondence, userOptions)
%
% fMRIDataPreparation is a function designed to take fMRI data and load it into
% the correct format for the rest of the toolbox to use.
%
% [fullBrainVols =] fMRIDataPreparation(betaCorrespondence, userOptions)
%
% betaCorrespondence -... |
95ff50eb7c73a5778dc3fed945eb4caaf5689d14f45be4ac7e2537579350cf6b | MATLAB | 7,135 | 209 | function nmfResults = calNMF(activityMatrix, fs, downsamplefreq, duration_s, ...
minSpikeCount, includeRandomMatrix, includeNMFcomponents, verboseLevel, suite2pMode)
% calNMF calculates metrics related to non-negative matrix factorisation (NNMF) of
% the spike matrix
%
% Parameters
% ----------
%
% activityMatrix ... |
29e6a59a227fd95a7cf6a9860e3b203f787fb8dc02c02a52b12f34ee0a830c7f | MATLAB | 7,138 | 180 | function [realRs, bootstrapEs, pairwisePs, bootstrapRs] = bootstrapRDMs(bootstrappableReferenceRDMs, candRDMs, userOptions)
% [realRs bootstrapEs pairwisePs bootstrapRs] = ...
% bootstrapRDMs(bootstrappableReferenceRDMs, ...
% candRDMs, ...
% ... |
7f26272c619effb263a4d534219dce41ef2ab1d027e82e8a2d2265103a0b1c10 | MATLAB | 7,142 | 178 | function out = osp_plotSegment(MRSCont, kk, VoxelIndex)
%% out = osp_plotSegment(MRSCont, kk, VoxelIndex)
% Creates a figure showing output from the segemntation routine
% stored in an Osprey data container
%
% USAGE:
% out = osp_plotSegment(MRSCont, kk, VoxelIndex)
%
% OUTPUTS:
% out = MATLAB f... |
fe174bef55bbe4c53e57ce92e5bf5dbd62bc8199f165f6c353718a20c082903a | MATLAB | 7,145 | 148 | %--------------------------------------------------------------------------
% writeCentroidsFiles.m script is used write centroid files for elastix and
% visualization
%
%% Developed and maintained by Kannan Umadevi Venkataraju <kannanuv@cshl.edu>
%% do not distribute without permission.
%
% Usage
% writeCentroidsFile... |
d452a8f69492651d6cdea84e6d0c80dabb0a91fc3c3132158ec5632f52b2acd6 | MATLAB | 7,146 | 218 | function create_volume_meshes(input_img, maxvoxelvolume, input_coordsys, ...
output_coordsys)
%
% Input: input_img <string> fullpath to folder, where the results of
% mysegment.m are stored
% maxvoxelvolume <float> desired maximal volum... |
50bae119f833b983f948967cda7a5bc2c620bab4598fd7b8c774165b0a141d70 | MATLAB | 7,148 | 162 | clear all
close all
clc
nFiles = 16;
rsa_tool_path = 'rsatoolbox';
output_dir = 'subSpaceGener_9PCs';
slName = 'L100_projMat';
base = 'C:\Users\User\Documents\fMRI_EXP\';
spm_path = "C:\Users\User\Documents\spm12";
output_path = fullfile(base, 'group_level_stats', output_dir, 'fsl_normalization');
data_path = fullfi... |
c5dd2d1ff18a5819a69ef87bab333c80e487f597906f5fb3a7e13b8335fd431c | MATLAB | 7,150 | 223 | function [err] = FigPrint (Opt, colopt)
%
% mode 1:
% [err] = FigPrint ([Opt])
% mode 2:
% [err] = FigPrint (h, [col])
%Purpose:
% Prints the figure, or save to a file
% Printing only works if you add the printer setup on your machine
% in this file. I recommend you make your own copy of this function
% ... |
e0942790b648f294b3732509517a3f11f251dee5e51d8925285a86165bd197cf | MATLAB | 7,150 | 187 | function [c, r, t, cpulse, acq_codes, verbose, gsr] = tapas_physio_read_physlogfiles_adinstruments_txt(...
log_files, cardiac_modality, verbose, varargin)
% Reads in 4-column txt-export from ADInstruments/LabChart data
% (e.g., channels titled O2 CO2 Pulse Respiration Volume trigger
% trans_force)
%
% [c, r, t, cp... |
4005a155786147fdfea2fc8f37ff3ebf6648eb1ecf237970a0d855df5f02e914 | MATLAB | 7,155 | 157 | function data = significant_events3(data, bins, varargin)
% Master function to handle dataset, distribute recording traces and store
% the generated masks for transients.
args = struct('nsigma',[3,4,5],'mindur',.2,'maxdur',1,'cutoff',0.05,...
'GaussFiltFreq',0,'framerate','default'); % Dur: time in ... |
c258aa6d7be33db85a665d8cf305363569e0458449c5a4c1bb1f327a7adbce50 | MATLAB | 7,160 | 149 | function [MRSCont] = osp_AverageAllDatasetsAlongExtra(MRSCont)
%% [MRSCont] = osp_AverageAllDatasetsAlongExtra(MRSCont)
% This function averages all files of the MRSContainer along the extra
% dimension. This can be useful to combine several acquisitons from the
% same voxel. SNR and linewidth will be recalculate... |
d4658588e1701c9daff9d4f181d5af30816af71d3710d58a215c9ecae2939a64 | MATLAB | 7,160 | 257 | function [WT, Lat] = Figure1(datadir, codedir)
%Figure1 - Wait time and trial initiation time were modulated by the value
% of the environment
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'IgnoreCase'... |
b23c8ac0f34e3adbdeac669c8a4c86fe3cf70ca3607975cc434f96f7d4a73599 | MATLAB | 7,162 | 178 | % This script reports all relevant F-contrast-maps for physIO-created regressors
% for the specified subjects
% Author: Lars Kasper
% Created: 2014-01-21
% Copyright (C) 2014 TNU, Institute for Biomedical Engineering, University of Zurich and ETH Zurich.
%
% This file is part of the TNU CheckPhysRETROICOR toolbox, whi... |
99c307f1acd7e95166602bbbda878059c5ddf7790a62f003e4f7f08b4b0e9fd5 | MATLAB | 7,163 | 186 | %% fitglm_pairwise_network.m
clear; close all; clc; warning('off');
scriptName = mfilename;
%% Ensure workers can see current code path (parfor safety)
p = gcp('nocreate');
if isempty(p); p = parpool; end
% Replicate current path on workers
pctRunOnAll addpath(genpath(pwd));
%% ---- Inputs (same dialog as before)
pat... |
163e038c4df8f38c505d4ff57a9a1eeedac9bac647e4d0fa0a6ec63e9f3db727 | MATLAB | 7,169 | 118 | % smoothAnatGUI - (use with rf simulation GUI) interpolates RF responses from visual coordinates to given anatomical coordinates
% also smooths responses if they are provided in grid format
%
% Usage - [allRandRespsAnat,allRandRespsAnatSmoothed,mmScaleIdxs] = smoothAnatGUI(respMat,rfParams,anatSampling... |
4a9bdd1a27e1334e92ba15cd8e9f11494532a991004998f37e9cc771a8c369d1 | MATLAB | 7,169 | 190 | function [d,s,linkage] = FunctionalClustering(spikes,varargin)
%FunctionalClustering - Determine spike train similarity tree using FCA analysis.
%
% Determine which spike trains are most similar in a neuronal population. This
% uses the Functional Clustering Algorithm (FCA) of Feldt et al. (2009).
%
% For each pair of... |
702fda7a73022d2decbd3488bf7b427eaf584838c1331529b3aaae293d540dd0 | MATLAB | 7,169 | 176 | function [newnode,newelem,newelem0]=surfboolean(node,elem,varargin)
%
% [newnode,newelem,newelem0]=surfboolean(node1,elem1,op2,node2,elem2,op3,node3,elem3,...)
%
% merge two or more triangular meshes and resolve intersecting elements
%
% author: Qianqian Fang <fangq at nmr.mgh.harvard.edu>
%
% input:
% node: node... |
7b031c17dfd02aff71c92964cc33d2976dea10a9763e5c19507ad617796fc19c | MATLAB | 7,169 | 242 | function plotNodeHeatmap(FN, Ephys, channels, maxVal, Params, coords, ...
metricVarName, metricLabel, cmap, useLogScale, figFolder, figName, oneFigureHandle, subsetChannelName, stimInfo)
%PLOTNODEHEATMAP Summary of this function goes here
% Detailed explanation goes here
% subsetChannelName : not impelemented ye... |
c6d365543b6bc5b317a7e8c130e781d1203b54b3ae999d7d8b2218c530799344 | MATLAB | 7,170 | 148 | % Freely Moving Animal (FMA) Toolbox
%
% INTRODUCTION
%
% The purpose of the Freely Moving Animal (FMA) Toolbox is to help analyze
% electrophysiological and behavioral data recorded from freely moving animals.
%
% These data typically include broadband brain signals (e.g. local field potentials),
% spike ... |
baeb21e1476353f6406e147804a48e43d8467f96a9f10acb6abe12d884959dc6 | MATLAB | 7,172 | 201 | %{
# Population analyis for each clip
-> fuse.ScanDone
-> stimulus.Clip
-> movies.PopStatsOpt
---
mean : float # mean activity
reliability : float # variance explained
mi : float # mutual information - pairwize
rmi : float # randomized mutual informati... |
6ffeb0b160a1dccf58e781046070ee5b21ec0dbb05c13521b60e7728c167d7a5 | MATLAB | 7,176 | 220 | % step1_driver_simulate_var_calcium.m (fixed)
% Parallelized over seedList. Writes ground-truth .xlsx files to data/groundTruth.
%
% Usage examples:
% seedList = [42 101 202 303];
% parpool('local',6);
% run('driver_simulate_var_calcium.m');
%% ----- project paths & defaults (caller may override these variables... |
4cead720c9024a8c9cda0822b7484d9288e7d8d1fc59c07d174d14411fa78117 | MATLAB | 7,177 | 199 | function Xs = DVV_surrogate(X, Ns)
% Generates surrogate data for real and complex signals
%
% Surrogate data generation using iterated amplitude adjusted fourier
% transform (iAAFT) method for real-valued series, and complex iAAFT method
% for complex series.
%
%
% USAGE: Xs = surrogate(X, Ns)
%
% INPUTS:... |
99d7c77af8f1bea80456940c1ef336c244f9357b7c180d19b87928fb889604b5 | MATLAB | 7,177 | 220 | function run_broad_weight_simulation(params, options)
% RUN_BROAD_WEIGHT_SIMULATION - Run simulation with broad weight distribution
%
% H1 Line: Execute simulation with gamma-distributed synaptic weights
%
% Syntax:
% run_broad_weight_simulation(params, options)
%
% Description:
% Runs simulation where synaptic wei... |
535e3914b6657420d8a1a22ec96fedff146feb1d4add57b501db9b06ae0e7587 | MATLAB | 7,178 | 163 | function [MRSCont] = osp_fitHERMES(MRSCont)
%% [MRSCont] = osp_fitHERMES(MRSCont)
% This function performs spectral fitting of HERMES MRS data.
%
% USAGE:
% [MRSCont] = osp_fitHERMES(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data c... |
5ce30b19437aed6df1e8b3e2dfbae067ff21960969474bee7842554f75799e49 | MATLAB | 7,181 | 245 | % CBAR - Display full or partial color bar
%
% Usage:
% >> cbar % create a vertical cbar on the right side of a figure
% >> cbar(type) % specify direction as 'vert' or 'horiz'
% >> cbar(type,colors) % specify which colormap colors to plot
% else
% >> cbar(axhandle) % specify the axes to draw cbar in
%
% ... |
8f1b707b2c66acc19df98185145f9c5d337a15ea62424f3a67a47e69f05bd0e0 | MATLAB | 7,183 | 198 | % op_alignAverages.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% [out,fs,phs]=op_alignAverages(in,tmax,med,ref);
%
% DESCRIPTION:
% Perform spectral registration in the time domain to correct frequency and
% phase drifts. As described in Near et al. Frequency and phase drift
% correction of magnetic resonan... |
386dab72373265c17c5b9fb6da055bdf2247c36c2ff57ec2ac1b846de38d571d | MATLAB | 7,190 | 207 | function Figure6(datpath)
%% Figure 6:
% Dmixed PCA shows that OFC-CPi perturbation disrupts block encoding
% but not reward encoding.
%% A & B Schematics
%% C Top Block dPC
plotFunction = @dpca_plot_default;
figure('color','w','Units','centimeters','Position',[1 1 18 28])
tiledlayout(6,3)
event = 'Rew';
figurena... |
18ca160d5f9e8ee9ee34708fec7aa1c95e860db10e750daa86b402d2ae323bf5 | MATLAB | 7,192 | 202 | function [T1temp, MP2RAGEcorrected] = T1B1correctpackageTFL(B1img, MP2RAGEimg, T1img, MP2RAGE, brain, InvEff)
% Usage:
%
% [T1corr, MP2RAGEcorr] = T1B1correctpackage(B1, MP2RAGEimg, T1img, MP2RAGE, brain, InvEff)
%
% B1 and MP2RAGEimg (and T1img) are the nii structures resulting from loading
% the MP2RAGE (MP2RAG... |
061d8c1fc4d89252fad397bf05d5c98a2fe9c95c9350e908d25aa9a140af4c34 | MATLAB | 7,193 | 187 | %% fitglm_pairwise_network.m
clear; close all; clc; warning('off');
scriptName = mfilename;
%% Ensure workers can see current code path (parfor safety)
p = gcp('nocreate');
if isempty(p); p = parpool; end
% Replicate current path on workers
pctRunOnAll addpath(genpath(pwd));
%% ---- Inputs (same dialog as before)
pat... |
0b442c4efcbbd07cf1837811f97c2d743ef84e16b89966ec3903b09b25fa5451 | MATLAB | 7,194 | 177 | % STD_MAKETRIALINFO - create trial information structure using the
% .epoch structure of EEGLAB datasets
%
% Usage:
% >> [STUDY,trialinfo] = std_maketrialinfo(STUDY, ALLEEG);
% >> [~,trialinfo] = std_maketrialinfo([], EEG);
%
% Inputs:
% STUDY - EEGLAB STUDY set
% ALLEEG ... |
7c34400f08ba9bc77a008f3c66b5f2886a149f4ebbd100a095f896efb7e95fbd | MATLAB | 7,194 | 153 | function triggers = getTriggers_phaseLockedMax(params)
% TO DO...
% predicts signal (xVel) by MLR
% computes single-trial phase locking value (SPLV) of predicted and response signal
% triggeres on maxima of SPLV
% (c) Jiri, May12
% TO DO, is it working? (now: Mar13)
% set up MLR prediction
params.regressMethod.doLin... |
95563115cf68e616901b172e964da34b81f8a8d1ced378549c39cdc71ea78df9 | MATLAB | 7,195 | 213 | % RMART - Remove eye artifacts from EEG data using regression with
% multiple time lags. Each channel is first made mean-zero.
% After JL Kenemans et al., Psychophysiology 28:114-21, 1991.
%
% Usage: >> rmart('datafile','outfile',nchans,chanlist,eogchan,[threshold])
% Example: >> rmart('noisy.fl... |
87b453851389d21259b2dc8a5f7da3c271a1d489c42a44bfae495a2654dd86d4 | MATLAB | 7,197 | 217 | function [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName,VoxelIndex,basis)
%% [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName)
% Creates correlation figure of the chosen quantifcation and metabolite
% one figure contains a correlation analysis with subgroup cor... |
294849607856a40ec16070b65fba2440e2680bc06824193abc7d759273a698a1 | MATLAB | 7,203 | 194 | function varargout = GetSequenceList(spikes, intervals, varargin)
% [sequenceList, times, qualifiedIntervals, logical_qualifiedIntervals, nUniqueUnits] = GetSequenceList(spikes, intervals, options)
% Gives sequenceList matrix to use in PairOrder
% Threshold is the minimum number of different neurons that should discha... |
109cec3df437e466802e1934c144c92772a24914be27e169c250cc316708e8b2 | MATLAB | 7,204 | 234 | function rasterPETH(R, M, roi, eventName, preEventMs, postEventMs, clusField, sortField, plotRaster)
% Plots a PETH and an image above of single trial responses, a "raster"
if nargin < 9
plotRaster = 1;
end
% Parameters
timeBase = 10;
lineWidth = 0.5;
semLineWidth = 0.5;
smoothingMs = 35;
% Decide event x label
... |
3312db277dda9f57659df4b0c793d43fcc6270e01c4a2e962ea82617f0e649a0 | MATLAB | 7,207 | 188 | function out = MF_StateSpace_n4sid(y, ord, ptrain, steps)
% MF_StateSpace_n4sid State space time-series model fitting.
%
% First fits the model to the whole time series, then trains it on the first
% portion and tries to predict the rest.
%
% In the second portion of this code, the state space model is fitted to the
... |
41c01453cb020a7e0030843047810ea6e96c3b0b3a0269da8dcdd209805ee0b7 | MATLAB | 7,207 | 175 | function [C, columnNames] = tapas_physio_read_columnar_textfiles(fileName, fileType, nColumns)
% Reads _PULS, _RESP, _ECG, _Info-files from Siemens tics format with
% multiple numbers of columns and different column headers
%
% [C, columnNames] = tapas_physio_read_columnar_textfiles(fileName, fileType)
%
% IN
% fil... |
16b1aa774cdacffd70d18f97a1a1a2844874062cb306035287f84142d1493ebd | MATLAB | 7,208 | 209 | function wasOutOfScale = plotChannel2Axes(trialsData, ch, plotInfo)
% plots channel activations (time-series) to specified axes
% (c) Jiri, Apr18
wasOutOfScale = false; % default (if the channel values were out of yLims scale)
%% settings (defaults)
if ~isfield(plotInfo,'yLims'), yLims = []; else, yLims = plotI... |
d736e2359027c8b31f28298194f7a399c23d1c3a7473abb7a75904e988e5310f | MATLAB | 7,208 | 165 | %% Main script
%
% Copyright 2025 Laura Schmid
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the
% “Software”), to deal in the Software without restriction, including
% without limitation the rights to use, copy, modify, merge, pu... |
f47155fcc28993c853243283dedc6889e10f1f18791330c95e952cc96efa93fb | MATLAB | 7,208 | 201 | %% Generate Figure 6b
% The script has two parts:
% 1. REFERENCE CODE (not runnable without own data): Shows how the original profiles
% were created from NIFTI files. This section requires access to the original
% brain scan data, so the code is included for reference only.
% 2. RUNNABLE CODE: Creates Figure... |
bf63d02b430077c70b68aa10e21d6709790e4bb9155d877214199cd5e45960d4 | MATLAB | 7,211 | 240 | function delay = PETHTransition(psth,timeBins,varargin)
%PETHTransition - Find a transition point in a peri-event time histogram (PETH).
%
% Find a transition point in a peri-event time histogram using the maximum
% likelihood or mean square error algorithm of Friedman and Priebe (1998), or
% piecewise linear fi... |
a0cd7de92f3fd6ed0eafd81a33899073943efb63072280fdac8541f0e2d3edbc | MATLAB | 7,215 | 178 | function [TS_DataMat,TimeSeries,Operations,whatDataFile] = TS_LoadData(whatDataFile,getClustered)
% TS_LoadData Load HCTSA data from file.
%
% Reorders a data matrix and TimeSeries and Operation structures according to the
% permutation information in the given data file (ts_clust or op_clust), or
% provided explicit... |
4821133b80473c0198ad44bbed0a233594b1fe1d96509eff259352066ee22678 | MATLAB | 7,219 | 175 | function MRSCont = osp_writelcm_control(MRSCont, kk, which, LCMparam)
%% [MRSCont] = osp_writelcm_control(MRSCont, kk, which, LCMparam)
% This function creates a LCModel compatible .control file which can be used
% for LCModel batch processing.
%
% USAGE:
% RF = osp_writelcm_control(MRSCont, kk, rr, which,... |
f2e2aeb20934f2c5d0f471e67d8ff361b6abe04c4a157b289d1a2253442693ab | MATLAB | 7,219 | 160 | function [MRSCont] = osp_saveVendor(MRSCont)
%% [MRSCont] = osp_saveVendor(MRSCont)
% This function writes all MRS data loaded by OspreyLoad to separate
% vendor-specific raw data file formats:
%
% - If the input format is by Philips (SDAT/SPAR, DATA/LIST, SIN/LAB/RAW),
% then this function will create SD... |
6d638019bd1d808a23529cacccaf3a5775542c4b916eee0fd0c194be417ec3a6 | MATLAB | 7,220 | 211 | function out = SD_Surrogates(y, tau, nsurr, surrMethod, surrfn, randomSeed)
% SD_Surrogates Surrogate time-series analysis
%
% Generates surrogate time series and tests them against the original time
% series according to some test statistics: T_{C3} (CO_TC3.m) or T_{rev}
% (CO_trev.m), both reimplementations of the... |
793a632ee5537930d158e5d7323de4277df3504333ed4b64391d3838221ac3f7 | MATLAB | 7,221 | 169 | % plot accuracies
%reads the excel sheet "behav Accu" which contains the behav accu
%subject-wise for all the tasks
% NOTE THE ORDER OF SUBJECTS IN ALL THE TABLES
subList ={'001','002','003','004','005','006','007','008',...
'009','010','011',...
'013','014','015','016','017',...
... |
33be6e002abe913d64d2fe042a23b479dea1887e518b11a4063452a8e6d48d8b | MATLAB | 7,222 | 186 | function [spectrogram,t,f] = MTSpectrogram(lfp,varargin)
%MTSpectrogram - Compute LFP spectrogram by multi-taper estimation.
%
% The spectrogram is computed using the <a href="http://www.chronux.org">chronux</a> toolbox.
%
% USAGE
%
% [spectrogram,t,f] = MTSpectrogram(lfp,<options>)
%
% lfp unfilter... |
600504008594575a58a7ab9f87118a04d171cb118d012e468185fcf44e001091 | MATLAB | 7,224 | 222 | function [A,rows,cols,entries,rep,field,symm] = mmread(filename)
%
% function [A] = mmread(filename)
%
% function [A,rows,cols,entries,rep,field,symm] = mmread(filename)
%
% Reads the contents of the Matrix Market file 'filename'
% into the matrix 'A'. 'A' will be either sparse or full,
% depending o... |
5dd46f46478c8efefa7bddfddb9b038cc27a046665f3be172060d1958a0f95cb | MATLAB | 7,225 | 209 | function [mat_data, dims, folder_analysis] = distribute_data(nam, patch_dims, ...
w_overlap, memory_size_per_patch, memory_size_to_use, dir_output, filter_kernel)
% divide the field of view into multiple small patches and save the data
% into these small patches individually. There are overlaps between these
% patc... |
5a3d74f185e33da7a90ab46a079a7edd6e3b1bf2903e906d33bb17ff9270f34b | MATLAB | 7,229 | 186 | % POP_LOADSTUDY - load an existing EEGLAB STUDY set of EEG datasets plus
% its corresponding ALLEEG structure. Calls STD_LOADALLEEG.
% Usage:
% >> [STUDY ALLEEG] = pop_loadstudy; % pop up a window to collect filename
% >> [STUDY ALLEEG] = pop_loadstudy( 'key', 'val', ...); % no pop-up
%
% Optiona... |
e667562c9393361a208508ca76b310a4a121c15705be98a4641be52c37712364 | MATLAB | 7,230 | 204 | %% Make Connectomes - Functional Connectivity and Brain Variability Calculations
% This script calculates functional connectivity and brain variability values
%% Step 1: Set Data Paths
dir = '/YOUR/PATH/HERE/'; % Replace with the path to where your CONN files are stored.
dir_postv1 = [dir '/YOUR/PATH/HERE/'] % Repl... |
2e8b98f659c13e8a284a0905dc9a09a5e98927dd2ed5a1a91fdefdef7d6b3f25 | MATLAB | 7,231 | 116 | function osp_updateCoregWindow(gui)
%% osp_updateCoregWindow
% This function updates the coreg tab.
%
%
% USAGE:
% osp_updateCoregWindow(gui);
%
% INPUT:
% gui = gui class containing all handles and the MRSCont
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins Universi... |
6fcb7959b6aecd4e873919989024596d4147f49d2491a7f7264f4dc025f63422 | MATLAB | 7,232 | 169 | function out = NL_TakensEstimator(y, Nref, rad, past, embedParams, randomSeed)
% NL_TakensEstimator Taken's estimator for correlation dimension.
%
% cf. "Detecting strange attractors in turbulence", F. Takens.
% Lect. Notes Math. 898 p366 (1981)
%
% Takens' maximum-likelihood estimator of the correlation dimension at... |
38a203e6a52c18f86b0f2f6193126b72226af376626a6633ef48543cfad5044a | MATLAB | 7,243 | 159 | function [pieces, ids] = SplitIntervals(intervals,varargin)
%SplitIntervals - split intervals into even pieces.
% Specify either 'pieceSize' or 'nPieces'.
% EXAMPLE 1 (with pieceSize):
% SplitIntervals([2 5; 6 10], 'pieceSize', 2) (i.e. split these intervals into 2-second pieces)
% gives intervals = [2 4; 6 8; 8 10]... |
f0ce4a650310fa0594f7f21aa44259ee9adf8b0adaab9fa04b9535c37b2f54f0 | MATLAB | 7,244 | 226 | function [h_figure, p, settings] = sd_setup_figure(layers, settings)
% SD_SETUP_FIGURE Configures the figure window
%
% DESCRIPTION
% This function computes the figure dimensions and the layout of the
% figure.
%
% SYNTAX
% [h_figure, p, settings] = SD_SETUP_FIGURE(layers, settings);
%
% layers - Nx1 struct... |
17022201229eb3aac890cbf9fa2cf93f9ad21f0a3076170979823bb614915367 | MATLAB | 7,249 | 157 | function outstruct = cifti_read(filename, varargin)
%function outstruct = cifti_read(filename, ...)
% Read a cifti file.
% If wb_command is not on your PATH and you need to read cifti-1
% files, include the extra arguments ", 'wbcmd', '<wb_command with full path>'".
%
% >> cifti = cifti_... |
4987b0ef7cd9bfa4650dbd9ae3887dfb54f454306e5b50dbca2bae3da4d3a4fe | MATLAB | 7,249 | 218 | % coreg_sdat.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [vol_mask] = coreg_sdat(in, vol_image, maskFile);
%
% DESCRIPTION:
% Creates a SPM volume containing a voxel mask with the same dimensions
% as the SPM volume containing a structural image. The voxel mask will be
% created with the geome... |
a7e1e8ad3c4206f8b13b66e0a9f51f47887a50474ecd2640c02d182f9a76c2bc | MATLAB | 7,251 | 316 | function genomat = PlinkRead_binary2(nsubj,snps,fileprefix)
persistent geno_values
% Written by Chun 2015
if ~issorted(snps), error('PlinkRead_binary2 expect sorted list of snps'); end;
nsnp = length(snps);
% bit shift to generate the genovalue matrix
bedprefix = sprintf('%s.bed', fileprefix);
%load('PlinkRead_binar... |
32e2b93583a0090663489ae047c26281e1646fdd2ca3276d7eeb20195b369851 | MATLAB | 7,253 | 172 | function [img2std] = mrAnatComputeCannonicalXformFromDicomXform(xform, imDim)
% Create a transform from scanner space to a standard space
%
% [img2std] = ...
% mrAnatComputeCannonicalXformFromDicomXform(scannerToImXform, imDim)
%
% Given a DICOM-standard scanner-to-image space transform matrix (e,g. the
% NIFTI qt... |
cebda6eec4bc2066f3ad3352dcc2097912e93747018d115462f1f3433394ff6c | MATLAB | 7,253 | 193 | function [v2vs,mn,mx,vORr]=surfing_voxelselection_volume(spheredef,voldef,centeridxs,progressstep)
% volume based voxel selection for searchlight
%
% [V2VS,MN,MX,VORR]=SURING_VOXELSELECTION_VOLUME(SPHEREDEF,VOLDEF[,CENTERIDXS[,PROGRESSSTEP]])
%
% INPUTS:
% SPHEREDEF: definition of searchlight sphere, either one of:... |
2582fa50bcc7901576e504941e08bc82c149b2d517d076856ff817c6279e1890 | MATLAB | 7,258 | 224 | function obj = fromSimpleNN(net, varargin)
% FROMSIMPLENN Initialize a DagNN object from a SimpleNN network
% FROMSIMPLENN(NET) initializes the DagNN object from the
% specified CNN using the SimpleNN format.
%
% SimpleNN objects are linear chains of computational layers. These
% layers exchange information th... |
ebbdda0192ea871f928a8fb0f5792e00b8f5a9f1a58850e66c72a4dd6f39234a | MATLAB | 7,261 | 197 | function varargout = tapas_physio_overlay_contrasts(varargin)
% as Contrast Results report, but overlaying activations on brain image
% instead of showing results table
%
% - Section plots on an anatomical overlay are created and saved as
% post-script file with one page for each contrast
%
% - Input parameters a... |
74fea2c63af40fb68b0acbf7f24b5af95bfcb00b82ce9ee080eeb09dbadb04f8 | MATLAB | 7,262 | 192 | % EEG_EVAL - apply eeglab function to a collection of input datasets
%
% Usage:
% >> OUTEEG = eeg_eval(funcname, INEEG, 'key1', value1, 'key2', value2 ...);
%
% Inputs:
% funcname - [string] name of the function
% INEEG - EEGLAB input dataset(s)
%
% Optional inputs
% 'params' - [cell array] fu... |
ad869109aa723d5a62fc0245c819f19678055a645ef4c495ed5d0e46add1d5de | MATLAB | 7,262 | 196 | %% %%%%%%%% Manually define parameters
nsdsetup;
%% %%%%%%%% Use nsd_mapdata to bring brain mask to EPI space
% run on stone [anat->func]
for subjix=1:8
% load the source 1pt0 brain mask
sourcedata = sprintf('%s/ppdata/%s-structurals/brainmask_1pt0.nii.gz',nsddir,allnsdids{subjix});
% map it to the functio... |
fe2701e15990cfbb60469c31f092663d3fa9367c7fabcf0e74c35ce1da8e01ad | MATLAB | 7,269 | 206 | % EVENTLOCK - DEPRECATED: Please use EEGALIGN instead.
% EVENTLOCK - Time lock data epochs to specified event frames or event x-values.
% Use to timelock existing data epochs to reaction times or other events
%
% Usage:
% >> [dataout,medval,shiftframes] = eventlock(data,frames,eventframes,medval);
% >> ... |
e8436ced2ccce2b05fea1d1f20836256781ea7be84f7e3f9018a41ea8a69693c | MATLAB | 7,272 | 185 | function c = tapas_ehgf_jget_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the enhanced Hierarchical Gaussian Filter (eHGF) model for the
% jumping Gaussian estimation task (JGET).
%
% The HGF is the model introduced in
%
... |
2def94eb70e9dc3f032c0e87e647e14c40e56eced55cadc76407d9ff012b3ac1 | MATLAB | 7,274 | 143 | %% TestTwoPassMasking - Tier 3 real-dataset two-pass masking regression matrix
%
% Runs the one-stop SEPIA pipeline on a real dataset (path supplied via
% sepiatest.get_real_dataset(), never hardcoded) once per two-pass mask
% refinement strategy in methodTwoPassName (sepia_universal_variables.m,
% excluding 'None'), h... |
ae2423664cf70b3b10aa423a251bcda9427629920f7a5436495abe2837915fdf | MATLAB | 7,276 | 160 | %% List of name-value pair arguments accepted by tapas_Huge() and estimate()
%
% NAME: BurnIn
% VALUE: positive integer (default: half of number of iterations)
% DESCRIPTION: Length of burn-in period in samples.
%
% NAME: Confounds
% VALUE: double array
% DESCRIPTION: Specify confounds for g... |
3b37cd8571cffe5646c80a7507f597449b180803ad0085c0aa226795e1d7ffd2 | MATLAB | 7,278 | 181 | function [ dF_F , F , F0 ] = generateArtificialCalciumFluorescence( units , time_steps , dT_step , assembly_configuration , calcium_T1_2 , rate_range , eventDuration_t , eventFreq_f , eventMult , noiseSTD , saturation_K )
%GENERATEARTIFICIALCALCIUMFLUORESCENCE( units , time_steps , dT_step , assembly_configuration , ca... |
9c9f6d1d1f5498d9be292c5ae35969214484bb8ff9c62383b77b4cba13e72797 | MATLAB | 7,281 | 222 | function [chi2,p,ci,stats,dist] = permuvartest(x,v,varargin)
%PERMUVARTEST One-sample permutation-based chi-square test.
% H = PERMUVARTEST(X,V) returns the results of a one-sample permutation
% test based on the chi-squared statistic. H=0 indicates that the null
% hypothesis (that the data in X come from a dist... |
9e30ec1e5672605950d81c5690310ade4b2aede770c77f039a3c6c659686efb7 | MATLAB | 7,283 | 202 | function output = cvRegress(predictors, outcomes, nPartitions, nFolds, regType, fields, verbose)
% Performs cross-validated regression on single-trial data.
%
% This function fits a specified regression model (ridge or OLS) to predict
% outcome variables from predictor variables using k-fold cross-validation
% repeated... |
9ee8454997c45ae633f885a8294afe66d2d532d964807df3ca9a30269ca4b075 | MATLAB | 7,283 | 169 | %% load data & set parameters
saveDir = '\\znas\Lab\Share\Celian\ChronicPaper';
load(fullfile(saveDir, 'data_Bimbard2024'))
% amp and cnt can be re-obtained running the associated part in
% "saveDataForPaper.m"
% Subjects used in paper
subjects = unique(expInfoAll.subject);
colAni = ones(numel(subjects),3)*0.5;
subj... |
a6d5b874d2ebd582c24f66426bd3cf1849d4f8bd459730002a7235325d7abdff | MATLAB | 7,290 | 224 | function fear_getSWR_spike_PETH(basename)
% basename='~/data/Fear/triple/innis190601/innis190601';
load([basename '.basicMetaData.mat'])
if ~exist([basicMetaData.Basename '.ripples.events.mat'],'file')
warning('swrTrigHist.mat was not generated since %s not found',[basicMetaData.Basename '.ripples.events.mat'])
... |
0f63d46f3b1a04c3e36f39c2dbdbde1da809a8251e399f9fd2ea0d88487a8529 | MATLAB | 7,293 | 217 | function [tSnrImage, fileTsnr, tSnrRatioImage, fileTsnrRatio] = ...
tapas_physio_compute_tsnr_spm(SPM, iC, iCForRatio, doInvert, doSaveNewContrasts)
% Computes temporal SNR image after correcting for a contrast
% from SPM general linear model
%
% tSnrImage = compute_tsnr_spm(input)
%
% This function executes th... |
508d0139f63f493677f09811745389eb7d11ab71f07eec9081cfebb0c8fe2aa2 | MATLAB | 7,293 | 218 | function [] = plotAnalysis01D(saveFigures)
% Produces plots to visualize the results of analysis02B.
% save figures by default
if nargin==0
saveFigures = true;
end
% get file paths
paths = addPaths();
analysisName = 'analysis01D';
% load results
[results, environments] = loadResults();
% remove environment E be... |
27ee441b1cc041878b466679898db7ae244ded49807de56f1fee730abab24b06 | MATLAB | 7,294 | 162 | %% h = sepia_handle_panel_utility_manage_dependency(hParent,hFig,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 ... |
271a98a50bbb48e77f3bfe89382fbec230a9d55bd4d14b8f442772faa5ce28f5 | MATLAB | 7,298 | 256 | function [traj, infStates] = tapas_hgf(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_hgf(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in native space;
%
% (2) t... |
5f6f030caf5b69fe3d670c5e7cc5c34d9bd0cd9f53fae8b68543d541bdfb1642 | MATLAB | 7,304 | 195 | function EncodingWindowAnalysis = DARegressionAnalysis_CG(ratlist,...
times_resampled, rebin_size, Alignments, BestFits, Bstruct, Pstruct)
RPEs_over_rats = cell(length(ratlist), 1);
RPEs_last = cell(length(ratlist), 1);
lasttrialnums = -20:1:-1;
%get RPEs from photometry rats, last 20 trials
for rat = 1:length(rat... |
d95a9f8b7912321bb6d2fa5698f30be0974dbabc70147b9fd335727d5f2ebec9 | MATLAB | 7,311 | 196 | function imdb = cnn_imagenet_setup_data(varargin)
% CNN_IMAGENET_SETUP_DATA Initialize ImageNet ILSVRC CLS-LOC challenge data
% This function creates an IMDB structure pointing to a local copy
% of the ILSVRC CLS-LOC data.
%
% The ILSVRC data ships in several TAR archives that can be
% obtained from the IL... |
f684d184c83aa19e05fb0801d7f13ede8e7a4d3882efc33aa53c24f24737cde5 | MATLAB | 7,312 | 228 | function sx = gen_fisher_info_spikes(fr, T, F1, F2, NI, sigma_n, tau_n, ConPerc)
% GENERATE_FISHER_INFO_SPIKES - Generate spikes for Fisher information analysis
%
% H1 Line: Create spike trains with ON/OFF structure and contrast modulation
%
% Syntax:
% sx = generate_fisher_info_spikes(fr, T, F1, F2, NI, sigma_n, tau... |
785be27c0d5015b4dc092af328706ba9ca3f7d8c9cd35dba9f9d1dad173675bd | MATLAB | 7,313 | 176 | function PlotOrderedRipplePETH(varargin)
%PlotOrderedRipplePETH - Compute an event-triggered PETH where ripples are
% sorted according to their timing relative to a third event (e.g. delta waves).
%
% This function is useful to check, for example, the cortical responses to
% ripples and how they depend on ripple-delt... |
7f6896e9f17c3ef3409b2753f5a1db20acbd29fc6595dc6fdda743dcd4567a8b | MATLAB | 7,315 | 173 | % plot accuracies
%reads the excel sheet "behav Accu" which contains the behav accu
%subject-wise for all the tasks
% NOTE THE ORDER OF SUBJECTS IN ALL THE TABLES
subList ={'001','002','003','004','005','006','007','008',...
'009','010','011',...
'013','014','015','016','017',...
... |
2f5fccd7a75ee9292c1194db20097fa3d0472d95ae6c8b27124d361da1db5c77 | MATLAB | 7,319 | 176 | classdef MrSeries < MrCopyData
% Class of MR Time Series analysis(4D = spatial coordinates:x,y,z, and time)
%
% TODO: Revert all MrImageSpm4D properties to MrImage, once methods are made
% nD-compatible
%
% EXAMPLE
% MrSeries
%
% See also
% Author: Saskia Klein ... |
1e92ab31e03f4cc0e27d71801438a20d2ce9d2901e2abaa607a727327f36a53f | MATLAB | 7,320 | 187 | % STD_INTERP - interpolate, if needed, a list of named data channels
% for all datasets included in a STUDY. Currently assumes
% that all channels have uniform locations across datasets.
%
% Usage: >> [STUDY ALLEEG] = std_interp(STUDY, ALLEEG, chans, method);
%
% Inputs:
% STUDY... |
fe498cab008075f8398469a6dc2bb63f7532799ab197d153869e1f9f44ee16b2 | MATLAB | 7,322 | 222 | %% FeatureImporatanceMainScript
% Main script for feature important analysis
%% Create `Unit` table which contains all information for each unit
ClassifyUnits;
clearvars -except Unit
px2cm = 0.169;
%% Feature Importance - Fine Distance Regressor
% For main analysis, I have use `sync_Fixed_June`.
% However for analy... |
b2a4bd7f2f95e8e354a9d672b2d0bf942df8582ffa9e18257a856ed037b96190 | MATLAB | 7,323 | 179 | classdef meta_dataset
% Define a meta-analysis dataset object for classification analyses
%
% Properties:
% ---------------------------------------------------------------
% dat Data; sparse logical
% connames cell array of contrast names
% volInfo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.