sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ff3cec7dfe10a9f8558edc52818dba49018db1416b80e0c193b29cfe5f5a617a
MATLAB
2,615
82
classdef debiasIntegrationTest < matlab.unittest.TestCase %DEBIASINTEGRATIONTEST End-to-end test for petraToCT.debias. % % DESCRIPTION: % Runs N4ITK bias correction (via 3D Slicer) on the small PETRA % fixture and checks that an output NIfTI is written with % sensible properties. Fil...
57afe17d2acdd62f0c6c0eeacebb52a43762b9f99009d95a33f982d344822d23
MATLAB
2,616
101
function [logp, yhat, res] = tapas_softmax_wld(r, infStates, ptrans) % Calculates the log-probability of responses under the softmax model % with phasic volatility exp(mu3) as the decision temperature and parameters % accounting for win- and loss-distortion of state values. % % -----------------------------------------...
8ebc6f3259f6975a3f55486a52330002ed4df11547e3d139418caed11523938f
MATLAB
2,616
92
function [cellofMats, uIdents] = repackData (identifiers, data) %cellofMats = repackData (identifiers, dataCel) %e.g. repackData (fbmm.szGenotype, fbmm.hist) %takes a datastructure like fbmm, and repackages a data cell from one field %into a nan-padded matrix held inside a cell, one for each identifier type. % Reworke...
3435eda7a544ee9a90f0442cfae1bce8999c8431706a1268fc5b156465ee9b47
MATLAB
2,617
99
function [nbc, data, group_data] = Meta_NBC(MC_Setup, terms, test_images) % [nbc, data, group_data] = Meta_NBC(MC_Setup, terms, test_images) % % You will need: % Inputs: a folder of text files with term labels % % MC_Setup = a database saved from an MKDA meta-analysis % terms = {'pain', 'working.memory', 'emotion'}; % ...
ac39769977048915b31f8c40514f27f7f7a19fea5fe38429a5cb3b99bb823b04
MATLAB
2,617
68
function [results100]=wavesAnalyzerAllFreqs(output) nSbj=16; for ss=1:nSbj ss data=load(['\sbj' num2str(ss) 'rawWaves.mat']); if output(ss).data(1).leftRightFlag(1)==1 leftBlocks=1:2:10; rightBlocks=2:2:10; elseif output(ss).data(1).l...
c813ae9d150e99e53d368f33756e1a13bec8e4279a1b54f2eace8b2067f4a453
MATLAB
2,617
86
function status = IsInZone(positions,zone) %IsInZone - Test when the animal is in a given zone. % % Test when the animal is in a given zone of the experimental setup (typically the % firing field of a place cell). % % USAGE % % status = IsInZone(positions,zone) % % positions position <a href="matlab:help s...
2ff9427276009f985472d8bed270be540db61a8e7a99507279d88612055ee81e
MATLAB
2,618
68
function fear_coactPartner(basename) load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) % load([basicMetaData.AnalysesName '-instReacZNCCG_sig.mat']) load([basicMetaData.AnalysesName '-icaReacZNCCG_sig.mat']) %% for reacType=1%0:1 if re...
0427c7e68f148f71d850111fbbf1a6df22b5c7ee2fc9fd6c187472c469837191
MATLAB
2,619
78
function mra = modwtmra_custom(wpt, wavelet_type) %(Inverse Stationary Wavelet Transform) % % Usage: % mra = modwtmra_custom(wpt, wavelet_type) % % Inputs: % wpt - (Bands x Samples x Channels) matrix % Order: [W1, ..., WJ, VJ] % wavelet_type - 'haar' % % Output: % mra - (B...
609516f4d1b50f6656c8dbb4056d9f1ab89b9f82760e16c3935b321072ee3caf
MATLAB
2,619
64
function [K,dK] = covSum(cov, hyp, x, z) % covSum - compose a covariance function as the sum of other covariance % functions. This function doesn't actually compute very much on its own, it % merely does some bookkeeping, and calls other covariance functions to do the % actual work. % % Note that cov = {cov1, cov2, .....
ea6916bb83acba775830dd04a372ae6adda5803244d1a8a3e14b25e9ea2a3f08
MATLAB
2,619
75
function fear_tripleCCG_beh(basename) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; % basename='~/data/Fear/triple/achel180320/achel180320'; %% load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) %% load([basicMetaData.Ana...
1ac4b2d974283c262aed8b57e3c0e1a4f637f20a0796547b2eff50a66a69a875
MATLAB
2,620
69
function [SpikePhase,PhaseMean,MeanLength,Z,PVal,PhaseLock] = LFP_OffsetPhaseLock(LFPData,SpikeLoc,f1,f2,Fs,MaxLag,StepSize) %% Calculate LFP phase in one frequency band for the spikes with a range of temporal offsets % % Inputs % LFPData -- local field potential data for a single channel % SpikeLoc ...
95adaab8103f6866d31c3e157add698c1aa559b1621cbfb04e5ca5df77c85de2
MATLAB
2,620
67
function x = spatialPattern(DIM,BETA) % function x = spatialPattern(DIM, BETA), % % This function generates 1/f spatial noise, with a normal error % distribution (the grid must be at least 10x10 for the errors to be normal). % 1/f noise is scale invariant, there is no spatial scale for which the % variance plateaus ...
95dfc61a758b72db0a2f5a4aeae3e7a4761607d44da48ab0443b9e473214bb7e
MATLAB
2,620
96
function [exp_avg,exp_avg_null,z]=do_homogeneity(x,mskFile,parcelFile,gmFile,MM) % Input: % x: fMRI data matrix,dimension: time x number of all gray matter voxels % mskFile: subcortex atlas in NIFTI (*.nii) % parcelFile: random parcellation in NIFTI (*.nii) % MM: number of randomizations % Output: % exp_avg: parcellat...
d19321ab1350746c26fa2af1fc3df930f50a42e19f99237e3b523759c6fb3280
MATLAB
2,620
67
% HLP_ARGSTRUCT2LINEARCELL - Linearize configuration output of arg_guipanel % % Usage: % >> cellval = hlp_argstruct2linearcells( cfg ); % % Inputs: % cfg - output configuration structure from arg_guipanel % % Output: % cellval - cell array of output values % % Author: Arnaud Delorme, SCCN & CERCO, CNRS, 2013- %...
0b0d706a3a93aeb74a6012a2b9ccce71552bb493ee3c90f7c07e3cb36d1b3b79
MATLAB
2,621
90
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
c9f855571092ab1577b382b742eb50b0be18c4463358e5c7d1c7e9764679f44f
MATLAB
2,621
67
function out = EN_CID(y) % EN_CID Simple complexity measure of a time series. % % Estimates of 'complexity' of a time series as the stretched-out length of the % lines resulting from a line-graph of the time series. % % cf. Batista, G. E. A. P. A., Keogh, E. J., Tataw, O. M. & de Souza, V. M. A. % CID: an efficient ...
ce00139affc56bd7649988ae6fa5b568b3d67313468e21135f5931aef28a8683
MATLAB
2,621
97
function [outputs,summary]=template_function(arg1,arg2,varargin) % One line short description % % SYNTAX: % outputs=templateBFM(arg1) - use 1 % outputs=templateBFM(arg1,arg2) - use 2, etc. % outputs=templateBFM(arg1,arg2,'option1',option1value,'option2',option2value) - use 2, etc. % % INPUTS: % - arg1 - description % %...
490a1500ca489e94f7512413c279b738655fc12e633c4a371778cdbd7d80cece
MATLAB
2,622
64
function [ylimit] = plot_cnm_struct(cnm_struct,Fs) cnm_plot_options = CNMFSetParms; cnm_plot_options.roi_color = colormaplines; cnm_plot_options.plot_bck_image = true; cnm_plot_options.thr_method = 'nrg'; cnm_dims = size(cnm_struct(1).shape); num_comp = size(cnm_struct,2); com_fov =...
54c92154245e4fedcc6d35de09f53afdcd8b584fae5f3d2be1f9e00c7e511d70
MATLAB
2,622
87
function dbcluster_point_table(cl) % function dbcluster_point_table(cl) % looks for Study or study field in clusters % determines length, and looks for other fields of the same length % uses specified fields in a particular order, then other fields N = fieldnames(cl(1)); % reorder - reverse order, bottom rows are top...
67b857980f78c64a16faa98f61ddd8c1037e08e4ca63e760992e288ae504da15
MATLAB
2,623
70
function [d, d_shuff] = compute_dPrime(SU, alignto, wndw, trialtype1, trialtype2) % Compute the dscriminability index (d') for trialtype1 versus trialtype 2. % Shuffled d' is subtracted % INPUTS: % SU = struct of spiking info for a single recording session % alignto = task event ('COFF' = trial start, 'SON' = LED...
75153f5da5f4e06346429cf6ad08fcb2533d9b226ed3c3d43a7e73a448ce744f
MATLAB
2,624
73
function PlotExtendedData4(datadir, codedir) %PlotExtendedData4 - Plots Extended Data 4. % INPUTS: % datadir - Local directory where ProcessData_ExtendedData4.mat was saved after running ProcessData_ExtendedData4 % codedir - Local directory where code (e.g., published/EstrousRPE/) was saved %% Set up paths s = pa...
225df5dc9feada1a054353309ab6e14b361aa27cff8956a2ad7c6343eaa8e9dc
MATLAB
2,625
80
function res = plugin_urlsize(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 the server ...
06529426909dfa4c2234a9364311f21d288e1cd9a0933e9fb7806c151a006528
MATLAB
2,626
69
function c = tapas_unitsq_sgm_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the unit square sigmoid observation model for binary responses % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
3f503783947766f81df81599d612c4db57f36b0f1ff30e8e17f7adf5590cd6fd
MATLAB
2,626
32
% -stroke '#FFFFFF % -strokewidth 2 % columnsxrows % on surly remap = [1 3 5 7 2 4 6 8]; for p=1:8 unix(sprintf('convert /home/stone-ext4/generic/Dropbox/nsddata/inspections/surfacevisualizations/subj%02dflat_curvature_subj%02d.png -gravity northwest -font FreeMono-Bold -fill black -pointsize 120 -stroke ''#eeeee...
8175abda0754fa3c6795b2ba75b2ec527b0bf99f749318bdce92a0e7b837fa7a
MATLAB
2,626
88
function TractMS2Nii(ng1,ng2) %% This function will %% 1) summary the tract measures of all subjects into a single mat file %% 2) idetify and exclude subjects who failed in tracking all 18 bundles %% 3) translate the data containing eligiable subjects into nii.gz images %% This is an necessory process before performi...
cc5e401676135ccf7e975ec2b4767998947dd5d926513e513912a2bc50b34430
MATLAB
2,626
106
function [fid, tree, dir] = fiff_open_le(fname) % % [fid, tree, dir] = fiff_open_le(fname) % % Open a fif file and provide the directory of tags % % fid the opened file id % tree tag directory organized into a tree % dir the sequential tag directory % % This is a modified version, specific for opening 'littl...
1475cb1bb30474f82422c3dbba6b96ee6e2ab03729bc3b2610065a7668fa9a48
MATLAB
2,628
74
function download_FANSI_toolbox() % One-time setup: check whether FANSI-toolbox (https://gitlab.com/cmilovic/FANSI-toolbox) % is available; if not, download the pinned commit into SEPIA_HOME/external/ % and register its path in SpecifyToolboxesDirectory.m. % % This script only runs when you call it explicitly - it is n...
83a561759a068e66ad511d7945aa9561b27b2e33b0ed665ffbc3cbfb029bb8b6
MATLAB
2,628
73
function kfold_inds = cvpartition_wrapper(ops) %decides how to generate labels for cross-validation % % if ops.kfold > 1 switch ops.cvtype case 'ofc' %use CV partition, but fit it into your current code %decide on stratification groups. currently balance among trial behaviors ...
b995476f82bf86fbe3a98fd9b76c1621a1135e04bceda070ae73c9591e64a320
MATLAB
2,630
74
%% PETH_Scripts output = loadAllUnitData(); %% Draw Single PETH index = 15 ; event = 'valid_IROF'; % ["TRON","first_IRON","valid_IRON","first_LICK","valid_IROF","ATTK","TROF"] TIMEWINDOW = [-1000, 1000]; timepoint = getTimepointFromParsedData(output.BehavData{index}); % Generate spikes cell to feed in to the drawPET...
f0ba912d804d9012701140ae171fed9c3ec09f267972f62a6dae652937945438
MATLAB
2,630
68
function [chi2,actual,expected,colnames] = computechi2(studycount,totalstudycount) % function [chi2,actual,expected,colnames] = computechi2(studycount,totalstudycount) % % 07.22.01 by Tor Wager % % computes a yes/no chi2, where #nos is total - #yesses % can generalize to other things, L/R for example, but must give L o...
5a13fcd815c802816ad54610584c7993afd44f57552724b4a3ecc80b84530869
MATLAB
2,631
69
function [mergedImage, newDimLabel] = ... merge(this, mergeDims, varargin) % Merges multiple dimensions into one dimensions % % Y = MrImage() % mergedImage = Y.merge({'echo', 't'}) % % This is a method of class MrImage. % % IN % mergeDims which dims should be merged into one dim % can ...
e30d642ce138154e0c79ab7bc005dada2edec4c637ace1d2f0d0e5f0991e1de5
MATLAB
2,631
96
function [ output mosaic ] = Orthoview( volume ,varargin) %[ output_args ] = Orthoview( volume ,varargin) % varargin{1} is the position of the slices % varargin{2} is the range of the colorbar % varargin{3} is the type of image 'normal','mip',proj dims=size(volume); if nargin>=2 if isempty(varargin{1}) ...
1ddb6fd7535e7db06f798b2013629f2da516c53df3525ca0e054dc1f4050ed2d
MATLAB
2,632
77
% -------------------------------------------------------------------- function Import_From_Ultravox_Callback(hObject, eventdata, handles) [ultravoxName,ultravoxPath] = uigetfile([handles.data.squeakfolder '/*.txt'],'Select Ultravox Log'); if ultravoxName == 0 return end [audioname, audiopath] = uigetfile({ '*...
5b8cc169d6f3ea338ffd5fd8aeedc3a977c101915bdfaae31acca04ed3509a66
MATLAB
2,632
74
USE_IMAGE_SPECTRA = false; % setup paths addpath('util'); addpath('Bullwinkle'); addpath('signature_detectors'); % load one of the campus images load muufl_gulfport_campus_w_lidar_1; if USE_IMAGE_SPECTRA % load the target signatures load tgt_img_spectra; % order: brown, dark green, faux vineyard green, pea...
69395d92c80377b899a512e226e1b982fa7d74bef2968a7eb2025470b067e8fb
MATLAB
2,632
65
%% Demo of using 'axislabel_rotation' % Orthographic, DataAspectRatio = [1 2 3] figure; axes('box','on','dataaspectratio',[1 2 3],'projection','orthographic'); xlabel('This is an x label') ylabel('This is a y label') zlabel('This is a z label') h = rotate3d; set(h,'ActionPostCallback',@align_axislabel) %% De...
8185dcaab427a9dfc5ef9d8337ec1899ef3adb2821cdc4f84741511dc3b1ced6
MATLAB
2,632
73
function []=wavelet_transformation(Fs, time_ms, num_electrode, LP_Signal_fix, Downsample_rate, t1, t2) %WAVELET_TRANSFORMATION Time–frequency analysis using continuous wavelet %transformation % % INPUTS: % Fs - Sampling frequency (Hz) % time_ms - Time vector (milliseconds) % n...
cd5956a8ce05e26166750057b607f569427192486628e27b1439dc0b59ec5e61
MATLAB
2,633
74
function osp_onSave( ~, ~,gui) %% osp_onSave % Callback function on save button click. Saves MRSCont. % % % USAGE: % osp_onSave( ~, ~ ,gui); % % INPUT: gui = gui class containing all handles and the MRSCont % % OUTPUT: Changes in gui parameters and MRSCont are written into the % ...
d9c827a4dbdc0f179fd4f2c889a48ffbe16a53fa25d4b543388c5ed7db85130d
MATLAB
2,633
90
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
4e906c5131e90b153ac40e79e91e3d7140ce4fc749f49e27d3cc043b5eb6bebe
MATLAB
2,634
77
function preprocessing(mri_lst) % % Input: mri_lst <list of strings> list of fullpaths to MRI images to be % preprocessed % % This function converts the MRI scan to nifti-fileformat, orients the input % MRIs to the ACPC corrdinate system and creates an average MRI image (u...
7f55fa5385419f61f0d0b7c6b091b8876b893cbd04f9a7406b524950cec71ab9
MATLAB
2,634
76
function band_signal = modwtmra_single_band(wpt, wavelet_type, target_band) % MODWTMRA_SINGLE_BAND - Reconstruct a single band from MODWT coefficients % % Optimized function to reconstruct only ONE wavelet band instead of all bands. % Eliminates the need to allocate the full (Bands × Samples × Channels) MRA array. % % ...
ed986363cc7837facb709d3b11ce866f597aee4416d09abb4351d0dce1704543
MATLAB
2,634
72
% STD_FINDGROUPVARS - find group vars in STUY structure % % Usage: % >> % % Inputs: % % Outputs: % % See also: % pop_studydesign, % % Author: Arnaud Delorme % Ramon Martinez-Cancino % % Copyright (C) 2014 Arnaud Delorme, % % This file is part of EEGLAB, see http://www.eeglab.org % for the document...
e26eff017f3c3c6c04192ed8f37c8adeaf4361ee7fa67b6eff23521b85571624
MATLAB
2,635
89
%% ExportQMSHubHeaderIOWrapper(input,outputDir,b0_input,b0dir_input,voxelSize_input,te_input,flag) % % Input % -------------- % input : either DICOM directory or NIfTI file fullpath % outputDir : directory that store the output header file % b0_input : user field strength input % b0dir_inpu...
0d132b05992070263046f33d581484e12d15872830045f3ca345d1814fe0f29e
MATLAB
2,636
67
clear all, close all n1=10; n2=5; % number of data points from each class n1/n2 sc=1; % change the scale of the initial problem % 1) draw data from two Gaussians S1 = eye(2); S2 = [1 0.95; 0.95 1]; m1 = [0.75; 0]; m2 = [-0.75; 0]; randn('seed',17); rand('seed',17...
5ae6eea482445c1f1d70fefd1942523ca526c146dab54434aa590bb19fc1f8f8
MATLAB
2,636
56
% The file "LORETA-Talairach-BAs.csv" was downloaded from the LORETA-KEY % website. It was convreted using this script to a Matlab source model file % Original documentation: % The file "LORETA-Talairach-BAs.csv" is plain text (ascii), but suitable for excel. % On the first line are the column ...
764bb834a79ad8b6b3177525322200b69ec6f1118cfd4077f09bcfcf8e0e61d3
MATLAB
2,637
100
function FigureS7(datadir, codedir) %FigureS6 - Alternative retrospective models fail to capture both fast % and slow trial initiation time dynamics at block transitions. % datadir = directory of dataset % codedir = director of code %% Set up paths s = pathsep; pathStr = [s, path, s]; onPath = contains(pathStr,...
3f0771ae43529e060d3933c20b70efada673dcb35b17446c7c5d637760badd93
MATLAB
2,638
92
function vl_testnn(varargin) %VL_TESTNN Run MatConvNet test suite % VL_TESTNN('option', value, ...) takes the following options: % `cpu`:: true % Run the CPU tests. % % `gpu`:: false % Run the GPU tests. % % `single`:: true % Perform tests in single precision. % % `double`:: false % Perform tests in do...
1f6e1971a8a27dd5a671f1f0929dfd57c846a99dd0313bcbd8ba4a4535a211a3
MATLAB
2,639
57
function [AmpXCorr,Lags,MaxXCorrLag,AmpXCorrSig] = LFP_AmpXCorr(LFPData1,LFPData2,Fs,FreqBand,MaxLag) %% Calculates the cross correlation of the amplitude envelope between two LFP channels in specified frequency band % % Inputs % LFPData 1&2 -- LFP data from different regions to be compared % Fs -- S...
3de10e245ffef17a872173b55cda9998c31cb42b806f1ed53bff12bc7e4724dd
MATLAB
2,640
88
%% function save_nii_img_only(headerfilename,savefilename,images) % % Description: Wrapper script for saving with target image header % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 24 January 2017 % Date modified: 28 June 2020 (v0.8.0) % function save_nii_img_only(headerfilename,savefilename,img,data...
7e03346894b45582a58131ad4d7245e3aab334b538cb2b816935edf52c0e65b7
MATLAB
2,640
92
function Test_fixedrank_spectahedron() % Test_fixedrank_spectahedron() % The problem being considered here is the fixed-rank DSPCA % All intputs are optional. % % This file is part of Manopt: www.manopt.org. % Original author: Bamdev Mishra, July 11, 2013. % Contributors: Nicolas Boumal % Change log: clear al...
92c9092ffe5748f3298b9fb78348c96c8348348aebce71b72fe6d35b48de73ac
MATLAB
2,640
103
addpath('../../networktools') %% load network data NT = NetworkObj('../testing/linear2.net',struct('dim',2)); NT.interpolateEdgePaths(2); NT.setCumEdgeLen(); %% load snapshot data resdir = '../testing/'; runname = 'testfptCone'; filename = [resdir runname '.mesh.txt']; MSH = MeshObj(filename); snapfile = [resdir ru...
a93ea6cfd3d72dfd1848cce98e8f53bc56c8c7e22e6f27e048261a0095270ec4
MATLAB
2,640
90
%% Making the ensemble raster load('/home/octodon/Documents/MATLAB/FastEnsDet/4exps/4_exps_6_conds_concatenated.mat') nexps = 4; templates = arrayfun(@(x) load(['v4_templates_exp_',num2str(x),'.mat']),1:nexps,'uni',0); templates = {templates{1}.templates,templates{2}.templates,templates{3}.templates,templates{4}.templ...
eb4d21eb31d403b4dfb6ae657a36171eb9e380d3a3ef45eb5b4a74f4313ffaf8
MATLAB
2,640
79
function this = MrDataNd_constructor(this, testVariantsDataNd) % Unit test for MrDataNd constructor with different input variants % % Y = MrUnitTest() % run(Y, 'MrDataNd_constructor'); % % This is a method of class MrUnitTest. % % IN % % OUT % % EXAMPLE % MrDataNd_constructor % % See also MrUnitTest % Author: ...
52dfc502c09e26d1d4a9cd8ec959a6d3050b7eb8e9cdcbd349c50b9de4fada07
MATLAB
2,641
96
%% Preprocessing script for AD_UCSF MEG data % This script performs the following preprocessing steps: % 1. Load raw MEG data % 2. Resample data to 200 Hz % 3. Detect and interpolate bad channels % 4. Segment data into 2-second trials % 5. Reject bad trials based on amplitude thresholding % 6. Save the preprocessed dat...
c408fddec633f290d0dd842fe1a60450409065f5bb90f8f31601db6134523386
MATLAB
2,641
63
%VL_NNPOOL CNN poolinng. % Y = VL_NNPOOL(X, POOL) applies the pooling operator to all % channels of the data X using a square filter of size POOL. X is a % SINGLE array of dimension H x W x D x N where (H,W) are the % height and width of the map stack, D is the image depth (number % of feature channels) and N...
09de7ed31363eec2573b970eacfe0e795eef57b10c1f2fb29f2e2bbe3692cdac
MATLAB
2,642
82
% Script tapas_physio_example_multi_subjects(input) % Shows how to generalize single-subject batch for all subjects % % % See also tapas_physio_new % Author: Lars Kasper % Created: 2015-07-31 % Copyright (C) 2015 TNU, Institute for Biomedical Engineering, % University of Zurich and ETH Zurich. % ...
21e74dcdcc55f77afb99e1da4393cd29b261e8f5321e20c1fb43a3e63b8e73a7
MATLAB
2,642
86
function theta = generate_ori_map(Nx, Kc, varargin) % GENERATE_ORI_MAP Orientation map generator (Kaschube et al., 2010, Eq. 20). % % Syntax % theta = generate_ori_map(Nx, Kc, Name,Value, ...) % % Description % Implements the orientation map synthesis from Kaschube et al. (2010) Supp. % Materials, Eq. 20. Produc...
c82b9f2495b719aba215229de19bbf8ecfa944b92538cd00e0edaf28eb61daee
MATLAB
2,643
88
function testviolinplot() figure(); % One could use tiled layout for better plotting them but it would be % incompatible with older versions subplot(2,4,1); % TEST CASE 1 disp('Test 1: Violin plot default options'); load carbig MPG Origin Origin = cellstr(Origin); vs = violinplot(MPG, Origin); plotdetails(1); % TES...
e602e7068020344b132184d88745294c90c080a24122bc94bac839ed0eaf81d4
MATLAB
2,645
90
%% unitTest.m % This function performs a command line unit test based on the jobTesting.m file in the % ci folder. All Osprey modules are tested in dependence of the % included dataset. You can change the jobTesting.m file according to your desired % needs. The results unittest class includes detailed informati...
678b73ec76f1171105d08ec3566e78ace0a8221600e4c6a877d5914768429618
MATLAB
2,648
76
function sortOrder = drawPeakSortedPETH(zscores, TIMEWINDOW, TIMEWINDOW_BIN, ax_hm, ax_hist, options) %% drawPeakSortedPETH arguments zscores (:,:) double % vertical vector is one data. sorted horizontally. TIMEWINDOW (1,2) double TIMEWINDOW_BIN (1,1) double ax_hm matlab.graphics.axis.Axes ax_hist ...
b05f3136adf2796dd6ad0d5cf19e301753dbd73889b8a73edfd46ef1c41158f0
MATLAB
2,648
76
% osp_extract_three_plane_image_overlay.m % Helge Zoellner, Johns Hopkins University 2021. % % USAGE: % [three_plane_image] = osp_extract_three_plane_image(ImageFile, MaskFile); % % DESCRIPTION: % Creates a SPM volume containing a voxel mask with the same dimensions % as the SPM volume containing a structural image. Th...
b9abf277d984511795e94b51567bb3ac3b88c9db38a35ef45106a968e2500c5d
MATLAB
2,648
60
function ccg_data = ccg_to_attributes_V1(ccg_output, flag) ccg_types = ["ccg"]; for ccg_type = 1:length(ccg_types) ccg_data_t = struct; ccg_data_t.ccg_control = ccg_output.(strcat(ccg_types(ccg_type),'_control')); ccg_data_t.ccg_jitter = ccg_output.(strcat(ccg_types(ccg_type),'_norm_jitter')); ccg_data...
a2c6d758569a4317647f0de0a483c2124b445c7e6b3afedba5090eb17956f830
MATLAB
2,649
79
function outputImage = k2image(this, applicationDimensions) % Computes image representation (scaled/circshifted FFT) of k-space per slice % by applying transformKspaceToImage; % % Y = MrImage(); % k2imageY = Y.k2image(applicationDimensions) % k2imageY = k2image(Y, applicationDimensions); % % % This is a method of...
c31915b705671f40427b9cd82879685f0f5bcdb45dac93957e997ef008b7c287
MATLAB
2,649
77
function subgrad = getSubgradient(problem, x, tol, storedb, key) % Computes a subgradient of the cost function at x, up to a tolerance % % function subgrad = getSubgradient(problem, x) % function subgrad = getSubgradient(problem, x, tol) % function subgrad = getSubgradient(problem, x, tol, storedb) % function subgrad =...
694cd7f3c98f134c586f13baf520be0785f9090797cc6f34223057cb990d6991
MATLAB
2,650
89
function cl = pmap_threshold(pimg,searchmask,pt,varargin) % cl = pmap_threshold(pimg,mask image,p-threshold,[image with values to extract]) % % Threshold a p-value image (pimg) and display suprathreshold blobs % Only display significant values included in the mask image (img2) % % p-threshold is the p-value threshold ...
a7d7addd8e1342c3db9bdcab87c65359e80e22192ef4044d4dfc1a474704c24c
MATLAB
2,650
94
function im=mat2im(mat,cmap,limits) % mat2im - convert to rgb image % % function im=mat2im(mat,cmap,maxVal) % % PURPOSE % Uses vectorized code to convert matrix "mat" to an m-by-n-by-3 % image matrix which can be handled by the Mathworks image-processing % functions. The the image is created using a specified color-map...
839011bdf34ab455ba759d15d8f6e4bafeebbc430427f803610097cb6df00794
MATLAB
2,651
96
function [RDMs,nRDMs]=unwrapRDMs(RDMs_struct) % unwraps dissimilarity matrices of a structured array (wrapped RDMs) with % meta data by extracting the dissimilarity matrices (in square or lower % triangle form) and lining them up along the third dimension. (if they are % already in that format they are handed back unch...
da21757cfbc55a090c4297b0c76ff11dacc192d170bfc684c9ad472f17bc3112
MATLAB
2,653
68
% Bang et al (2020) Private-public mappings in human prefrontal cortex % % Reproduces Figure 1-figure supplement 3 % % The visualisation is based on the analytical approach developed in "Bang % et al (2017) Confidence matching in group decision making" % % The visualisation is based on an example subject (subjec...
29f9391c7d900ba92de3991fea8fef340bdd3905250177c29ab880d13eb21cbb
MATLAB
2,654
81
function fear_icaReacStrWake_optShfit(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; param.templateSes=2; param.threshold=25; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) %% param=parseParameters(...
e18f7bfc8fb30d900322d1571b2630491b85714b4c8efc4ac50275cd5918045f
MATLAB
2,654
73
function [rate,dt,nt,op,S0,M,ds,dif,tp,T,K,SName,Cb,clim,NameMask,unittime,unitconc, bounds,freq]=LoadParam(app) % Extract selected tab title Tab = app.TabGroup.SelectedTab.Title; if strcmp(Tab,'Multiple Simulations')==1 % Extract values for multiple simulations unittime=app.Units_2...
11fe0e85e9a241bae493c2457343b9204a8f5fdea70d79ead4f1a7fc7e6f3a25
MATLAB
2,655
79
%% save_json_sidecar(niiFilename, info) % % Input % -------------- % niiFilename : full filename of the NIfTI output the sidecar describes % ('*.nii' or '*.nii.gz'). The sidecar is written next to % it with the same basename and a '.json' extension % info : (optional) structur...
30ac24231780586df7d399e12a1508fc952c510ae7ae003c7cd697cf6d45526c
MATLAB
2,655
65
function res = permute(obj, dims); if length(dims) > 3 error('Max 3 dimensions for permutation'); elseif length(dims) == 2 error('Permutation with 2 dimensions: use transpose instead'); end newFileName = mmo.getnewfilename; copyfile(obj.dataFile, newFileName); res = obj; res.dimensions = obj.dimensions(dims)...
9de9ee1299e5659b2ac2801f94655bdd33ca46363e789bd0ec99b934a71247be
MATLAB
2,657
75
function out = op_add_analysis_provenance(in,fields) %% out = op_add_analysis_provenance(in,fields) % This function adds analysis provenance to the the NIfTI header % extension for NIfTI-MRS following the standard described in "Clarke WT, % Bell TK, Emir UE, Mikkelsen M, Oeltzschner G, Shamaei A, Soher BJ, Wils...
55439b74b5b6770af9d7e3e316e9cab3401272a2d7b6fac04006b1cd28ca4fae
MATLAB
2,659
69
% MEMMAPDATA - create a memory-mapped data class % % Usage: % >> data_class = memmapdata(data); % % Inputs: % data - input data or data file % % Outputs: % data_class - output dataset class % % Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 % Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD % % ...
b90ee0f004420e714734a779056c29fe3fd0f2ce973fc09e02af29c1f5aee8a0
MATLAB
2,660
74
function [] = plotBetasSwarm(beta, colors) % This code reproduces the analyses in the paper % Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven % by decision uncertainty and alters serial choice bias. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software an...
f0f881ad0aa6c4cd162d3311f6c45dfa551b2fade06898930967a1ce25f69df5
MATLAB
2,660
63
% demonstrate usage of classification % % Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2013-10-16. clear all, close all %% SAY WHICH CODE WE WISH TO EXERCISE id = [1,1]; % use Gauss/Exact id = [1,2; 2,2; 3,2]; % compare Laplace id = [1,3; 2,3; 3,3]; % study EP id = [1,5; 2,5]; % look into KL (takes quite...
0f9170a59dc8a017038b38515616c2e56b25bf2de89274f959703c9d10eb8b3e
MATLAB
2,663
102
function [r,normr,nre,s] = reorth(Q,r,normr,index,alpha,method) %REORTH Reorthogonalize a vector using iterated Gram-Schmidt % % [R_NEW,NORMR_NEW,NRE] = reorth(Q,R,NORMR,INDEX,ALPHA,METHOD) % reorthogonalizes R against the subset of columns of Q given by INDEX. % If INDEX==[] then R is reorthogonalized all co...
8ad57b1072fb98db4189b93b4be6391cd141af0cbf90a63f3a922260612d83e6
MATLAB
2,664
79
function [Px, F, T] = PSD_v1(signal, time, labels, setting) % Function computes power spectral density (PSD) in dB from trials data for % each channel. % INPUTS=================================================================== % signal... EEG (time X channel X trials) % time... time vector in seconds (time X 1 X 1) % ...
41ef6ed1b8d816dd3d159306e4e5feee10a49b82be67c97bca8ed6c612c31227
MATLAB
2,665
63
%VL_NNPOOL CNN poolinng. % Y = VL_NNPOOL(X, POOL) applies the pooling operator to all % channels of the data X using a square filter of size POOL. X is a % SINGLE array of dimension H x W x D x N where (H,W) are the % height and width of the map stack, D is the image depth (number % of feature channels) and N...
89e65145f69c86c8433cd926a1482616208534a94d3531a72aa948b3f4038c09
MATLAB
2,665
63
function samples = Sample(histogram, n) % sample from distributions. % EXAMPLE % [h,t] = hist(spikes(:,1),resolution); % samplespikes = t(Sample(h,1000)); % NOTE: multiple histograms may be provided in different columns of h. % % By Raly Todorova (2016), inspired by Dahua Lin's discretesample (2008) if nargin<2 e...
f2e1b08a5ce348fe4f6afa3feb2357f5577cdfb71d1545f08be5734e2cc1d6b2
MATLAB
2,665
68
%{ # Reference map -> mice.Mice ref_idx : smallint # reference map index for each animal --- -> experiment.Scan pxpitch : double # estimated pixel pitch of the reference map (microns per pixel) ref_table : varchar(256) # reference table ref_map ...
0cbecc874e7a139dcaba3bbcc68090b2d0bae39ff66cd4e577d914cb40b92160
MATLAB
2,667
65
% createApertures % Creates a stimulus and fixation apertures. % % Syntax % [stimulus_aperture, fixation_aperture] = createApertures(p, w) % % Input Arguments % p – structure containing scan parameters % w – structure containing window parameters % % Output Arguments % stimulus_aperture – stim...
4c477fab71f0a5fbab09f809cebdacd64cde63a9acc8d3afe150ff9483a54f06
MATLAB
2,667
85
% Script demo_smooth % Shows smoothing % % demo_smooth % % See also % Author: Saskia Bollmann & Lars Kasper % Created: 2018-05-27 % Copyright (C) 2018 Institute for Biomedical Engineering % University of Zurich and ETH Zurich % % This file is part of the TAPAS UniQC Toolbox, which is released ...
ea4d12b00bdbeff6998ba8aaaf254dd0449ed64faaa7ac633bb5daa115074096
MATLAB
2,667
70
function cleaned = RemoveArtefacts(lfp,times,varargin) %RemoveArtefacts - Remove artefacts from local field potentials. % % Remove large deflections such as stimulation artefacts from local field % potentials, i.e. flatten the data around the times of artefacts. % % USAGE % % cleaned = RemoveArtefacts(lfp,times,<o...
5422da7607f373ebcbf868976692ef10a930b860e5eb226154061ee47e726fe8
MATLAB
2,670
79
function OptimHistory = InflowAlgorithm_allparam(param0, flow, maxFlow, minFlow, maxPressure, ... minPressure, ntp, nv, l, u, sc, irun,Qdat) % Set up shared variables with OUTFUN OptimHistory.x = []; OptimHistory.fval = []; %% Contrained optimization with gradient based method (sqp algorithm) options=opti...
d6d30495ad5570301cbe4bd92a3b598ac6307f7cd81dbe0684a03bcaca1765f0
MATLAB
2,670
87
%Creado por Luisca Mayo09. Para hacer completamente objetivo el proceso de %las ventanas de tiempo de cada pico y para facilitar la elección de los %estados en el LLE. %SRasRen() genera una matriz nXm donde n:Número de células; m:número de %picos tomando cada pico como los cuadros con Sindex=1 del Sindex con %1 frame...
e871ae739791c2df66dc73e0de17b1d62ea5ad8a6f2799375a0e673157caed32
MATLAB
2,670
57
% Scripts to remove residual B1 bias from T1 maps calculated with the % MP2RAGE sequence correction of T1 estimations as sugested on: % Marques, J.P., Gruetter, R., 2013. New Developments and Applications of the MP2RAGE Sequence - Focusing the Contrast and High Spatial Resolution R1 Mapping. PLoS ONE 8. doi:10.1371/jou...
25f57eb750535d2fc72c3be855ae6e800dcd6a4efffe75394a05e10c15bd6c24
MATLAB
2,671
101
function [err, Itrans] = AFNI_IndexChange (Info, Iorig, Direction, DispOrient) % % [err, Itrans] = AFNI_IndexChange (Info, Iorig, Direction, [DispOrient]) % %Purpose: % Change the AFNI Index system between the display's and AFNI's coordinate system % % %Input Parameters: % Info: The data structure output from Bri...
abc81e08ec2648d951b6f4cc6996d9faf0e6eec332c269c6dbac3d393c710470
MATLAB
2,671
64
% eegplugin_firfilt() - EEGLAB plugin for filtering data using linear- % phase FIR filters % % Usage: % >> eegplugin_firfilt(fig, trystrs, catchstrs); % % Inputs: % fig - [integer] EEGLAB figure % trystrs - [struct] "try" strings for menu callbacks. % catchstrs - [struct] "catc...
c2a57e2cee27a2698409b3f43101247859dfb3b569eed3b156ea4f339b59a028
MATLAB
2,671
94
addpath(genpath(pwd)); LoadData; load(fullfile( 'results', 'doseResponseData.mat')); reproduceFig2 = 1; % Simulated annealing algorithm is used to search a combination of odor and % ORN order to best visaulize the heatmap. if reproduceFig2 % Because SA is a stochastic algorithm, the result may be different for e...
f95c13eb06f9ff303aa4550635dd4e148cff59a67ab4ce78e83fc534c43c43b8
MATLAB
2,671
66
function [Q, R] = qr_unique(A) % Thin QR factorization ensuring diagonal of R is real, positive if possible. % % function [Q, R] = qr_unique(A) % % If A is a matrix, then Q, R are matrices such that A = QR where Q'*Q = I % and R is upper triangular. If A is real, then so are Q and R. % This is a thin QR factorization i...
0f1cee29e46b75b0adba628065635903d112adce46260011142bd91f4eec40f1
MATLAB
2,672
74
%% [chi] = Wrapper_QSM_StarQSM(localField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData) % % Input % -------------- % localField : local field map (tissue fields), in Hz % mask : signal mask % matrixSize : size of the input image % voxelSize : spatial resolution of each dimension of the da...
50304779a2581dd25e6b5114809265a99f808176c78a77dccc24cc79062ebaa2
MATLAB
2,672
78
function [vonl2h,vonh2l,mindist]=surfing_lowres2vonoroi(c1,c2,f2,r) % constructs a Vonoroi mapping on a high resolution surface, using a low % resolution surface as seed points and geodesic distance measure. % % [L2H,H2L,D]=SURFING_LOWRES2VONOROI(CLOW,CHIGH,FHIGH[,R]) % INPUTS: % CLOW: 3xNLOW coordinates for N n...
5d6f128672b3c5cc4d92549755a59e6ca8b88df731758d7ebf693f5a41e6c192
MATLAB
2,672
54
% Inference methods: Compute the (approximate) posterior for a Gaussian process. % Methods currently implemented include: % % infGaussLik Exact inference (only possible with Gaussian likelihood) % infLaplace Laplace's Approximation % infEP Expectation Propagation % infVB Variati...
bdae41314b5c191963d12d86fd65385631002c96cf96a9e45c57c9ce368a2fd3
MATLAB
2,672
30
% EEG_OPTIONS - eeglab option script % % Note: DO NOT EDIT, instead use POP_EDITOPTIONS or the menu % /File/Maximize memory in EEGLAB gui % STUDY and file options (set the first checkbox if you intend to work with studies) option_storedisk = 0 ; % If set, keep at most one dataset in memory. This allows pr...
a56dd91022665ff070dda04249ccd61474f74324af84f602514714f0c4d5e9c2
MATLAB
2,674
81
function [nTestFailed, nTestTotal, testResults] = tapas_physio_test(level) % Interface of PhysIO-Toolbox-specific test functions to global tapas_test % % [nTestFailed, nTestTotal] = tapas_physio_test(level) % % IN % level Depth of testing required % Approximate run time per level % ...
147a06c4e6334717bbb81c3afeb2508d99be78dececce1221242698c09e36d9d
MATLAB
2,675
84
function y = tapas_physio_read_physlogfiles_philips_matrix(fileNamePhyslog) % reads out complete numerical matrix from SCANPHYSLOG-file % Physlog file version 1: [nSamples,10] % Physlog file version 2: [nSamples,11] % % IN % fileNamePhyslog % string, filename of SCANPHYSLOG-file % OUT % y [nSamples...
865fef64d55e2654dbefa057198678dfdbcfc4f1f0ede3435a7c061c64e06dee
MATLAB
2,675
74
% NUMDIM - estimate a lower bound on the (minimum) number of discrete sources % in the data via their second-order statistics. % Usage: % >> num = numdim( data ); % % Inputs: % data - 2-D data (nchannel x npoints) % % Outputs: % num - number of sources (estimated from second order measures) % % R...
91d23724d2c3ec768263e190aa1b38fa621300f4cab9e9c540c1bd176f508a52
MATLAB
2,675
91
function X = tapas_uniqc_dicom_mosaic2image(pathDicom) % Computes MrImage from Dicom-Folder with mosaic images (over slices), one % image per volume % % X = tapas_uniqc_dicom_mosaic2image(pathDicom) % % IN % pathDicom folder with mosaic-style *.IMA files % OUT % % EXAMPLE % tapas_uniqc_dicom_mosaic2image % % ...
a693356fd4d46c72b6c703c8eda7e8e405d5b2a6c41556084aba31c412ebc60a
MATLAB
2,675
82
function plotChannel2Axes_complexBins(ampPhiBins, plotInfo) % plots the tuning bins in: ampPhiBins [ampBin x phiBin] % uses polar coordinates (amp x phi bins) for each channel % complex predictor (e.g. 2D velocity), real response (e.g. high-gamma iEEG channel) % axes position defined in 'plotInfo' % ampPhiBins = 2D: [...
277235d651f31c43a3c8b5ef29c225543adbd444aeb993d728957ba2ee8806b3
MATLAB
2,677
69
function EEG = iclabel(EEG, version) %ICLABEL Function for EEG IC labeling % Label independent components using ICLabel. Go to % https://sccn.ucsd.edu/wiki/ICLabel for a tutorial on this plug-in. Go % to labeling.ucsd.edu/tutorial/about for more information. To report a % bug or issue, please create an "Issu...