sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6b3dbe9353c583cc0ca26b7be7bfa5e7a59baa81de0f09d0c0ab52be101e27b8 | MATLAB | 4,377 | 120 | function saveEphysStatsStim(ExpName, Params)
% Saves stimulation activity data to CSV files
% One csv contains node level metrics : StimActivity_NodeLevel
% INPUT
% -----
% ExpName : cell array
% cell array with size N x 1 where N is the number of recordings
% each entry is the name of a recording file wit... |
bfdc50232812dbf3f883afe2eedef2271af3c9166b34483c18c3fc443005e1eb | MATLAB | 4,377 | 136 | function [a,varargout] = Insets(location,s,varargin)
%Insets - Create insets in current axes.
%
% Create insets (= small figures) in current axes. Insets are laid out side
% by side from left to right. The number of insets is determined by the
% number of output parameters.
%
% USAGE
%
% [a,b,...] = Insets(loca... |
3c7868cf1e66d5ffb4033c58ce4812a0f096b9ebda1020ecf08b60b504f9297b | MATLAB | 4,378 | 192 | function [ts, tm, tsbg]= getAllTimeSeries(fn, mask, Nplanes, vertSplit)
Nfiles = numel(fn.si);
ts = cell(Nfiles, 1);
tm = cell(Nfiles, 1);
tsbg = cell(Nfiles, 1);
Nframes = zeros(Nfiles, 1);
correctBg = 0;
for i = 1:numel(fn.si)
[im, info] = loadRegIm(fullfile(fn.pth, fn.si{i}));
im = deinterlace... |
4a3cd3096ddad85cb35bc09a5a875a95ed758cfa255554f13e8bc05c9c0acdb7 | MATLAB | 4,378 | 118 | % Script demo_load_fileformats - to be excluded
% Shows versatile file format loading capabilities of MrImage.load
%
% demo_load_fileformats
%
%
% See also
% Author: Saskia Bollmann & Lars Kasper
% Created: 2017-02-14
% Copyright (C) 2017 Institute for Biomedical Engineering
% University of Zurich and ETH Zurich
%
... |
a7ebd14434c221545b17974f8b02ffd7cecf6fa7d0934b892a94f340e3465235 | MATLAB | 4,378 | 168 | function makeSpikeFiles_KS2(baseName,datFile)
% read KS2 results and generate [sessionname]-ks2.spikes.mat
%
%%
% baseName='~/data/Fear/triple/innis190601/innis190601';
% datFile='/Volumes/temporal/forKK2/innis190601/innis190601.dat'
%%
load([baseName '.basicMetaData.mat'])
fprintf('%s start %s with data of %s... |
65da2466055db759e2f6928cd2f0020dd358d0cba845e5d88b3dc3ecbf036847 | MATLAB | 4,379 | 95 | %% IMPORT AND VET
% DO THIS
id = 'thalamus';
sourcename = 'combinedthalamus';
% ALSO DO THIS
id = 'MTL';
sourcename = 'MTLinT2';
% do it on stone
allcounts = [];
for subjix=1:8
% define
lhfile = sprintf('~/nsd/ppdata/%s/subj%02d_%s_lh.nii.gz',id,subjix,sourcename);
rhfile = sprintf('~/nsd/ppdata/%s/subj%02d_%... |
c50366d4a5cac900018c2715aa084be239f748c5fe0f08878540d3c208981341 | MATLAB | 4,382 | 104 | function miCalc = IN_Initialize_MI(estMethod, extraParam, addNoise, y)
% IN_Initialize_MI Initialize Information Dynamics Toolkit object for MI computation.
%
% ---INPUTS:
%
% estMethod: the estimation method used to compute the mutual information:
% (*) 'gaussian'
% (*) 'kernel'
% (*) 'k... |
0ff06c0ad5b5ced35be84a4f63a88e5b26f40db513b83e9fcdee8801bfa7b523 | MATLAB | 4,383 | 102 | function out = SY_DriftingAutoCorr(y, tau, whatProduct)
% SY_DriftingAutoCorr Drift in lag-tau (auto)correlation via a cumulative-sum test.
%
% Forms a lag-tau cross-term product series p_t and tests whether its mean --
% i.e. the corresponding (linear or nonlinear) correlation statistic -- is
% stationary, via CUSUM/... |
649cc61c82717ad1b6b59c033f99199be39fde2514f99bb36b5e9c76e0550652 | MATLAB | 4,384 | 128 | %% PREP
clear;clc;close
%% SLOW CONVERGENCE
% This is an example of slow convergence for a fixed point problem, and
% how to use the algorithms that come with this folder to solve them, in
% particular when there is a nested contraction.
%
% Lets use a simple fixed point problem that converges relati... |
f6787d0f97f34ba1fc2ba82b1dd6243b675ee011b29386e32a818179619aaf85 | MATLAB | 4,384 | 125 | % Analysis of the peak-to-peak swimming force from Artemia MFS experiment.
%
% Run deflection_FLIR.m first.
%
% The user should make the necessary changes at the top. When running the
% code:
% – Define the regions to be analysed in the swimming
% regime (click at the beginning of the first swimming cycle ... |
72997b60a37d7839bb489316b89417799443e91efd78d8a1e80b7f7a2923ee94 | MATLAB | 4,386 | 135 | function DB = Meta_Activation(DB)
% DB = Meta_Activation(DB)
%
% NEEDS:
%DB.PP % list of contrast image names
%DB.XYZmm % mm coords for each study
%DB.radius % in voxels
spm_defaults; defaults.analyze.flip = 0;
% -----------------------------------------------------
% across all density images, compute pr... |
b1d92606eba3b185967053c218e76ee5647eb30a52dbfcd94dc8bcfcec90750f | MATLAB | 4,386 | 125 | function rename_brainvision_files(varargin)
% RENAME_BRAINVISION_FILES renames a BrainVision EEG dataset, which consists of a vhdr header
% file, vmrk marker file and a data file that usually has the extension dat, eeg or seg.
%
% Use as
% rename_brainvision_files(oldname, newname, 'rmf', 'on')
% where both the old ... |
23766fe95c44412c6de128839f7a6f13c66d7c18fcd6c35a4c07cd752e47ae09 | MATLAB | 4,387 | 100 | function data = spatial_info_bootstrap3(data,bins,nshuffle,ywindow)
% Take a dataset and calculate for each category and each cell the spatial
% information represented as well as the distribution of spatial
% informations with shuffled y traces. Return spatial info (in %dFoF AUC/s)
% and p-value for the bootstrape... |
94077a635e65965ff2ee55122145c464115d2f140bc2014a58157d22bfda4536 | MATLAB | 4,387 | 134 | %% h = sepia_handle_panel_phaseUnwrap(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : starting position of this panel
%
% Output
% --------------
% h : g... |
c6e5c0f6a4b3417b4eae807b58736725988366394da2dfd8b6699ae6bb9e906d | MATLAB | 4,387 | 106 | function plot(source,cfg,varargin)
% Plot the contents of a McsCmosAcquisitionSource object.
%
% function plot(source,cfg,varargin)
%
% Input:
%
% source - A McsCmosAcquisitionSource object
%
% cfg - Either empty (for default parameters) or a structure with
% (some of) the following... |
eeaac50620d968caf579b2276793eaebc1aeefa692643402a7e4c0a0e88dbc78 | MATLAB | 4,387 | 147 | function mtc = readmtc (filename, o1d)
% mtc = readmtc (filename, o1d);
% Read BrainVoyager's mesh time course (mtc) files
% filename: name of .mtc file
% o1d: (optional), name of output .1D (AFNI's text format output) version
% mtc: output stucture with contents of filename
%
% By ZSS, SSCC/NIMH/NIH
% based on Hester'... |
e13b8fd1ad9c9f79c2c58a217a3f6a010bd7a22af2c9fdb6ec1e77298d4f1713 | MATLAB | 4,388 | 129 |
% modulation index
%% without filter
mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble';
timeFile = fopen([mypath, '/MRI_results_formal/txt_barchart_3_fold_effect_anathpc_g12_conti_organized_0.txt'],'rt');
table_time = textscan(timeFile,'%s %s %s');
fclose(timeFile);
data_fhpc = zeros(length(table_... |
5723df1154628316ae0c02d48da422daee28ca9a730405bb07c1dccf9690586b | MATLAB | 4,392 | 119 | %% get_set_qsm_medi(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' then input should be fid
%... |
61bab7df846b2ce23aa55003ae7d8c05cc0d14f1c6b44a4a7b7f0e16c61490a9 | MATLAB | 4,392 | 111 | function plotStimShuffleResults(shuffleResults, spikeData, Info, Params, figFolder, patternIdx)
% PLOTSTIMSHUFFLERESULTS Visualise results of the circular-shift shuffle test.
%
% Generates two figures per pattern:
% 1. Null distribution heatmap with observed trial proportion overlay and errorbar plot.
% 2. Electro... |
8204a277490c1deebc5c9c7035d31c18fc9449fd5609a92bf53703c7f71125c8 | MATLAB | 4,394 | 102 | %{
monet.MonetRF (computed) # receptive fields from the monet stimulus
-> preprocess.Sync
-> preprocess.Spikes
-----
nbins : smallint # temporal bins
bin_size : float # (ms) temporal bin size
degrees_x : float # degrees... |
e8e0c86ffe4b06864d451dfc9ab1e48bd99402869638097cc542c6811ba3edd9 | MATLAB | 4,394 | 132 | % PROCESS_OPTIONS - Processes options passed to a Matlab function.
% This function provides a simple means of
% parsing attribute-value options. Each option is
% named by a unique string and is given a default
% value.
%
% Usage: [var1, var2, ...... |
107771e1edd80759e4454a468d2e4aed1669cd0a5dc0e08d6172a6e1f3f4bcac | MATLAB | 4,396 | 125 | % ANOVA1RM_CELL - compute F-values in cell array using repeated measure
% ANOVA.
%
% Usage:
% >> [FC dfc] = anova2rm_cell( data );
%
% Inputs:
% data = data consisting of PAIRED arrays to be compared. The last
% dimension of the data array is used to compute ANOVA.
% Outpu... |
6e0eb65ff802bb088573867011a1ac9ae78a138e992a1e921f495205fdfae77f | MATLAB | 4,396 | 150 |
function [h5cropIndex,imcropRect]=autoCropping(h5Path,varargin)
options.BandPx=[3 25];
options.verbose=true;
options.autoCropping=false;
options.windowsize=1000;
options.dataset='mov';
options.diary=true;
options.diary_name='diary_crop';
options.processWholeMovie=true;
disps('Starting movie cropping')
if isstruct... |
da9c3704ebaa793df6d881b75aea0a471c8cdab08bfebf0d6524c372b99b5bd9 | MATLAB | 4,396 | 104 | %VL_NNCONV CNN convolution.
% Y = VL_NNCONV(X, F, B) computes the convolution of the image X
% with the filter bank F and biases B. If B is the empty matrix,
% then no biases are added. If F is the empty matrix, then the
% function does not filter the image, but still adds the biases and
% applies downsamplin... |
4aa0a8b2d795f3921b2c520810978f91f1eb3c8befb1007fd2fbc4c705a29fc1 | MATLAB | 4,398 | 118 | function [ spectra, spectra_metabolites, x_ppm, info ] = mrs_readLcmodelCOORD( fileName )
%MRS_READLCMODELCOORD reads the LCmodel output file .coord, which contains the
%coordinates of all curves on the one-page output.
%
% [ spectra, spectra_metabolites, x_ppm, info ] = mrs_readLcmodelCOORD(fileName)
%
% ARGS :
% file... |
4f3dce5a19ee09564acf6d71701481498869b20c346d811c8fcf3493bf36aae2 | MATLAB | 4,398 | 56 | function plot_RNN_choice_switch_11sample
close all
clear all
clc
% Plot perturbation-induced choice switching with 11 RNNs.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
load('RNN_choice_switch_trial_fraction.mat')
% Sample number.
RNN_num = 11;
switch_trial_fraction_control_no_ablatio... |
f1d5e39c4ebe29118675593744f59bd036125d8f5f25738156d27e53004eedcc | MATLAB | 4,398 | 139 | function [result] = fit_happy_model_guiltenvy(mtx,happyscore,constant)
%assumes that each row of the cell array is a different subject
rptfit = 5; %repeat N times jittering the betas
tempf=fieldnames(mtx);
for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end;
data = mtx;
data.happysco... |
cb51d4744e38f394e87174fe288ba1e56590956461eb5940de4f85e718044431 | MATLAB | 4,399 | 136 | function [thresholdHigh, thresholdLow, observed, t] = JitterResponses(spikes, events, durations, varargin)
% [thresholdHigh, thresholdLow, observed, t] = JitterResponses(spikes, events, durations, varargin)
% This function computes significance thresholds for the spike responses
% within provided intervals using a bo... |
fb647d5b4e2161a8b4b6b1aa7d61e478c9de591067e3d96869e1db51c7d7574f | MATLAB | 4,400 | 119 | function betas = getDataFromSPM(userOptions)
%
% getDataFromSPM is a function which will extract from the SPM metadata the
% correspondence between the beta image filenames and the condition and session
% number.
%
% function betas = getDataFromSPM(userOptions)
%
% betas --- The array of info.
% be... |
04e9d3ef4fdd17b10e370e71b8126fe572f1b7c32fc9c2b2d5121e39c356d133 | MATLAB | 4,402 | 93 | % STD_RENAMESTUDYFILES - rename files for design 1 if necessary. In design
% 1, for backward compatibility, files could have
% legacy names. For consistency these files now
% need to be renamed. Note that the STUDY is
% ... |
1e62e9e61b5b7496f31f19fd945dc5196e0435387d2f6d297a7f66a55807f1b7 | MATLAB | 4,403 | 105 | function out = CO_AutoCorrX2(y, taus, whatDirection)
% CO_AutoCorrX2 Asymmetric squared cross-correlation of a time series.
%
% Computes a lag-resolved generalization of the 'leverage effect' correlation
% used to detect asymmetric volatility feedback (e.g., Bouchaud, Matacz &
% Potters, Phys. Rev. Lett. 87, 228701 (... |
54ac2e3c5ad5f8bdf3ad4a11c030e13c488b54b8b88529f602a563ab4662db34 | MATLAB | 4,403 | 116 | function plot_cluster_ERSP(sii,PATH,cfg, fieldNames)
% Plot ERSP and GPM at clusters
% with single subject gait ERSPS of ICs and clustering solutions at data
% PATHIN named file_in
%
% INPUT
% - sii: vector of subject IDs to be processed
% - PATH: structure with all paths leading to diff processing steps
% ge... |
75981d0d14d7fe5cd40138898081059753e12e1c4ccdd649af5523fc6635767a | MATLAB | 4,403 | 130 | function run_permuanovan_examples
%RUN_PERMUANOVAN_EXAMPLES Run permutation-based N-way ANOVA examples.
% Generates random data for a 3-way design (2x2x2) along the columns
% of X. X contains 20 dependent variables. The groups have identical
% means of 0 for most variables,except for the first 5 variables where
... |
4851548096e9a92883534d6d47f380998105b28b3b985338a6cfb2b2dece5a79 | MATLAB | 4,404 | 119 | function Meta_plot_points_on_slices(DB, MC_Setup)
% Meta_plot_points_on_slices(DB, MC_Setup)
%
% This function plots points on multiple slices. It can do it either on
% solid slices or "outline" contours. Right now, it's hard-coded for
% contours, but the main function it runs, plot_points_on_slice.m, has
% inp... |
9e06e4759afbe915d76994134c7451bd0b87748b3dbb206e3bbaa002f834fcae | MATLAB | 4,404 | 93 | function updatedWeight = ART_Update_Weights(input, weight, categoryNumber, learningRate, warpfun, compare_warped)
% ART_Update_Weights Updates the weight matrix of an ART network.
% [UPDATEDWEIGHT, WEIGHTCHANGE] = ART_Update_Weights(INPUT, WEIGHT, CATEGORYNUMBER, LEARNINGRATE)
% This function returns a new wei... |
a4891e4d6306a570f72c5d6cd5ea223081635663c1f61027d321e1445024ada0 | MATLAB | 4,404 | 113 | function runSPMSegmentation(inputFilename, outputDir)
%RUNSPMSEGMENTATION Run SPM segmentation.
%
% DESCRIPTION:
% runSPMSegmentation segments an input image using SPM. SPM must be
% installed and on the MATLAB path. The output images are stored in the
% same path as the input image.
%
% USAGE:
% runSPM... |
8d3e194320cf16c1ebbcb11e2046222a4e78ff697ba7db30b7f0579939abf68d | MATLAB | 4,405 | 92 | %% availableFileList = MaskRefinementIOWrapper(sepia_header, algorParam, availableFileList, outputFileList, outputNiftiTemplate)
%
% Input
% --------------
% sepia_header
% algorParam : Struct containing the method and method specific parameters
% availableFileList
% outputFil... |
08b970be42c90efb6eb90596136e891d204ff0e914e41399c1ca19440dedddcf | MATLAB | 4,406 | 172 | function test93()
% Test for fixedrankGHquotientfactory geometry (low rank completion)
%
% CG comparison for Test 18
% This file is part of Manopt: www.manopt.org.
% Original author: Bamdev Mishra, Dec. 30, 2012.
% Contributors:
% Change log:
clc; close all;
% reset(RandStream.getDefaultStream);
% randnfoo... |
fa4159fe9c23c8df32c441fee0ef459d1aa86309b002fcfbcfa54750b5cd180b | MATLAB | 4,406 | 109 | function [clean,bad,badIntervals] = CleanLFP(lfp,opt)
% CleanLFP - Remove artefacts from LFP trace
%
% Returns the lfp cleaned from two kinds of artefacts: big artefacts in the
% lfp signal (surpassing a threshold in z-units) and very fast fluctuations,
% in which the signal derivative suprasses a threshold in z-units)... |
d3c2e6fe3dde1a5fcd6888978e4c56953be9514de6d4e59049eb3f371107932e | MATLAB | 4,407 | 112 | function[Pos_all_spikes, Neg_all_spikes, pos_avg_amp, neg_avg_amp, num_posspks, num_negspks, All_interspike_interval_sec, interspike_interval_sec_avg, All_spikes]=spike_detection(Fs, time_ms, num_electrode, HP_Signal_fix, v, mag)
%SPIKE_DETECTION Detect positive and negative spikes from MEA signals
%
% INPUTS:
% ... |
e2f6043fbf7fda62931a633a7b8986b2f7c88c8c492a3e3e791d2d173eccc675 | MATLAB | 4,408 | 157 | function [foundh5path,summary]=findh5(sourcefile,varargin)
% HELP
% Finding processed h5 file at the latest analysis step.
% 'sourcefile' can be a path to a dcimg or h5 file from a previous analysis
% step. You may provide a drive to serach in the corresponding
% 'Preprocessed' folder.
% SYNTAX
%[foundh5path,summary]=... |
14c349c6b8491af1db85374aa508134b1dae08ef96f4395fe485b31860eccf49 | MATLAB | 4,409 | 130 | % LISTDLG2 - listdlg function clone with coloring and help for
% EEGLAB.
%
% Usage: same as LISTDLG
%
% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 16 August 2002
%
% See also: INPUTDLG2, ERRORDLG2, SUPERGUI, INPUTGUI
% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu
%
% Th... |
04dea0c844f47058acc06b04d3934e594c6a501e5c39b83e839453b2cbfddf0c | MATLAB | 4,410 | 112 | % EEG_REREJECT - reject the same data portion as the ones defined
% in a reference dataset. This function is useful when
% have filtered a dataset and want to reject again the
% same portions of data.
% Usage:
% >> OUTEEG = eeg_rereject(EEG, cleanEEG)
%
% Inputs:
% ... |
a9323fb6fac12c9026b6041499fcc95fedff548c55f9099a9e6d277d03eb8cc2 | MATLAB | 4,410 | 102 | %% TestUnwrapMatrix - Tier 3 real-dataset phase-unwrapping method regression matrix
%
% Mirrors TestQSMMatrix.m: runs the one-stop SEPIA pipeline on a real
% dataset once per phase-unwrapping method in methodUnwrapName
% (sepia_universal_variables.m), holding background field removal
% ('VSHARP') and QSM dipole inversi... |
ec08b8ee524f11c8007aa730ef54b627ca50b31b0c34565a650b0e54ef43bc07 | MATLAB | 4,412 | 125 | function c = tapas_kf_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Kalman filter
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The Kalman filter configuratio... |
8ad68a396d6f161deb36bf73fd6543acf9ae38f0b4351f8a78456743d69d8058 | MATLAB | 4,414 | 114 | function [relativeShift,absoluteShift,xc] = FieldShift(control,test,varargin)
%FieldShift - Estimate firing field shifts between two conditions.
%
% For each place cell, the absolute field shift between the two conditions is
% estimated as the mode of the spatial cross-correlogram between the
% respective firing fi... |
60132f2356b307c611f48674f492677f8c6e38ef880d90ec2eed3cfb4ad82be7 | MATLAB | 4,419 | 143 | function fear_coactChanceLevel_firstREM(basename,varargin)
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
param.thrshold=25;
param.templateIdx=2;
param.targetIdx=3;
param.beh='nrem';
param.nIte=500;
param.chunkSize=2;
param=parsePar... |
9965b82c4391319d2f45a2def8df0ca5c64534bdaa50c0cd46e269c3f4ee3ca0 | MATLAB | 4,420 | 107 | function GetMD5
% GetMD5 - 128 bit MD5 checksum: file, string, array, byte stream
% This function calculates a 128 bit checksum for arrays or files.
% Digest = GetMD5(Data, Mode, Format)
% INPUT:
% Data: File name or array.
% Mode: String to declare the type of the 1st input. Not case-sensitive.
% '... |
611ff3d4b500f5f334e5e75870ed58536ba47f6da511e38c47b009bbbfecfdb6 | MATLAB | 4,421 | 92 | function sync_info = sync(key, photodiode_signal, photodiode_fs)
% given the photodiode signal, returns a structure describing visual
% stimulus trials that were displayed and exact timing synchronization.
% The photodiode signal is assumed to be uniformly sampled in time.
trialTable = vis.Trial;
trials = trialTable ... |
43b32e4082c57abd6b1fb1c3cb069da78abbe055a6baacd78bb956ba5ae540f6 | MATLAB | 4,422 | 115 | function align_nonlinear(input_img, scalp)
%
% Input: input_img <string> fullpath to folder, where the aligned
% electrodes shall be stored.
% scalp <struct> triangular mesh consisting of node positions
% and triangle list.
%
% This func... |
d6f32437b5c9320fa33f1f19dc566c9027b7b8346e4bd7059e6d650d44665ab9 | MATLAB | 4,422 | 105 | %VL_NNCONV CNN convolution.
% Y = VL_NNCONV(X, F, B) computes the convolution of the image X
% with the filter bank F and biases B. If B is the empty matrix,
% then no biases are added. If F is the empty matrix, then the
% function does not filter the image, but still adds the biases and
% applies downsamplin... |
9ecc5490f7a8c2af026ba3aaa4cc6f51b8f21f5ce70acc80107eec9301687174 | MATLAB | 4,423 | 110 | function start_segmentation_cedalion(input_img, T2_optional)
%
% Input: input_img <string> fullpath to T1 MRI image to be segmented
% T2_optional <string> fullpath to T2 weighted MRI image.
% Supports SPM during segmentation.
%
% This function calls step-by-step t... |
07943672fc53cb141d1dadab3cfbae1914744b7a8ed7e58701bd73fb9c3578ad | MATLAB | 4,424 | 143 | % figure-generating code for Maggie's paper. includes the following
% most likely block and 2nd most likely block decoding
%% load code path and data.
%location of analysis codebase
codepath = '~/projects/constantinoplelab/Analysis/';
% add code paths
addpath(genpath(codepath))
addpath(genpath(codepath + "david"))
a... |
9c7d73d872515e1d9e1f7b50d225ebcf0d19cbf8b0cded3f88b5d9bacc0416a0 | MATLAB | 4,424 | 91 | % This MATLAB script can be used to reproduce the hemodynamic response in dataset B (Figure 5)
% 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, mainta... |
d2357578b46e0a5f378f80bf689e6aa88bacb30cd8fc9d214c769c88e448ea90 | MATLAB | 4,425 | 93 | function [masterOutput, masterTime, errorMsg] = TS_ComputeMasterLoop(x,x_z,masterFn,masterCode,masterID,numMasterOps,howVocal,theTsID,iterNum,beVerbose)
% TS_ComputeMasterLoop Used in a loop by TS_Compute to evaluate a given master function.
%
% masterFn is a function handle, precompiled once from masterCode (see
%... |
973bb199d6621c176408a4774d3dd4a977ab121f78104af3a4e3dd7c927fde8f | MATLAB | 4,427 | 143 | % MATSEL - select rows, columns, and epochs from given multi-epoch data matrix
%
% Usage:
% >> [dataout] = matsel(data,frames,framelist);
% >> [dataout] = matsel(data,frames,framelist,chanlist);
% >> [dataout] = matsel(data,frames,framelist,chanlist,epochlist);
%
% Inputs:
% data - input data m... |
282ba47428ecebf41d7853a36f749cec672b33af4d78eaf48ebe6158970f82e9 | MATLAB | 4,428 | 116 | function [T,str] = anovan_autoDesign(data,varargin)
% makes ANOVA design from data in a N-dimensional matrix, and passes on to
% anovan. Allows NaN in input matrix: ignores them.
%
% Varargin can be:
% Parameter Value
% 'alpha' A value between 0 and 1 requesting 100*(1-alpha)%
% confid... |
40636a503df4c9f1dec057ffe721fb14262f81fe7b1e8fd545447d8a47e0bb47 | MATLAB | 4,428 | 121 | function this = read_data_from_graphics_handle(this, inputHandle)
% Reads in data from graphics handle, trying to infer from plot type
%
% Y = MrDataNd()
% Y.read_data_from_graphics_handle(inputHandle)
%
% This is a method of class MrDataNd. It tries to retrieve reasonable
% plotted data from the specified figure/a... |
97b973337bf20111f5a1d9e5f06d6c79f6b9633ad925689f59e19497eb313acd | MATLAB | 4,429 | 132 | function this = MrImageGeometry_constructor(this, testVariants)
% Unit test for MrImageGeometry Constructor with different inputs.
%
% Y = MrUnitTest()
% run(Y, 'MrImageGeometry_constructor')
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrImageGeometry_constructor
%
% See also MrUnitTe... |
8762055051a8b65ad561fa3b95386bf72210c7d6672d27aa04f8212c4e521b47 | MATLAB | 4,430 | 123 | function run_permumanova2_examples
%RUN_PERMUMANOVA2_EXAMPLES Run permutation-based two-way MANOVA examples.
% Generates random multivariate data for a 2x2 design 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 ... |
ab79e2bbaa8db7340ddbb30df1b56ab9f5e7932ef2d27a405430a435c58fdf21 | MATLAB | 4,430 | 134 | function NetMet = calNodeCartography(adjMs, Params, NetMet, Info, originalCoords, ...
originalChannels, HomeDir, fileNameFolder, oneFigureHandle)
% Calculates node cartography metrics
% Parameters
% ----------
% adjMs : struct
% structure where each field contains a cell, which represents the
% collection... |
19884bc550ee73aef79933382a20db29fb0c001628b23b9ae7f62d6178e11667 | MATLAB | 4,433 | 106 | clear all
close all
clc
exp_root = 'C:\Users\User\Documents\fMRI_EXP\';
more_code = fullfile(exp_root, 'cells_data_muller');
data_folder = fullfile(more_code, 'wetransfer_neil-s-data_2023-09-25_1057');
addpath(genpath(more_code));
addpath(genpath(data_folder));
load('grid_animal4.mat')
env1_data = squeeze(cells_arr... |
0d073b5259acda7091cf1f876eae4aec98d6813b45da09a44a01248620b7d5d5 | MATLAB | 4,438 | 113 | clear all
close all
clc
exp_root = 'C:\Users\User\Documents\fMRI_EXP\';
more_code = fullfile(exp_root, 'cells_data_muller');
data_folder = fullfile(more_code, 'wetransfer_neil-s-data_2023-09-25_1057');
addpath(genpath(more_code));
addpath(genpath(data_folder));
grid_rats = [3, 4, 1];
num_grid_rats = length(grid_rats)... |
66f0e9a014078483d5ea7cd3e5db52432cd4497ccb669644919db750abf337a2 | MATLAB | 4,439 | 113 | function out = SY_VarRatioTest(y, periods, IIDs)
% SY_VarRatioTest Variance ratio test for random walk.
%
% Implemented using the vratiotest function from Matlab's Econometrics Toolbox.
%
% The test assesses the null hypothesis of a random walk in the time series,
% which is rejected for some critical p-value.
%
% --... |
191f720dfe8c348ea15901bcf6ac172ba27479c50778cbbe026d29d351a479fe | MATLAB | 4,440 | 193 | addpath("~/ER_Ca_rot/networkSpreadFVM-main/scripts/");
addpath("~/ER_Ca_rot/networkSpreadFVM-main/examples/");
dirname = "~/ER_Ca_rot/networkSpreadFVM-main/examples/Kd_op/Op_new";
%filen= strings(5,51);
ar = [0, 0.275, 1.378, 2.755, 5.51, 27.55];%diffusion constants
st_ar = string(ar);
ar1 = [-8.9872:0.2304:-2.9968];%K... |
cbae693e265e964301c1cf407820ed4c34f5c06c56afe74d4efa9381bb37610f | MATLAB | 4,440 | 73 | % Convert NIRS data in NIRx format to MATLAB-compatible format
%
% Please see description PDF file for more details
% example rawdata is from VP026
% We strongly recommend you to use data in MATLAB-compatiable format uploaded separately
clear all; clc; close all;
%%%%%%%%%%%%%%%%%%%%%%%%%% please modify folder locati... |
d2abf4c62601fc429b4b03a34779cfa4cf9bccc643ffea81b737f9ccde9f87eb | MATLAB | 4,440 | 114 | function X = positive_definite_karcher_mean(A)
% Computes a Karcher mean of a collection of positive definite matrices.
%
% function X = positive_definite_karcher_mean(A)
%
% Input: A 3D matrix A of size nxnxm such that each slice A(:,:,k) is a
% positive definite matrix of size nxn.
%
% Output: A positive de... |
b6894b5bdb4369640e5c3a74cd8fbafef3ccf86526e902c63c500329ec6f3972 | MATLAB | 4,441 | 127 | % assign circles to each point in a rectangle
% for each point in the matirx, create a list of circle centers that it
% belongs to
% save the file at base path
% filename = imagewidth_imageheight_radius.bin
classdef assigncircles < handle
properties
width = 0 ;
height = 0 ;
radius... |
2546b017c54f4f373cbe0d8742680fa24231215b5db775c08f2ea96a1a71f279 | MATLAB | 4,443 | 115 | % POP_SNAPREAD - load an EEG SnapMaster file (pop out window if no arguments).
%
% Usage:
% >> [dat] = pop_snapread( filename, gain);
%
% Graphic interface:
% "Relative gain" - [edit box] to compute the relative gain, first look at
% the text header of the snapmater file with a text editor.
% ... |
2af37a799a40afbb66eb82e155878e7f06702758aee59be82cda762fbeb5dcbe | MATLAB | 4,444 | 123 | function pooling_outNames(params, dirsList, figDir)
% pools across results in outNames (different analysis settings)
% result = from triggerAnalysis -> trialData
% plots one figure per channel for all subjects
% (c) Jiri, May22
%% settings: activations
freqBands = cat(1, {'erp', [nan, nan]}, params.triggering.freqBan... |
8a2cc952c5752360f22003d8dae117a6fe2f62ddd86c35e1bf983bbb680e60f8 | MATLAB | 4,447 | 110 | % fit_OspreyMM.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [fitParams] = fit_Osprey(dataToFit, resBasisSet, fitOpts);
%
% DESCRIPTION:
% This is the function describing the Osprey fitting model, which is
% performed with the resampled basis set resBasisSet on the data contained
% in the FID-A da... |
600f37b8d06722bde9b53fb8cd21338cec56241c99fefb34d15e4849438f91ce | MATLAB | 4,449 | 77 | function [sub_session_durations,sub_session_minutes,sub_session_types] = init_session_durations(sheet_name)
switch sheet_name
case 'OpenfieldPhotostim'
sub_session_durations = [3 22]; % minutes
sub_session_minutes = {[-5:1:0],[0:1:22]}; % will grab frames within these range
sub_session_... |
4fe5fe2bf55095e9ae1510f1315d9d0febb6c11d990dbfca71bd05a37192762f | MATLAB | 4,450 | 119 | % load CSV file
fileName = fullfile('data', 'dataFigureS4BC.csv');
dataT = readtable(fileName);
% read the table
[input.ORNs, ~, icORN] = unique(dataT.ORN, 'stable'); %ORN name
for i = 1:length(input.ORNs)
list1 = find(icORN == i);
%odor name
odorVec = unique(dataT.Odor(list1),'stable');
... |
15ceede2b9f7ff39e16f61e03e626fe9f646ea1b64a368a384e041a923db72c0 | MATLAB | 4,452 | 132 | % Please cite this paper if you use any component of this software:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017.
% Re... |
09c82281ce227518b0136bba8d24b6d07c6c72ad9a239f665808a98b8b1bab5b | MATLAB | 4,453 | 137 | % TOPO2SPH - convert a TOPOPLOT style 2-D polar-coordinate
% channel locations file to a 3-D spherical-angle
% file for use with HEADPLOT
% Usage:
% >> [c h] = topo2sph('eloc_file','eloc_outfile', method, unshrink);
% >> [c h] = topo2sph( topoarray, method, unshrink );
%
% Inputs:
% 'el... |
29d0808c685affd79c3c9bde689039df4a672a2b7123a484d1f4fce3a3593b75 | MATLAB | 4,453 | 116 | function [MRSCont] = osp_LoadRAW(MRSCont)
%% [MRSCont] = osp_LoadRAW(MRSCont)
% This function reads data from LCModel .RAW files.
%
% USAGE:
% [MRSCont] = osp_LoadRAW(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data container.
%
% ... |
62e4a627acb03d1a0bf46097d4b782dc90b04e58be8fc71b9bc6976d07187850 | MATLAB | 4,453 | 109 | % likelihood functions are provided to be used by the gp.m function:
%
% likErf (Error function, classification, probit regression)
% likLogistic (Logistic, classification, logit regression)
% likUni (Uniform likelihood, classification)
%
% likGauss (Gaussian, regression)
% lik... |
1776b51a96b0abc0b77916be5fa7e4ede64fc8285a935573e77843c82489c521 | MATLAB | 4,454 | 130 | function stats = rm_anova2(Y,S,F1,F2,FACTNAMES)
%
% function stats = rm_anova2(Y,S,F1,F2,FACTNAMES)
%
% Two-factor, within-subject repeated measures ANOVA.
% For designs with two within-subject factors.
%
% Parameters:
% Y dependent variable (numeric) in a column vector
% S grouping variable for... |
8e9dfbf0d3a635d45f1283a5e01e8e892b8d8896f98595232c4b84b3f617cfe1 | MATLAB | 4,456 | 129 | function spec = invoke_arg_internal(reptype,varargin) %#ok<INUSL>
% same type of invoke function as in arg_sub, arg_subswitch, etc. - but shared between
% arg, arg_norep, and arg_nogui
spec = hlp_microcache('arg',@invoke_arg,varargin{:});
% the function that does the actual work of building the argument specifier
func... |
901999502ba657827ce6b3377a9fdb35ce664d335b3c866e05c5ddeb7aa704d9 | MATLAB | 4,456 | 138 | function handles = plotErrorArea(x, mean_y, error_y, varargin)
% PLOTERRORAREA Plot line with shaded error region
%
% Syntax:
% h = plotErrorArea(x, mean_y, error_y)
% h = plotErrorArea(x, mean_y, error_y, 'Name', Value, ...)
%
% Description:
% Creates a plot with a mean line and shaded error regions.
% Handles... |
9b7bdc737e53e7327c00190aa41717fdc0d9f6f96bd757371db1d780281c0455 | MATLAB | 4,456 | 115 | % EEG_GETCHANTYPE - get the count for each channel type. Also assign
% automatically channel types if they are not yet present.
%
% Usage:
% >> [OUTEEG,chancount] = eeg_getchantype(INEEG);
%
% Inputs:
% INEEG - input EEG dataset structure
%
% Outputs:
% OUTEEG - new EEG dataset st... |
a730f35ad3516f9cd42ca23cf3c17fe158fe2890538a6307573aabe8eb896efc | MATLAB | 4,460 | 167 | function secondlevel_main()
% Group-level one-sample t-tests for the principal manuscript results.
% Contrast files are identified by contrast name in each first-level SPM.mat.
%
% Edit USER SETTINGS, then run:
% secondlevel_main
%% USER SETTINGS
spmDir = 'C:\path\to\spm';
model1Root = 'D:\path\to\firstlevel_main_a... |
418816320f9b9d4bb0167761c69f967367a109b20ac28eba4a873d808951cce1 | MATLAB | 4,462 | 113 | %{
trippy.Monet (computed) # receptive fields from the trippy stimulus
-> rf.Sync
-> pre.Spikes
-----
nbins : smallint # temporal bins
bin_size : float # (ms) temporal bin size
degrees_x : float # degrees along x
degree... |
c742530f4a6a28734fdfcb0730dbc8488d91e199c4f013b87d9bb8f1479144a8 | MATLAB | 4,463 | 147 | function [outlier_all] = ft_outlier(file_rp, file_in, outlier_params,...
software, path_output)
% Get outlier
%
% [outlier_all] = ft_outlier(file_rp, file_in, outlier_params,...
% software, path_output)
%
% Inputs:
% file_rp - filename of textfile with realignment parameters.
% file_in - filena... |
a2471d156b1bfc1e37565c396cd512fa24d49b4d379c0bcbd1d462efe2013b99 | MATLAB | 4,466 | 127 | %calcualtes CPD for an example cell
%% choose a neuron and its glm fit, as well as place to save
file_idx = 170;
datadir = '~/projects/ofc/data/published/units/'; %where raw data lives
datadir_agg = '~/projects/ofc/data/published/'; %where aggregated data lives
savedir = '~/projects/ofc/results/demo/'; %where CPD sh... |
e3c08739bb5b72a47d14ef1e821b74017eba2604bfc55fbdec4b651a0ea5c2d6 | MATLAB | 4,466 | 136 | function [c, r, t, cpulse] = tapas_physio_read_physlogfiles_GE(log_files, ...
verbose)
% reads out physiological time series and timing vector depending on the
% MR scanner vendor and the modality of peripheral cardiac monitoring (ECG
% or pulse oximetry)
%
% [cpulse, rpulse, t, c] = tapas_physio_read_physlogfiles_GE... |
bbfc45e500e5b78d726d344ac537a85472e1c864d4d5c4014ce62acbd5da6624 | MATLAB | 4,467 | 96 | %% TestSmokePhantom - Tier 1 toolbox-free smoke test
%
% Runs the full one-stop SEPIA pipeline (sepiaIO -> SepiaIOWrapper) on a
% small deterministic synthetic phantom, using only methods that require
% no external toolbox (unwrap='None', bfr='VSHARP' built-in, qsm one of
% {TKD, Closed-form solution, iLSQR}). Confirms... |
cc7a012c36038e8e8f1e8fc020f31a55867c2443767b8735568c6b6ba098a399 | MATLAB | 4,469 | 107 | function ft_skullstrip_spm12(filename, path_output)
% Skull stripping with SPM12
%
% ft_skullstrip_spm12(filename, path_output)
%
% Inputs:
% filename - filename of input volume.
% path_output - path where output is saved.
%
% The computation of the skull strip mask should be done on the PD-weighted
% (INV2)... |
5e202e6803459d273ef2f3944a7e7e6dc7508b6d5b51836498828d5b9b8bc2a7 | MATLAB | 4,470 | 155 | %%%%%%%%%% this section generates sample motion traces for all 8 subjects
% define
sessix = 20;
runix = 1;
figureprep([100 100 600 600],1);
for subjix=1:8
file0 = sprintf('~/nsd/nsddata_timeseries/ppdata/subj%02d/func1pt8mm/motion/motion_session%02d_run%02d.tsv',subjix,sessix,runix);
a1 = load(file0); % 226 x 6
... |
9c2ec3e016284f968ea7331d519d2305edef7f62b5e9acc121c9adac43556197 | MATLAB | 4,470 | 92 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pop_GEDAI plugin
% This EEGlab GUI is used to call the GEDAI denoising function, and select parameters
%
% [Generalized Eigenvalue De-Artifacting Intrument (GEDAI)]
% PolyForm Noncommercial License 1.0.0
% https://polyformproject.org/licenses/... |
07fd0547d6f04be4e2dc95a3f7aca90a8dadaa3887a2f23526b64af0059f69ce | MATLAB | 4,471 | 157 | function [pval table] = circ_wwtest(varargin)
% [pval, table] = circ_wwtest(alpha, idx, [w])
% [pval, table] = circ_wwtest(alpha1, alpha2, [w1, w2])
% Parametric Watson-Williams multi-sample test for equal means. Can be
% used as a one-way ANOVA test for circular data.
%
% H0: the s populations have equal means
%... |
f74fe95b8451016700dd0db1734ed447a8944c20bbd4d0abc59cb59431b12972 | MATLAB | 4,472 | 135 | % RMBASE - subtract basevector channel means from multi-epoch data matrix
%
% Usage:
% >> [dataout] = rmbase(data); % remove whole-data channel means
% >> [dataout datamean] = rmbase(data,frames,basevector);
% % remove mean of basevector from each channel and epoch
% Inputs:
% data - data... |
6df2b3c8b2a24c9661b9994a9090410483b22e79e5ba6852aef4f07f03796d13 | MATLAB | 4,474 | 113 | function dataNdCombined = combine(this, dataNdArray, combineDims, tolerance)
% combines multiple n-dim. datasets into a single one along specified
% dimensions. Makes sure data is sorted into right place according to
% different dimInfos
%
% NOTE: inverse operation of MrDataNd.split
%
% Y = MrDataNd()
% dataNdCombi... |
29c96162367579950c19615186d763c5112fe2c21cbae89d92ef58a41d788f52 | MATLAB | 4,475 | 71 | function [] = CreateOutputFolders(OutputDataFolder, GrpNm, Params)
% this function creates the following output folder structure:
%
% OutputData+Date
% ExperimentMatFiles
% 1_SpikeDetection
% 2_NeuronalActivity
% 3_EdgeThresholdingCheck
% 4_NetworkActivity
% Parameters
% ------... |
a2b8d13571893815df9d34303aeb5c9b5406f32ee1e95d373b76d2160510ad51 | MATLAB | 4,476 | 101 | function [X, fX, i] = minimize_lbfgsb(X, f, length, varargin)
% Minimize a differentiable multivariate function using quasi Newton.
%
% Usage: [X, fX, i] = minimize_lbfgsb(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to th... |
c2f2475264ea548173fcdf08a80a43fa2bfe844e8d85a372c89eb3c1ffcfdfb1 | MATLAB | 4,476 | 156 | function folders_on_path=installSIA()
% EXAMPLE USE WITH ARGUMENTS
% folders_on_path=installSIA()
%
% This function automatically intall whole "VoltageImagingAnalisis" package by permanently configuring the paths.
% In the future releases it will also check dependencies for the external packages and programs.
%
% Impor... |
ad5ba779f8c3c85c8827c9fa67be853e20c399377cf2ab2814b022919d9fa0fe | MATLAB | 4,477 | 120 |
%% predicted
clear;
mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble';
sub_pool = [1:28, 30, 32, 33, 34, 35];
mask = MRIread('/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/mask/mask_wholebrain.nii'); %mask_nowm_withsubc mask_wholebrain
mask = mask.vol;
cur_struct = MRIread('/Users/b... |
f871ec00da6042c7800a17b10601d7c98766d8427850eff225b3c8e9f55be5e7 | MATLAB | 4,478 | 128 | function [ons_secs, censored_cardiac_sess, censored_respire_sess, censored_mult_sess, verbose] = ...
tapas_physio_censor_unreliable_regressor_parts_retroicor(...
ons_secs, sqpar, cardiac_sess, respire_sess, mult_sess, verbose)
% Censors unreliable regressor parts (sets them to zero) for RETROICOR
% after downsa... |
8d06f0d977326344a506d6adba0e7306d9480bd80bd85742880861a6c6ea341b | MATLAB | 4,481 | 133 | % EEGDRAW - subroutine used by EEGPLOTOLD to plot data.
%
% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 7/96
% Copyright (C) Colin Humphries, CNL, Salk Institute 7/96 from EEGPLOT
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in s... |
552bef82c3f34084b59da03b069f4e129bfc618f4e4b7f7a5db2e5e6b1996707 | MATLAB | 4,483 | 107 | function simulatedSamples = tapas_physio_simulate_pulse_samples(t, c, ...
nSimulatedSamples, positionString, verbose)
% Simulates samples at start/end of physiological recording by estimating
% pulse template and average pulse rate, and continuing those
%
% simulatedSamples = tapas_physio_simulate_pulse_samples(t, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.