sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
aaa7385a4bd0adaaad7ef108d4d09693c283840b98528be9db89bb0ef898ff86 | MATLAB | 4,040 | 155 | function nsdfaceprffinish(subjix,p,q,rr,hhs,mtodo,wantsavedata)
% function nsdfaceprffinish(subjix,p,q,rr,hhs,mtodo,wantsavedata)
%
% For subject <subjix>, model <p>, version <q>, resampling <rr>, and <hhs> vector...
% inputs
if ~exist('mtodo','var') || isempty(mtodo)
mtodo = 3;
end
if ~exist('wantsavedata','var') ... |
d2df454947d45e0811bcc6a794000bc00a9ba5a5376a5826439e98df889570ef | MATLAB | 4,040 | 165 | function filename = cine(this, varargin)
% Saves video of multidimensional dataset to an avi-file
% TODO: make it work with any plot-function and slider4D-save option
%
%
% Y = MrImage()
% Y.cine(inputs)
%
% This is a method of class MrImage.
%
% IN
% given as property name/value pairs:
%
% movieFormat ... |
925ff07c507f860057cef8f2ec72ec5095bda5d3efd84a36e57defadbb5b563d | MATLAB | 4,042 | 96 | % readneurodat() - read neuroscan location file (.dat)
%
% Usage:
% >> [ CHANLOCS labels theta theta ] = readneurodat( filename );
%
% Inputs:
% filename - file name or matlab cell array { names x_coord y_coord }
%
% Outputs:
% CHANLOCS - [structure] EEGLAB channel location data structure. See
% ... |
a50ca13fa78b6734e14c085ac01416ceb09e3c43281a01bead5103bf7834ac6f | MATLAB | 4,042 | 78 | %GENERATE_ALL_DATASETS
%
% Note: This script will generate 4800 datasets of surrogate calcium
% fluorescence activity, which were analysed in the corresponding paper.
% On a single desktop computer this may take several days or rather weeks
% and will require about 350GB of disk space.
%
%
% === Jan Moelter, The Univ... |
27e10e74804f1a6ee4b084fa2872ad52875493ad0bec1de4029e07f313d0b747 | MATLAB | 4,043 | 67 | function [dlc_vars,chamber_names] = set_dlc_vars(behav_type)
% set dlc variables depending on the session type
% will be used to parse csv columns
% need to be exactly the same as DLC config file
dlc_vars = {};
switch behav_type
case 'threechamber'
dlc_vars = {'snout', 'leftear','rightear','tailbase'... |
7eee311fb0446a3425a12e6789ce6fcf5da06ef1c815b287420eba65a533bc09 | MATLAB | 4,043 | 155 | function [ subject ] = nmri_qcplot_power_sensor(subject, data, params, title_txt)
%[ subject ] = nmri_qcplot_power_sensor(subject, data, params, title_txt)
%
% Generates a QC plot for power at sensor space
%
%
% subject = subject structure, see nmri_read_subject
% could be a struct or .m file or .m... |
18c39a05fcbac088eb7def68e9be509d4a096b2b79db78060bc296538fd891e0 | MATLAB | 4,044 | 110 | function ch2roi_plot_selFreq(GRUP, groupInfo)
% groups channels into defined ROIs (anatomic areas), averages & plots
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected freq. band
% - significance (difference of conditions, from baseline (TO DO), or all)
% settings (subjects, di... |
2b545a4d86835500ed9202ca32dbf24766875e402301d4fd5de961b8d8fceff4 | MATLAB | 4,044 | 90 | classdef MrLinkPlotOptions
% This is a predefined options/parameter structure for MrImage.plot('linkOptions', outputStruct)
%
% outputStruct = MrLinkPlotOptions(input)
%
%
% See also MrImage.plot
% Author: Saskia Bollmann & Lars Kasper
% Created: 2019-01-05
% Copyright (C) 2019 Institute for Biomedical Enginee... |
67bcfbc36c2c90ebc23554cc93392c581f5f07a7f1e098bcd7f9386df2ad17c1 | MATLAB | 4,045 | 92 | function hTrace = drawTrace(hA, data, config, hTrace)
% data is arranged in a 4D array with the first dimension being the number
% of frames to plot, the second being the number of trace groupings, the
% third being the XY or XYZ values, and the fourth being the number of
% traces
dataSize = size(data);
% fprintf('dat... |
6df0419a2b5a8bd859753ba5310d6a890e7e47e3aa8e5444800a0ab5807c1742 | MATLAB | 4,045 | 110 | function dists = eucl(crds1,crds2)
% EUCL: Calculates the euclidean distances among a set of points, or between a
% reference point and a set of points, or among all possible pairs of two
% sets of points, in P dimensions. Returns a single distance for two points.
%
% Syntax: dists = eucl(crds1,crds2)... |
fc1276d72c0517425bdb0be9700d72f5e4b1a72eb639a831030d39c2df02b59a | MATLAB | 4,046 | 105 | function [stop, reason] = stoppingcriterion(problem, x, options, info, last)
% Checks for standard stopping criteria, as a helper to solvers.
%
% function [stop, reason] = stoppingcriterion(problem, x, options, info, last)
%
% Executes standard stopping criterion checks, based on what is defined in
% the info(last) sta... |
3617cbdcd0fccfa78512ff928e24ba0e2034e379dcbf7c0b273bf3ef78372e63 | MATLAB | 4,047 | 91 | %VL_TMOVE Utility to move tensors across GPUs
% VL_TMOVE() is the point of entry to MatConvNet's subsystem for
% moving efficiently tensors across GPUs and MATLAB
% processes. Currently it is only supported in Linux and macOS.
%
% The system works by allocating a number of tensors, as specified
% by the argu... |
7f9ccac1600b6c1c779db5b7093e3264897dfa7cca35b23e2101e0e4afb51365 | MATLAB | 4,048 | 128 | function plotNetworkBursts(spikeTimes, Ephys, Info, Params, figFolder, oneFigureHandle)
%PLOTNETWORKBURSTS Plots single file burst detection result
% Detailed explanation goes here
% spikeTimes : struct
% figFolder : directory
% oneFigureHandle : matlab figure object
% Set figure size
set(gcf, 'Position', [100, 10... |
e2949088c2adbe823c17c7aaf60cad4c9d7230927a70e7e2f06cb7fd1ff3b77f | MATLAB | 4,049 | 129 | function this = write_nifti_analyze(this, filename, dataType)
% saves MrImage to nifti/analyze file depending on file extension
% (.nii/.img)
%
% Y = MrImage(origFileName);
% Y.write_nifti_analyze(newFileName)
%
% This is a method of class MrImage.
%
% IN
% fileName string of file identifier to save to; if not... |
ec632692401002c24ac3fb8e375ecb2f1501a10f0ac001ea9e3db8198b820b66 | MATLAB | 4,051 | 105 | %{
rf.Locate (imported) # my newest table
-> rf.Sync
-----
response_map :longblob # map of response amplitudes on the screen
x_map :longblob # map of screen locations in brain pixels
y_map :longblob # map of screen locations in brain pixels
%}
classdef Locate < dj.Relvar & dj.AutoPopulate
properties
... |
70baa6ae19ffb958c1eb43d130a72a9b2de45b74c9022a98e6ef26e41b5394c8 | MATLAB | 4,052 | 95 | % PLUGIN_ASKINSTALL - install EEGLAB plugin from a GUI or command line
% call.
% Usage:
% plugin_askinstall(pluginName, pluginFunc, force);
%
% Inputs:
% pluginName - [string] name of the plugin
% pluginFunc - [string] function belonging to the plugin
% force - [boolean] force install (e... |
8759bb47e7ccdf06efd5579ee5e97cc9ebeff2309dd935e282465f027ce64425 | MATLAB | 4,052 | 170 | function [movie_out, movie_sparse, info] = LOSSDenoising(movie_in, varargin)
% [X, S, Info] = LOSSDenoising(Y, options)
% Video denoising by Learning rObust SubSpace (LOSS)
%
% Syntax:
% movie_out = LOSSDenoising(movie_in); % automatically determine the rank
% movie_out = LOSSDenoising(movie_in, 'options', options); % ... |
a63f8aad320c133726d0949a7ad27a38f945fbfb94ce2a9a6080c8dbadc1603a | MATLAB | 4,055 | 104 | function [version] = hasyokogawa(desired)
% HASYOKOGAWA tests whether the data input toolbox for MEG systems by
% Yokogawa (www.yokogawa.com, designed by KIT/EagleTechnology) is
% installed. Only the newest version of the toolbox is accepted.
%
% Use as
% string = hasyokogawa;
% which returns a string describing th... |
c9b8d4b27c43809ee0161f75b3d4bdb49cb5995a470e5f1f2df326cf6234512f | MATLAB | 4,057 | 103 | function realignedImage = apply_realign(this, rp, varargin)
% applies realignment parameters from other estimation to this 4D Image
%
% Y = MrImageSpm4D()
% rY = Y.apply_realign(rp, 'interpolation',7, 'masking', 1, 'wrapping', [0 0 0])
%
% This is a method of class MrImageSpm4D.
%
% IN
% rp [nVolumes,6] realignm... |
817f9fdc65e0473a0045a1a197482c1e7caacc78a5b17da9bbd2f76de2c53dab | MATLAB | 4,059 | 111 | function smoothhist2D(X,lambda,nbins,outliercutoff,plottype)
% SMOOTHHIST2D Plot a smoothed histogram of bivariate data.
% SMOOTHHIST2D(X,LAMBDA,NBINS) plots a smoothed histogram of the bivariate
% data in the N-by-2 matrix X. Rows of X correspond to observations. The
% first column of X corresponds to the ... |
5fec592a20cc2996fa2755538b72a5f7259fb0849157e42701cbcc2970fecc9c | MATLAB | 4,060 | 121 | highlevelvisual ROI.. this was quick and dirty ROI definition.
roilabels = {'posterior' 'anterior' 'V1' 'V2' 'V3'};
==================== PLOT THE BRAIN MAP FOR ROIs
cd '/research/papers/2022 nsd/figures/SCIENCE.RSA'
vals = cvnloadmgz('*.highlevelvisual.mgz');
Lookup = [];
eo = {'hemibordercolor' 'w' 'rgbnan' 1 'dr... |
28e198d90f78182db883c245d4a646be9ba32ee2be979cb5f281adf5c93c96b5 | MATLAB | 4,062 | 134 | function des2dke(inDir)
% DES2DKE Convert designer output to DKE inputs
% DES2DKE('input directory') creates a folder called 'DKE' within
% Designer's output folder and prepares all files for DKE. It modifies
% DWIs, BVALs and BVECs to ensure compatibility with DKE.
%
% All B0s in DWIs in removed and Designer'... |
4f9a7bb0493e6749c4c5ac22b4bc9499066beb9d9d759eae49d933cf72451f28 | MATLAB | 4,062 | 96 | function batchProcessSpikesFromStim(ExpName, Params)
spikeDetectionFolder = fullfile(Params.outputDataFolder, ...
Params.outputDataFolderName, '1_SpikeDetection', '1A_SpikeDetectedData');
for expIdx = 1:length(ExpName)
% temp hard-coded things
Params.removeSpikesFromStimElec =... |
61533547229a235a9ec2ba72f730a87c0575f1042dd6dae8cc39b7249c07eb73 | MATLAB | 4,063 | 118 | function gradfun = approxgradientFD(problem, options)
% Gradient approx. fnctn handle based on finite differences of the cost.
%
% function gradfun = approxgradientFD(problem)
% function gradfun = approxgradientFD(problem, options)
%
% Input:
%
% A Manopt problem structure (already containing the manifold and enough
% ... |
b137372b762e980c11c66e2a50d049577396f439b3f7979f4a29a2102d892e5f | MATLAB | 4,063 | 113 | function run_permumanova1_examples
%RUN_PERMUMANOVA1_EXAMPLES Run permutation-based one-way MANOVA examples.
% Generates random multivariate data for 3 groups along the rows of X. X
% contains 20 sets of dependent variables (2 dimensions per set). The
% groups have identical multivariate means of 0 for most vari... |
89455e1ac063d010c6b12157db3f938a6c16413883e87be1b27f5f503f630f7c | MATLAB | 4,064 | 119 | function [output,status] = plugin_urlread(urlChar,method,params)
%URLREAD Returns the contents of a URL as a string.
% S = URLREAD('URL') reads the content at a URL into a string, S. If the
% server returns binary data, the string will contain garbage.
%
% S = URLREAD('URL','method',PARAMS) passes information to... |
df10cf105d459162901ca970a907f3c0d54ce0badd338ab84b3e0c3cb06b6f0d | MATLAB | 4,065 | 132 | function [ all_metrics_fs_lh, all_metrics_fs_rh ] = nmri_map2fsaverage( all_subjects, all_metrics )
%[ all_metrics_fs_lh, all_metrics_fs_rh ] = nmri_map2fsaverage( all_subjects, all_metrics )
% will transform any number of metric (cell array) to fsaverage
% Freesurfer defaults
suma_dir='/data/freesurfer/6.0.0/fsaver... |
660d2be051752d6f4123586fa5895d051d18ed1e6c7a83104385e920b50e56ee | MATLAB | 4,069 | 97 | % EEG_TIMEINTERP - perform spline interpolation of a portion
% of data based on prior and post activity. See
% EEG_INTERP for interpolation of bad channels.
%
% Usage:
% >> OUTEEG = eeg_timeinterp( INEEG, samples, 'key', 'val');
%
% Inputs:
% INEEG - input EEG structure
%... |
6bd24efc55a274630588312cc0e4ae74b1a492fa612fe42bf1a902dd9ba0a55a | MATLAB | 4,070 | 94 | function ft_biopac_regressor(input, biopac_input, path_output, TR)
% Get biopac regressor
%
% ft_biopac_regressor(input, biopac_input, path_output, TR)
%
% Inputs:
% input - input time series
% biopac_input - biopac *.mat file.
% path_output - path where output is saved.
% TR - repetition time... |
7d512aa5b3730bcfdb9c69288e46b146402a79b9e12e62c5e7cd185ccb2a63a1 | MATLAB | 4,071 | 118 | %% the preprocessing of data for all-ofc MLB decoding.
% so that actual fitting can run on torch
%
%savedir = '/Users/dhocker/projects/dynamics/data/maggie/';
%savename = strcat(savedir,'preprocess_second_mlb_alldat_allOFC_quantile_psthsubtract.mat');
function [] = run_preprocess_decode_mlb_allofc(savename, epoch, ... |
8a9bd49d6c45f471d8593ff70aeb5d34929561a85f1250f539f06db1d8d95cd0 | MATLAB | 4,072 | 160 | function runPCAICA(h5Path,Fs,varargin)
%% OPTIONS
% options.windowsize=2000;
% options.dataset='mov';
options.diary=true;
options.plotFigure=true;
options.diary_name='diary';
options.verbose=true;
options.frameRange=[];
%% UPDATE OPTIONS
if nargin>=3
options=getOptions(options,varargin);
end
%% GET SUMMARY OUT... |
c22e154e395ac78fb97de1e4ca5de15fe22a2b53faa4236660c2375df070c15a | MATLAB | 4,072 | 87 | function nn = cnn_stn_cluttered_mnist_init(imsz, use_transformer)
% script to initialize a small spatial transformer networl
% for cluttered MNIST:
% init the object:
nn = dagnn.DagNN();
if use_transformer
% ************************** localization network ****************************
l_mp1 = dagnn.Pooli... |
d80c0dad9cc551da797d2e2b193cb4631251e8e6c9b017e89b95f3849c3856ce | MATLAB | 4,074 | 132 | function [ama] = loadama(filename)
% LOADAMA read an inverted A-matrix and associated geometry information
% from an ama file that was written by Tom Oostendorp's DIPOLI
%
% Use as
% [ama] = loadama(filename)
%
% See also LOADTRI, LOADMAT
% Copyright (C) 2005, Robert Oostenveld
% Copyright (C) 2021, Thom Oostendorp... |
d5d08c54d1609dc26160bee3dbfba52da8d95a9c0b62f4170f8d6020ba511da4 | MATLAB | 4,075 | 154 | close all
clear all
clc
% simulate 10 x 10 box
global gridscale thresh
is_save = false;
saving_folder = 'C:\Users\User\Documents\fMRI_EXP\cells_data_muller\wetransfer_neil-s-data_2023-09-25_1057';
thresh = 0.25;
gridscale_all = [4, 3, 2, 5];
phase_env12 = [pi/2, pi/3, 0, pi/4; pi/4, pi/5, pi/3, pi/6];
shift_x_env12 ... |
df79bbad1bf90a412995731dc650cf0fdd5f35ca0e3813df3a0fd96693e392ee | MATLAB | 4,075 | 92 | %VL_TMOVE Utility to move tensors across GPUs
% VL_TMOVE() is the point of entry to MatConvNet's subsystem for
% moving efficiently tensors across GPUs and MATLAB
% processes. Currently it is only supported in Linux and macOS.
%
% The system works by allocating a number of tensors, as specified
% by the argu... |
4a05638fff05a4d3c38be5358b02ea0f8c438aa861b0613f495a6ec9a6a7471e | MATLAB | 4,076 | 112 | % EEG_READOPTIONS - Read EEGLAB memory options file (eeg_options) into a
% structure variable (opt).
%
% Usage:
% [ header, opt ] = eeg_readoptions( filename, opt );
%
% Input:
% filename - [string] name of the option file
% opt - [struct] option structure containing backup values
%... |
971d319516b1212b0f7e3f3c34ee44445a540fda190cc17ecf4262eb0f61f36c | MATLAB | 4,078 | 163 | % ________________________________________________________________________%
%
% Breathing Learning Task (BLT)
%
% Originally coded: May 2018 by F.H. Petzschner and O.K. Harrison
% Contact: O.K. Harrison (faull@biomed.ee.ethz.ch)
%
% ________________________________________________________________________%
% Info: This ... |
292a9599acac9bf6ecc5441277637821c24110da23fdb777da355d4349dba63b | MATLAB | 4,080 | 129 | % op_mergesubspec.m
% Helge Zoellner, Johns Hopkins University 2021.
%
% USAGE:
% out=op_mergeextra(varargin);
%
% DESCRIPTION:
% Merges input into the extra dimension
%
% INPUTS:
% varargin = input data in matlab structure format.
%
% OUTPUTS:
% out = Output dataset with merged subspectra
function out=op_me... |
a2d158a1712697331bb278b4e64fa9caccf98eb8f6064882a351b69c53ebc7c2 | MATLAB | 4,080 | 105 | function tapas_hgf_binary_plotTraj(r)
% Plots the estimated or generated trajectories for the binary HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_binary_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Co... |
c896b3f4ff00b89f7db1f3a10566b1dbf6f8baad03dafa886c0bda950d34ef4f | MATLAB | 4,080 | 130 | function [info_h5,summary]=h5append(filename,movie,varargin)
% HELP
% Append (or create) h5 file dataset with movie chunks. For other data datatypes use (compatible) 'h5save'.
% SYNTAX
%[info,summary]= h5append(filename,movie)
%[info,summary]= h5append(filename,movie,dataset)
%[info,summary]= h5append(filename,movie,... |
61bb2972faf81749f1b03d5e80e2f484ed0d048a755bd80669180a6cf6193e76 | MATLAB | 4,081 | 105 | function tapas_ehgf_binary_plotTraj(r)
% Plots the estimated or generated trajectories for the binary HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_binary_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% C... |
cc2de3b91fec0dbac6f5e0b236433e81c56f3124a81db1a237df9819e4db4c50 | MATLAB | 4,081 | 124 | %% SMWIIOWrapper(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: deprecate... |
ec4f085c56bcd28f56f9764abd841194e394d0bdf188cb9fe1cd50cf553c7487 | MATLAB | 4,082 | 142 | function plot_fig3g_left(datadir)
% Plot dopamine AUC at the reward cue (0-0.5 s) and model predicted RPE
% regressed against reward delays in the last 15 trials during mixed
% blocks. For visualization, only 7 trials back are shown. N = 10 rats.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to d... |
20d6a4b1bca3a6a73c6c0c8673147ac94a3aeab93727330428edd4bc94fbb534 | MATLAB | 4,083 | 100 | function [W, Gss, Gds, Hds] = ...
spherical_interpolate(src, dest, lambda, order, type, tol)
% Caclulate an interpolation matrix for spherical interpolation
%
% W = sphericalSplineInterpolate(src, dest, lambda, order, type, tol)
%
% Inputs:
% src - [3 x N] old electrode positions
% dest - [3 x M] new electr... |
864c5223c10ea8fb83d71d11df055c5716994e2769efb951d1cab16ed43fb05d | MATLAB | 4,083 | 103 | function statMrImage = compute_stat_image(this, statImageType, varargin)
% wrapper for computing different statistical images (taken over time series)
% while retaining image geometry information
%
% Y = MrImage()
% statMrImage = Y.compute_stat_image(statImageType, ...
% 'Prope... |
51fe7ffd1a9ff56fb2a99c4b79bf6e35d2aed26e2c5aa2b48b1b4eff22fe7833 | MATLAB | 4,084 | 152 | function [options]=genReadme(varargin)
% EXAMPLE USE WITH ARGUMENTS
%[options]= genReadme() - use 1
%[options]= genReadme(readme_suffix) - use 2, etc.
%[options]= genReadme(readme_suffix,folderpath) - use 3 with options
%[options]= genReadme(readme_suffix,folderpath,options) - use 3 with options
%
% HELP
% Generating r... |
8898a4c59287aa1ba6ee253dc274d20f294b44d4ff595222e378fc93b0986d15 | MATLAB | 4,085 | 78 | function [post nloo dnloo loo] = infLOO(hyp, mean, cov, lik, x, y)
% Leave-One-Out - Perform Least-Squares GP predictions in the style of the
% Pseudo Likelihood in 5.4.2 p. 117 and the Probabilistic Least-squares
% Classifier of 6.5 p. 146 of the GPML book.
% For Gaussian likelihood, the prediction is the same as ... |
da90972be4442c9837b118794368c37361f51d80df443671ff1089c837e56e79 | MATLAB | 4,085 | 120 | % READELP - read electrode locations from an .elp (electrode positions)
% file as generated, for example, by a Polhemus tracking device
% Usage:
% >> [eloc, elocnames, X, Y, Z] = readelp(filename);
%
% Inputs:
% filename - name of the .elp file containing cartesian (XYZ) electrode
% locati... |
e146c433305a7ba1014d45cda015fc0445c865a12c67298fe6cc6231cb73f144 | MATLAB | 4,085 | 114 | clear all
close all
addpath(genpath('/home/degutis/repos/spm'));
spm('Defaults','fmri'); % Initialize SPM
spm_jobman('initcfg'); % Initialize job manager
TR = 3.29; %3.22;
subject = 'sub-LAM026'
funcDir = fullfile('/media','miplab-nas2','Data','Karolis','huppi_high_res_resting','derivatives','func',subject);
fun... |
5196e3e1273d0817ba7d6df1d622549246e3563e3ebaa8bd90b5435c26b99819 | MATLAB | 4,088 | 97 | function Z = cal_Z_a(M0, mm, nn, A3, A6, Matrix, b, w1, K2_MT, w, npools, offset, step_size, lineshape)
Zm = zeros(size(M0)); % Xingwang Yong, 20210512, for codegen
% Rrfc = (unique_omega_1(omega_iter))^2*lineshape_mn;
% if unique_omega_1(omega_iter)==0
% A = [-R_2a, -0 , ... |
0b2956a8b01ba39e71082549516d602fb9ef655473e6cd0904e84fb1120d65d9 | MATLAB | 4,089 | 120 | function fear_shockTrigTripleAct_optMeanShift(basename,varargin)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
% basename='~/data/Fear/triple/booyah180430/booyah180430';
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName... |
e26cbb9a07e4533f5066a4bcb1f02a97dd157e3ec1d6445808a52e32b12703e3 | MATLAB | 4,090 | 119 | function Dij = TS_PairwiseDist(tsOrOps,whatData,distanceMetric,doSave)
% TS_PairwiseDist Pairwise distances between either TimeSeries or Operations
%
% (If doSave), stores pairwise distances back the data back in the local .mat
% file. Warning: this can be huge for large datasets.
%
%---INPUTS:
%
% tsOrOps: Compute p... |
209afd659290d909296d233596b9f46efe118d9022885ab14db749cc8c185ff8 | MATLAB | 4,094 | 99 | %{
aodpre.ComputeTraces (computed) # traces used for spike extraction
-> aodpre.Set
-> aodpre.PreprocessMethod
-----
%}
classdef ComputeTraces < dj.Relvar & dj.AutoPopulate
properties
popRel = aodpre.Set*aodpre.PreprocessMethod
end
methods(Access=protected)
function make... |
a1d5bceae04eb05b81f6bf67fb07bc5c946ded364d1d50ec66c341cb450155ec | MATLAB | 4,095 | 118 | function dPrime_Histograms(IT_Fam_VE,HC_Fam_VE,IT_Fam_FR,HC_Fam_FR)
%dPrime_Histograms
%{
This function plots histograms of dprime values for all procData files.
Unit d’ was calculated, as the difference between the mean response that
a unit had to a presented novel image compared to the mean response to the
same im... |
cecf5fb6bfce5a1c10ac7679084de5f3cdc0bc04eab6d5f739b947dcfb0fdec6 | MATLAB | 4,095 | 107 | function axislabel_translation(h_a,trans_pnt,trans_vec,trans_units)
% This function moves axis labels to a proper distance from the axes. It is
% called by function 'align_axislabels', which first, rotates the x, y and
% z labels.
% If you just want to move the labels but not rotate them, you have to
% specify t... |
8c0e561569e83d03165053edc2de8d074eb1dc839c970284b37a19b2a6958342 | MATLAB | 4,096 | 164 | % [parcels, SVDinfo, parcel_stats] = Meta_Parcel(MC_Setup, varargin)
%
% documentation goes here.
%
%
% Example: use your own analysis mask:
% [parcels, SVDinfo, parcel_stats] = Meta_Parcel(MC_Setup, 'analysis_mask_name', 'acc_roi_mask.img');
function [parcels, SVDinfo, parcel_stats] = Meta_Parcel(MC_Setup, varargin)
... |
3d6bfff59d15576d51d0878fcf91eed5746017509c24ac455329963c99775e64 | MATLAB | 4,099 | 94 | function ft_biopac_regressor(input, biopac_input, path_output, TR)
% Get biopac regressor
%
% ft_biopac_regressor(input, biopac_input, path_output, TR)
%
% Inputs:
% input - input time series
% biopac_input - biopac *.mat file.
% path_output - path where output is saved.
% TR - repetition time... |
052d113861fa6befad7e61647d269aae5488e74bcd8b5e095477d9f54f13f5c8 | MATLAB | 4,100 | 89 | % This MATLAB script can be used to reproduce the hemodynamic response in dataset C (Figure 11)
% Please download BBCItoolbox to 'MyToolboxDir'
% Please download dataset to 'NirsMyDataDir' and 'EegMyDataDir'
% The authors would be grateful if published reports of research using this code
% (or a modified version, maint... |
081b65cae743a1229e69072031cc9138d3311c624d3e43d2f647b21056c8ec99 | MATLAB | 4,100 | 122 | function plot_fig3f(datadir)
% Plot simulated value and trial initiation time from delay-modulated
% RPE model (left) and block-average trial initiation times overlaid with
% rat data (right).
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
% These model hyper... |
607c6d3b42f6c099cdbdfad879cbbcd90964ac1556d763b31d83e1ebe449ce1b | MATLAB | 4,100 | 108 | function [meanChans, meanSNR] = pruneGetVals(params, varargin)
% prePPrune - Prune fNIRS data for the BRIGHT study, storing key metrics
% for analysis.
%
% =========================================================================
%
% params: provide data locations and distinguish data populat... |
05348dfa78616fb53d9ec4556e076395d2b09b25fc8cfa47d860ac622fbebc1c | MATLAB | 4,101 | 144 | function [p,stats,qq,dmstd]=quantreg(x,y,tau,order,Nboot);
% Quantile Regression
%
% USAGE: [p,stats]=quantreg(x,y,tau,[order,nboot]);
%
% INPUTS:
% x,y: data that is fitted. (x and y should be columns)
% Note: that if x is a matrix with several columns then multiple
% linear regression is us... |
311335ff803f2b989610afaee082c00e9401b4c72668f1e63bd33c82ac617fa1 | MATLAB | 4,102 | 112 | function out = WL_Coeffs(y, wname, level)
% WL_Coeffs Wavelet decomposition of the time series.
%
% Performs a wavelet decomposition of the time series using a given wavelet at a
% given level and returns a set of statistics on the coefficients obtained.
%
% Uses Matlab's Wavelet Toolbox.
%
% ---INPUTS:
% y, the in... |
17f16d68eba35e0403e5680ea9ea4f9e9a40198ad7d429932ec667733f2e30ba | MATLAB | 4,103 | 118 | function plot_fig3c(datadir)
% Plot simulated value and trial initiation time from volume-modulated
% RPE model (left) and block-average trial initiation times overlaid with
% rat data (right).
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
% These model hype... |
6e28a49022c0d7b68ac61192ea4c0fdc36703ff2913cd5b260a24cbc881eaf87 | MATLAB | 4,103 | 168 |
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,optTol,progTol,method,...
corrections,c1,c2,LS_init,cgSolve,qnUpdate,cgUpdate,initialHessType,...
HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,...
Damped,HvFunc,bbType,cycle,...
HessianIter,outputFcn,useMex,useNegCurv,precFunc... |
7199c992309d03eb41e91b02c1ed48f9d5b788785bfe7f9eb2239e0201f13d28 | MATLAB | 4,104 | 136 | function coactPaper_tableS04()
close all
height=9.6;
fontsize=6;
fh=initFig('width',18.6,'height',height,'font','Arial','fontsize',fontsize);
panel_01(7)
drawnow()
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS04_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','-r300')
end
function panel_01(fs)
r... |
aa5ad5d07c28ccb39e2aa2ff09026e31b4787e657a1d25bfa5b670dbad801c6e | MATLAB | 4,104 | 107 | function [MRSCont] = LCModelWrapper(MRSCont,kk,progressText)
%% [MRSCont] = LCModelWrapper(MRSCont)
% This function performs spectral fitting in LCModel.
%
% USAGE:
% [MRSCont] = osp_fitUnEdited(MRSCont, basisSet);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
% basisSet = Osprey bas... |
7a8cbe44acb76f6ccb154d637326f05d05f29fd6385a7d2301e515f37444724d | MATLAB | 4,105 | 102 | % VARSORT - reorder ICA components, largest to smallest, by
% the size of their MEAN projected variance
% across all time points
% Usage:
% >> [windex,meanvar] = varsort(activations,weights,sphere);
%
% Inputs:
% activations = (chans,framestot) the RUNICA activations
% weights = ica ... |
9e7bf9cd8dec6817bbbf866b499156f32ab197d84205948932c889104aff39a1 | MATLAB | 4,107 | 120 | % GABOR2D - generate a two-dimensional gabor matrice.
%
% Usage:
% >> [ matrix ] = gabor2d(rows, columns);
% >> [ matrix ] = gabor2d( rows, columns, freq, ...
% angle, sigmaR, sigmaC, meanR, meanC, dephase, cut)
% Example :
% >> imagesc(gabor2d( 50, 50))
%
% Inputs:
% rows - num... |
a707b54041441ba3e514473c9b581da778caa5d6cfb199a108eda136b59f2c82 | MATLAB | 4,107 | 125 | function this = read_cpx(this, filename, selectedVolumes, selectedCoils, ...
signalPart)
% loads Philips cpx files (coil-wise image reconstructions) using GyroTools
% code (read_mr_data, read_cpx)
%
% Y = MrImage()
% Y.load_cpx(filename, selectedVolumes, selectedCoils)
%
% This is a method of class MrImage.
%
%... |
7dbf27c5dc94b66152b3578f62bacff468780c189b78e567855172497a2cee45 | MATLAB | 4,108 | 133 | % this script loads runmetrics.mat and makes a gigantic visualization of them.
% load
a1 = load('~/nsd/nsddata/information/runmetrics.mat');
% define
nsess = [40 40 32 30 40 32 40 30];
% compute mean/median across runs in each session
metrics = NaN*zeros(8,40,6);
for mm=1:6
if mm==6 % re-compute easy trials
... |
995956537740c40aac3f9ba2bd49ed5c2dff8701609616071d1d348ae346652f | MATLAB | 4,109 | 117 | function [] = plotAnalysis01A(saveFigures)
% Produces plots to visualize the results of analysis01A.
% save figures by default
if nargin==0
saveFigures = true;
end
% get file paths
paths = addPaths();
analysisName = 'analysis01A';
% load evolved populations
% struct: populations.(Ctype).(Env).(optimisedFor = {'... |
db9fa1ff532f3873bc960fcf47f98f6d1cc7ca39f79498b0452566a273486e6b | MATLAB | 4,110 | 111 | %% single trials: spectra + raw
% - load trials
% - select channels
% - compute STFT -> spectra
% (c) Jiri, Feb24
%% settings
subjTag = '20_PR11';
selected_channels = {'Rd1-Rd2', 'Ld6-Ld7'};
pathBeg = 'F:\dox\ms_switch_EI\data\v31_stft_session_bip\switchin_EI_IE_bip';
P_level = 0.05;
%% get job-related settings -> p... |
76a3e89a0186ebb22e13f03468c775b2432e15d4b56c858c001f66886411bd49 | MATLAB | 4,112 | 125 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells according to their
% phase. grid cells with closer phases are averaged within the same voxels.
exp_root = 'C:\Users\User\Documents\fMRI_EXP\';
more_code = fullfile(exp_root, 'c... |
875f705bd1a41fbf7d0407a0fd2d657414341a87650eca31ad5af1eec453e3fc | MATLAB | 4,112 | 122 | % fitVoxels
% Fits pSFT parameters to each voxel
%
% Input Arguments
% chunk – structure of chunked data (see estimatePSFT)
% I – matrix of input spatial frequency time series [time x 1]
% p – structure of parameters (see estimatePSFT)
% toggles – structure of toggles (see estimatePSFT)
%
% ... |
db60abbbe849e70f8345a971d2a08e3ea15d3362e84cfd73680d32dedd1edf3d | MATLAB | 4,115 | 92 | function autoqc_glm_nsd(sessix,glmdirname)
% setup
nsdsetup;
datadir = datadirs{sessix};
glmdir = regexprep(datadir,'rawdata',glmdirname);
ppdir = regexprep(datadir,'rawdata','ppdata');
outputdir = sprintf('%s/../%s-%s-glmBASIC',ppdir,nsdidfun(sessix),glmdirname);
% check
isspecial = 0;
if nsdscreeningfun(sessix)
s... |
0fdac82a4f93eb9a70fed403345e9d1c00379bd9b789c084474ed1bf59e82763 | MATLAB | 4,116 | 113 | function fh = tapas_physio_plot_movement_outliers_maxval(...
rp, quality_measures, censoring, censoring_threshold, verbose)
% Plots output figure of motion censoring based on maximum value for
% outliers of each
%
% fh = tapas_physio_plot_movement_outliers_maxval(...
% rp, quality_measures, censoring, censo... |
0182a95ee62f6bc7281af9eeff856ca7983f9bbcfc520d25da520b824b9cc73e | MATLAB | 4,117 | 159 | % Batch script for sparse prediction
clear all
% --- training method ID
method_id = 3;
% 1: linear_sparse_space
% 2: linear_sparse_space_vec
% 3: linear_sparse_stepwise
% 4: linear_sparse_stepwise_vec
% --- Basic Learning Parameters
parm.Ntrain = 1000; % # of total training iteration
parm.Nskip = 100; %... |
9392c0c580c04718d17b879bbfe6b249ce563275a82d54206ebc44e1ee634eef | MATLAB | 4,119 | 97 | function epochedY = split_epoch(this, onsetTrials, newPeriStimulusOnsets)
%Splits time series in epochs using onset trial times and desired bin times
%
% Y = MrDataNd()
% epochedY = Y.split_epoch(onsetTrials, newPeriStimulusOnsets)
%
% This is a method of class MrDataNd.
% It first shifts the time series of all vox... |
c0e6868dfca0c175e5d3b885e773326ba2161458661e6cdee25e97b091b30226 | MATLAB | 4,119 | 139 | function [ subject, data ] = nmri_artifactrejection_estimateICA(subject, data, params)
%[ subject, data ] = nmri_artifactrejection(subject, data, params)
%
% This is a non-interactive function to estimate the ICA (gridable)
%
%
% subject = subject structure, see nmri_read_subject
% could be a str... |
9c6378a64b1e0c0fec6e0390cfbe9f0ba3db6d8fcdd2539c5dfbbcaa085bda96 | MATLAB | 4,120 | 172 | %% Whole brain averages
load('../mean_dpte.mat') % Load data
addpath cbrewer
cmap=cbrewer('div','RdYlBu',11)
c1=cmap(4,:)*.9
c2=cmap(8,:)*.9
c3=cmap(9,:)*.9
figure;
subplot(311);hold on;
wdth = .5
% water-eeg|bold
calc_box(mw,1,c1,3,wdth,1,'-',1)
calc_box(mn1,2,c2,3,wdth,1,'-',1)
calc_box(mn2,3,c3,3,wdth,1,'-',1)
a... |
ad398d852e19376c494521ad93ce0fb6c3e577707e4dd2964d07a56b817df0be | MATLAB | 4,122 | 127 | function [b2s,s2b,x2ys]=surfing_reducemapping(x2y,ymask)
% simplifies a cell mapping
%
% [BIG2SMALL,SMALL2BIG,X2YSMALL]=SURFING_REDUCEMAPPING(X2Y[,MASK])
% INPUT:
% X2Y Nx1 cell, each with a vector with positive integers
% MASK optional mask indicating which integers in X2Y should be
% ... |
f2b7c1a62c3429003df2e6610e30f5011a7fc3d15f620bcc1165e1e7ae6ed8d7 | MATLAB | 4,122 | 130 | % fit_plotBasis.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% out = fit_plotBasis(basisSet, dim, stagFlag, ppmmin, ppmmax, xlab, ylab, figTitle)
%
% DESCRIPTION:
% Creates a figure showing all a basis functions in FID-A basis set struct
% (generated with fit_makeBasis).
%
% INPUTS:
% basisSet = ... |
d9b59a409688e6425076c30f287dc12f674988628326f1467bc2dcdb79876113 | MATLAB | 4,123 | 127 | function coactPaper_reported_values()
clear
ses=poolVar('sessions.events.mat','base');
slp=poolVar('sleepState.states.mat','base');
ratList=fieldnames(slp);
for idx=1:length(ratList)
rat=ratList{idx};
s=relabel_ma2sleep(slp.(rat).MECE.timestamps);
nrem=s(s(:,3)==3,1:2);
rem=s(s(:,3)==5,1:2);
for... |
f3c4c64b63f17db8ced71235cdcb98c324de3b44445973e7727062c204cf6e3a | MATLAB | 4,124 | 86 | %% create MT = part of hMT+ which is not MST
%this script create rois MT = part of hMT+ which is not MST
% it is important to use these masks so that we identify the clusters which are not connected to other regions
% hMT+: from visual Motion Localizer
% 1. open each individual subject
% 2. In each individual , op... |
475beaff0a80cacead2eb41e790585d01e8f2f9080c2430bfec04374e733e332 | MATLAB | 4,125 | 116 | function [K,dK] = covPeriodicNoDC(hyp, x, z)
% Stationary covariance function for a smooth periodic function, with period p:
%
% k(x,z) = sf^2 * [k0(pi*(x-z)/p) - f(ell)] / [1 - f(ell)]
% with k0(t) = exp( -2*sin^2(t)/ell^2 ) and f(ell) = \int 0..pi k0(t) dt.
%
% The constant (DC component) has been removed and... |
fcc26d77d9d237130238582cd23627edf4d9917a109c74013a846f60e9f713ee | MATLAB | 4,125 | 107 | function [K,dK,S] = covDot(mode, par, k, dk, hyp, x, z)
% Dot product-based covariance function. The covariance function is
% parameterized as:
%
% k(x,z) = k(s), s = dot(x,z) = x'*inv(P)*z
%
% where the matrix P is the metric.
%
% Parameters:
% 1) mode,par:
% We offer different modes (mode) with their respective par... |
94b2677dbf6c9ef10a24c43327e957fbe29c7fc944fed97ebec2dbd744ae6d54 | MATLAB | 4,129 | 106 | classdef MrDataNd < MrCopyData
% Class for n-dimensional data representation with dimensional information,
% selection, plotting and general unary and binary arithmetic operations
%
%
% EXAMPLE
% MrDataNd('test.nii');
% MrDataNd(dataMatrix, 'dimInfo', myDimInfo);
%
% See also M... |
9b35cdcf1890695ee0eb3cf624453054625eca4e0ece84f0cdb9967b5f480d6b | MATLAB | 4,129 | 126 | classdef suffix
% HELP
% Minimalistic non-handle class to manipulate addind/removing/checking
% suffixes of of file names
% HISTORY
% - 29-Jun-2020 18:25:51 - created by Radek Chrapkiewicz (radekch@stanford.edu)
properties
fpath
hassuffix
suff
end
properties (Constant)
s... |
235257724e1a01f5bf40ff5389772d7f4a82cc96f06c64ef9bccd5ee20105cd9 | MATLAB | 4,132 | 117 | function TrainPostHocDenoiser_Callback(hObject, eventdata, handles)
% This function trains a convolutional neural network to detected if
% identified sounds are USVs or Noise. To use this function, prepare call
% files by labelling negative samples as "Noise", and by accepting positive
% samples. This function produce... |
8a9d57e7555a3e8f2ccf6bb801ee78a408097263da55418a2bdf021660b0ddc9 | MATLAB | 4,134 | 137 | % op_takeVoxel.m
% Helge Zoellner, The Johns Hopkins University 2020.
%
% USAGE:
% out=op_takeVoxel(in,index);
%
% DESCRIPTION:
% Extract the a certain voxel with indices corresponding to the 'index' input
% array. For multivoxel it is a single input, for 2D-MRSI a vector with 2 indices
% corresponding to the x- and... |
b7f82b99b574dbb7456f83be12a80a72909fdb80d345eae386ac5ca7c46627b3 | MATLAB | 4,134 | 121 | function [convHRVOut, hrOut, verbose] = tapas_physio_create_hrv_regressors(...
ons_secs, sqpar, model_hrv, verbose)
% computes cardiac response function regressor and heart rate
%
% [convHRV, hr] = tapas_physio_create_hrv_regressors(ons_secs, sqpar )
%
% Reference:
% Chang, Catie, John P. Cunningham, and Gary ... |
d45240e5c6efd308037e0e0427de17ceee0d092442f897d2522c6e6bd29d8ebd | MATLAB | 4,136 | 132 | classdef nndagnn < nntest
properties
net;
x;
class;
inputs;
outputs;
end
methods (TestClassSetup)
function initNet(test, device)
test.net = [];
test.net.layers = {} ;
test.net.layers{end+1} = struct('type', 'conv', ...
'weights', {{test.randn(5,5,1,20), test.zer... |
560feea161cb5e5d4144d60b76e3dd65111bc01d6f4d87b1a30184f4c584b6ba | MATLAB | 4,140 | 104 | function [K,dK] = covW(i, hyp, x, z)
% covW i-times integrated Wiener process covariance function.
%
% [K,dK] = covW(i, hyp, x, z)
%
% For i=-1, this is just the white noise covariance, see covNoise.
% For i= 0, this is the Wiener process covariance,
% for i= 1, this is the integrated Wiener process covariance (veloc... |
219dd4ce8aae744860ea4a3d416c6390cb634d09b13a39e24ddbe17cdaafb9eb | MATLAB | 4,141 | 111 | function [] = WormTracker3000(varargin)
%%WormTracker3000 Bryant/Hallem Lab general purpose software for analysis and plotting on worm tracks
% The Worm Tracker 3000 is a unified codebase for the analysis and
% plotting of worm tracks collected during the course of behavioral
% assays, including: thermotaxis, odo... |
37b24790b60b7dcc0accb370834040c30de72f8fdd48179b40a0b7d33561cb27 | MATLAB | 4,141 | 128 | function analyzebehavior_nsd(datadir,nsdexpfile)
% history:
% - 2019/08/09 - revamp (first of series; new soak auto-repeat strategy; record 3 new columns; 250 offset)
nsdsetup;
ppdir = regexprep(datadir,'rawdata','ppdata');
mkdirquiet(ppdir);
%% BEHAVIORAL PERFORMANCE
% find behavioral files
files = matchfiles([dat... |
58c7b1a2d4c398f5da1d1daadf0fb666c5321d41c7646733dc0bccbfeb55204c | MATLAB | 4,141 | 100 | function [K,dK] = covADD(cov, hyp, x, z)
% Additive covariance function using 1d base covariance functions
% cov_d(x_d,z_d;hyp_d) with individual hyperparameters hyp_d, d=1..D.
%
% k (x,z) = \sum_{r \in R} sf^2_r k_r(x,z), where 1<=r<=D and
% k_r(x,z) = \sum_{|I|=r} \prod_{i \in I} cov_i(x_i,z_i;hyp_i)
%
% hyp = [ h... |
6204d8f70bc949662a4e756064cad7de4298c499307deef588028d97c03c7308 | MATLAB | 4,141 | 114 | function filenameArray = get_filename(this, varargin)
% returns the full filename as given in this.parameters.save, an additional
% prefix or suffix can be added;
% NOTE: For high-dimensional nifti data, an array of filenames is given that
% corresponds to the filenames created by MrDataNd.split when saving to
% disk.
... |
d70a1b156397cdc7ed360209cef51074d3f05f0b079b7c341d08502f33faa9ad | MATLAB | 4,141 | 95 | function [augmA, augmb] = fit_createSoftConstrOspreycoMM(basisSet, A, b, ampl,soft)
%% [augmA, augmb] = fit_createSoftConstrOsprey(basisSet, A, b)
% This function augments an unconstrained non-negative least-squares
% (NNLS) problem of the form min(||Ax-b||^2) with x >= 0 to include soft
% constraints on the met... |
657cb348319638a2e6ad88986d66e050a46709864e2d5a1acbf1d2a0a975917e | MATLAB | 4,143 | 95 | function [augmA, augmb] = fit_createSoftConstrOspreycoGABA(basisSet, A, b, ampl,soft)
%% [augmA, augmb] = fit_createSoftConstrOsprey(basisSet, A, b)
% This function augments an unconstrained non-negative least-squares
% (NNLS) problem of the form min(||Ax-b||^2) with x >= 0 to include soft
% constraints on the m... |
e2c42a1b54078263f27c6da2bb8a0a3619e5c4f9254eff7fe72957238dc436d6 | MATLAB | 4,143 | 106 | % firfiltreport() - Reporting of filter parameters
%
% Usage:
% >> firfiltreport('key1', value1, 'key2', value2, 'keyn', valuen);
%
% Inputs:
% 'func' - string filter function
% 'family' - string filter family
% 'type' - string filter type
% 'dir' - string filter direction/phase
% 'order' - sca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.