sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
9ef076052df82fb95a89c2d8ceba74d61ff6b0395cc3a924dc22e0c48dd2ecca
MATLAB
3,050
88
function outputImage = perform_binary_operation(this, otherImage, ... functionHandle) % Performs binary operation (i.e. 2 inputs) on this and a second image % for given dimension and returns a new output image % % NOTE: If voxel dimensions of 2nd image do not match - or a scalar is % given as 2nd argument - data in...
0ac012bf29e8a3f7563a9da52fdc37fd486e98afac68e15f9a85fb59332c04fe
MATLAB
3,051
100
% Script demo_split_complex % splits complex nD data in (n+1)D magn/phase or real/imag % % demo_split_complex % % % See also % Author: Saskia Bollmann & Lars Kasper % Created: 2018-05-22 % Copyright (C) 2018 Institute for Biomedical Engineering % University of Zurich and ETH Zurich % % This fi...
47c8547e2c50a8fda8ac5ff57a6e4a11735821e29ac902f6447088fe5a698d53
MATLAB
3,051
64
function varargout = binaryEPGP(hyper, covfunc, x, y, xstar) % binaryEPGP - The Expectation Propagation approximation for binary Gaussian % process classification. Two modes are possible: training or testing: if no % test cases are supplied, then the approximate negative log marginal % likelihood and its partial deriv...
54604efb5e58a17e03f2a1004ed070f6a7ad583123f557be59ba184aba22b4dc
MATLAB
3,051
71
% STD_CHANINDS - look up channel indices in a STUDY % % Usage: % >> inds = std_chaninds(STUDY, channames); % >> inds = std_chaninds(EEG, channames); % >> inds = std_chaninds(chanlocs, channames); % Inputs: % STUDY - studyset structure containing a changrp substructure. % EEG ...
5a848b3f878504970f4d944c824402c19c8d72528afc5d30988e01a16d5274f3
MATLAB
3,053
107
function [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, varargin) % Kalman filter. % [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, ...) % % INPUTS: % y(:,t) - the observation at time t % A - the system matrix % C - the observation matrix % Q - the system covariance % R - the o...
8d623d8c24156dcbd5f66272a212c230c8b30b2fc58e494a1da3fe9d6bc1c070
MATLAB
3,053
113
function doCoactAnalysis(rootDir,sessionList) if ~exist('rootDir','var') || isempty(rootDir) rootDir='~/data/Fear/triple'; end if ~exist('sessionList','var') || isempty(sessionList) sessionList={ 'achel180320' 'booyah180430' 'chimay180612' 'duvel190505' 'estrella18...
c1c30ebc11d8c22b724ee427ed428005c2d94ab8a09b49afa5d592f63da20b51
MATLAB
3,053
82
function N = tangentspacefactory(M, x) % Returns a manifold structure representing the tangent space to M at x. % % N = tangentspacefactory(M, x) % % N defines a (linear) manifold that is the tangent space to M at x. Points % are represented as tangent vectors to M at x. Tangent vectors are also % represented as tangen...
face0942e34aa2b3b38499d0c607e752d69ed7a929ad32f3f670043feec35b9a
MATLAB
3,054
107
function sero_srr_plot_sampling_stats_v3(tr, b, w) %% sero_srr_plot_sampling_stats_v3 Visualize TR & b-value sampling statistics % sero_srr_plot_sampling_stats_v3(tr, w, b) makes a 3×2 figure showing: % (1) shot×slice log-TR image % (2) sampling density vs. slice (line plot) % (3) TR distribution heatma...
8cba7f1b8d718f2bed96d618a3da733f7ba5498294883ff8b3c3f41ca240efef
MATLAB
3,055
84
% Analyses of the EMPRISE data set % by Joram Soch <soch@cbs.mpg.de> clear %%% Session EDY7-visual: BayespRF, 2023-09-11 ############################# % specify analysis addpath(genpath('C:\spm\BayespRF\toolbox\')); dirs = load('project_directories.mat'); subj_id = 'EDY7'; session = 'visual'; mod_name = 'pRF'...
086c2bcbee0691abea26fc5389cf486d1e7041a6f0c26d2c88cb987dd628090c
MATLAB
3,056
86
function this = analyze_rois(this) % Extracts specified rois (masks) from specified images, and computes statistics % % Y = MrSeries() % Y.analyze_rois(inputs) % % This is a method of class MrSeries. % % IN % .parameters.analyze_rois. % nameInputImages Cell of strings or string with image na...
0f8b61e915baee343d9e7aeca98b1f5ac1e13514d89d33f27dcb5d03b064008c
MATLAB
3,056
88
function labels = run_ICL(version, images, psds, autocorrs) %% check inputs if any(strcmpi(version, {[], 'default'})) version = ''; elseif any(strcmpi(version, 'lite')) version = '_lite'; elseif any(strcmpi(version, 'beta')) version = '_beta'; else error(['Invalid network version choice. '... ...
923394b4289ad6b75a969fb4d0d0db55667cc8f66f4f2b10dc514dc08f94c66a
MATLAB
3,056
118
function S=reducesim(S,minLimit,partition,scatter,scatterLimit) %function S=reducesim(S,minLimit) % or %function S=reducesim(S,minLimit,partition,scatter,scatterLimit) % %PURPOSE % %To reduce the number of lines that are drawn when the similarity %matrix is visualized. That is, to set similarities below certain %thres...
3502d90418d9f256b8d55f945abef2bd672d2bc9d509cc00c13cf215c1260505
MATLAB
3,057
76
% EEG_GLOBAL - declare global EEGLAB variables. These variables are % used only as global by the main function EEGLAB, % the function POP_REJMENU and the history EEGH function. % % Global variables: % EEG - structure containing the current dataset % ALLEEG - array o...
77da623845bf36a29fb6f90dc6afd8b8fc98211b658c433b3882d21fdc25f6cd
MATLAB
3,057
70
% SCANFOLD - scan folder content % % Usage: % >> [cellres textres] = scanfold(foldname); % >> [cellres textres] = scanfold(foldname, ignorelist, maxdepth); % % Inputs: % foldname - [string] name of the folder % ignorelist - [cell] list of folders to ignore % maxdepth - [integer] maximum folder depth...
628c7238f8c0056979b18ebc65fd52460659d11c89147f08e0001b2a0135260d
MATLAB
3,058
69
function [Out] = GetPercentageCorrect(sn, nTrialsPerCondition) %% Info % This is a wrapper function that takes in the subject data and get the % percentage of correct responses for each loudspeaker and spectrum type % Input: 'sn' = subject data struct % 'nTrialsPerCondition' = Number of trials per condition % ...
f02688fee6cd4b73833850760f402eb8a602531092e064a3986fe45ad6dd7baf
MATLAB
3,058
76
function [all_spikes, unique_idx, intersect_matrix] = mergeSpikes(spike_times, option) % Merges spike times across detection methods. % TIP: to get spike waveforms corresponding to the merged spike times call e.g.: % [~, spikes] = alignPeaks(spike_times.all, filtered_trace, 25, 0, 1, 10, 10); % Parameters % ------...
8280393e799a0ad1597685bed092d339c9ee6057b673fb01ffacbcd8fdfa14be
MATLAB
3,059
107
function hhh=tapas_uniqc_hline(y,in1,in2) % function h=hline(y, linetype, label) % % Draws a horizontal line on the current axes at the location specified by 'y'. Optional arguments are % 'linetype' (default is 'r:') and 'label', which applies a text label to the graph near the line. The % label appears in the same ...
fa72ecf72567aeb17ae240242ee83a0941f45f8d9ef5b235a8a5f9ebd123f19d
MATLAB
3,059
104
function cmd=surfing_suma_makespec(varargin) % Makes a AFNI SUMA spec file and script to start SUMA % % SURFING_SUMA_MAKESPEC('aligndir',D,surfvolalfn',S,'icold',I) % % INPUTS: % D Directory that contains surface files % S Anatomical file (e.g. 's01_SurfVol_fix+orig') % I MapIcosehedron number of s...
f5f6dcf34fb19f84ea6ac15ecacdc68f54bf95576b66ff886dc861f67f16ab90
MATLAB
3,063
92
function map = vega10(N) % Colormap from MatPlotLib 2.0. For attractive plots using the ColorOrder. % %%% Syntax: % map = vega10 % map = vega10(N) % % For MatPlotLib 2.0 improved colormaps were created for plot lines of % categorical data. The new colormaps are introduced here: % <http://matplotlib.org/2.0.0rc2/users...
dd4f0077935fb9be195a7480994604ebd75bee87f25186fd54cd9516733a86e5
MATLAB
3,064
105
function [posa,pos,vel] = fixPos2d(file,dSamp,mode) %% take position info from whl file and preprocess it if ~exist('dSamp','var') dSamp = 1; end if isstr(file) pos = importdata(file); else pos = file; end pos(pos == -1) = nan; reject = 0; if exist('mode','var') && mode thresh = 1.1; rad = pos(:,1...
e63cbf4ba3ba89d038be20298dc73dcfa1068166602f32569214f34431418ed5
MATLAB
3,066
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
f67e9f8cda85fefb243bf6e591029e8ce3ef58b2fbb73dfd4fee6c75b5b7d639
MATLAB
3,067
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
0fcd7d29bbea48be252bf9aaf31a4882fdc6c247f65b50ae295bd3c5452e1126
MATLAB
3,068
67
function varargout = covMatern(mode, par, d, varargin) % Matern covariance function with nu = d/2 and isotropic distance measure. For % d=1 the function is also known as the exponential covariance function or the % Ornstein-Uhlenbeck covariance in 1d. The covariance function is: % % k(x,z) = f( sqrt(d)*r ) * exp(-s...
482b15c0309b5ca1a6007e11154720604999a22fc8ab9ca06671fac979bf321c
MATLAB
3,068
104
function [commitID,git_lastcommit,options]=gitLastCommit(varargin) % EXAMPLE USE WITH ARGUMENTS %[git_lastcommit,options]= gitLastCommit() - assuming path to the repo %where function is located, two levels up %[git_lastcommit,options]= gitLastCommit(repo_path) - last commit of repo %of the path repo_path %[git_lastcomm...
5a6c2abac7038123f29753e058b783250b88845b8077ec5d418c04e43d349bd0
MATLAB
3,068
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
5c3d0504d282f8809ecfaf91f997efbb234f86b4288af88e33ebefe786f253f8
MATLAB
3,068
83
function success = TS_InitiateParallel(doInitiate) % Initiates a parallel session for hctsa % %---INPUT: % doInitiate: = true for the first time you want to initialize all workers % %---OUTPUT: % success = true if a matlabpool was successfully initiated (or if one already % exists) % --------------------...
82f622b229719902e9c09859bfe5ca82cb440a7dbdc17963a4e01705f228e1ea
MATLAB
3,068
98
function [Wrr, Wrf] = gen_connectivity(params, options, rng_seed) % GENERATE_CONNECTIVITY - Create network connectivity matrices % % H1 Line: Generate connection matrices for neural network % % Syntax: % [Wrr, Wrf] = generate_connectivity(params, options, rng_seed) % % Description: % Generates connectivity matrices...
757d63db169d24d47faf972767cbdc2e182bcdb89adb9db02f62aa6e19168021
MATLAB
3,070
101
function [fstamps_path,summary]=find_framestapms(h5orDCIMGpath,varargin) % % HELP % Finding a frame stamp file just given a file location. If h5 file, it is expected to be found in a subfolder % SYNTAX %[fstamps_path,summary]= find_framestapms() - use 1 if no arguments are allowed %[fstamps_path,summary]= find_framesta...
0a1e9a5f1cc5ebeeae509e89199ae088b842cac84ad8137112c026e49fd3a3fe
MATLAB
3,072
90
function [lratio, distance] = GetLratio(units) %Lratio - Determine the isolation quality of one or more clusters. % % Compute isolation distance, % % USAGE % % lratio = Lratio(units) % % units list of units to process (default = all clusters except % 0 and 1) % % OUTPUT % % ...
e52d20246b243f816d3e077d21e394ebdb27162a67048f2fbbf1d14e75350df8
MATLAB
3,072
79
% Example to export joint EEG and Eye-tracking data (child mind) % The data is included in this repository (on Github, maybe not on the % plugin downloaded from EEGLAB). % % THIS PLUGIN REQUIRES THE INSTALLATION OF THE GAZEPOINT AND SMI EEGLAB PLUGINS % % Arnaud Delorme - December 2023 clear data = []; p =fileparts(...
5263136d99064c57b287e3b77f1ca1b943f89c6c687dbb74206ca77c9ce68e60
MATLAB
3,073
130
function meta_add_spheres_in_rois(DB, varargin) % Add spheres to selected ROIs % % [p, mesh_struct] = brainstem_slices_3d; % meta_add_spheres_in_rois(PLOTINFO{1}, 'brainstem'); % colormap gray % % DB must be a DB or PLOTINFO struct with these fields: % - colors % - xyz % - condf % % (for table) % - nums % - descrip % -...
bbcb3dec920ae1c9a26c1e524119572952249b3bfc143991d66cadb78aafd59d
MATLAB
3,073
89
% Runs GUI mode for MEA-NAP % CreateStruct.Interpreter = 'tex'; % CreateStruct.WindowStyle = 'modal'; opts = struct(); opts.Default = 'Okay'; opts.Interpreter = 'tex'; helloBox = questdlg("\fontsize{20} Hello! Welcome to the MEA network analysis pipeline (MEA-NAP)!", ... 'Welcome!', 'Okay', opts); clear helloBox o...
2cfb08dc5a02c21e11392bf3021a2906bba7e1f703f6366ef8305c6f5d26aaed
MATLAB
3,074
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
43332372517a43b5c0eb8baa8769a10ccaa464858e62a0610166efa984571f11
MATLAB
3,074
86
% std_indvarmatch - match independent variable value in a list of values % % Usage: % indices = std_indvarmatch(value, valuelist); % % Input: % value - [string|real|cell] value to be matched % valuelist - [cell array] cell array of string, numerical values or % cell array % % Output:...
4ac70b6b43c148cec2eaa8ff818fd532e88375c7698a3a194ee3d0d931778414
MATLAB
3,074
119
classdef tmovemex < matlab.unittest.TestCase properties numLabs end properties (TestParameter) device = {'cpu', 'gpu'} end methods (TestClassSetup) function openParpool(test) test.numLabs = 4 ; if ~isempty(gcp('nocreate')) delete(gcp) ; end cl = parcluster('local...
128201febd35ab742c9b88050a4db3c986e68e962c108a40f994fd901f77aa87
MATLAB
3,075
103
function info = GetCurrentSession(verbose) %GetCurrentSession - Get information about current session. % % USAGE % % GetCurrentSession % GetCurrentSession('verbose') % detailed output % % info = GetCurrentSession % return info (do not display) % Copyright (C) 2008-2024 by Michaël Zugaro % % This program i...
77dc248850ccfca5ec48679325bd2c324a2483fa60c065581b58d93358e21a1e
MATLAB
3,075
120
function coactPaper_figureS21() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=5; fontsize=6; fh=initFig('width',8.9,'height',4,'fontsize',fontsize) x=26; y=6; panel_01(x,y,fontsize) print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/figS21_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','...
7d889e5d5b9a735f281126fdbec1823251a95f66e694ac3332db8afc71fa9d19
MATLAB
3,075
96
function [fit,cfg] = fit_MixtureModelShift(x,data,bias,cfg) % [fit,cfg] = fit_MixtureModelShift(x,data,bias,cfg) % % fit mixture model by minimising MSE if nargin < 4 cfg = struct; end if ~isfield(cfg,'fitmean') cfg.fitmean = false; end if ~isfield(cfg,'offset') if is...
f3208b5a6a03b76293dec47bc6e6738a649ed7fbce6781de86312d6a26a7a571
MATLAB
3,075
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
0d4a9322bf52626268b7ffd5f333597a3b0cc3f253e21d79b17cc3deb4f7ae94
MATLAB
3,076
88
function this = MrDimInfo_load_from_file(this, testFile) % Unit test for MrDimInfo Constructor from file % % Y = MrUnitTest() % run(Y, 'MrDimInfo_load_from_file') % % This is a method of class MrUnitTest. % % IN % % OUT % % EXAMPLE % MrDimInfo_load_from_file % % See also MrUnitTest % Author: Saskia Bollmann ...
f5d3d782e659e62808706f52356ed2d4d76fb713f46dd825868801ccc1eaa7a5
MATLAB
3,076
95
function Calls = merge_boxes(AllBoxes, AllScores, AllClass, audio_info, merge_in_frequency, score_cuttoff, pad_calls) %% Merge overlapping boxes % Sort the boxes by start time [AllBoxes,index] = sortrows(AllBoxes); AllScores=AllScores(index); AllClass=AllClass(index); % Find all the boxes that overlap in time OverBoxe...
0d12e368749b336b7a7364424309b862d1bd5af76482500ebb68326704d2eb4e
MATLAB
3,077
109
function varargout = pdftops(cmd) %PDFTOPS Calls a local pdftops executable with the input command % % Example: % [status result] = pdftops(cmd) % % Attempts to locate a pdftops executable, finally asking the user to % specify the directory pdftops was installed into. The resulting path is % stored for future refere...
11706840695d3a742e68a51944d8ba2122d84b67182c62b218211181a6edbfa9
MATLAB
3,077
98
%io_writelcm.m %Jamie Near, McGill University 2014. % % USAGE: % RF=io_writelcm(in,outfile,te); % % DESCRIPTION: % Takes MRS data in matlab structure format and writes it to a text file % that can be read by LCModel. % % INPUTS: % in = input data in matlab structure format. % outfile = Desired filename of ou...
4bdfe54a077c7d3ef8e47284d7359dc833af7d8390697f08e839febd0eee6e8d
MATLAB
3,077
110
% load in and visualize snapshots load('../../ERCaSims/networks/WT/WT_circreg.mat') NT = WTnetworks(1); %% load snapshot data resdir = '../test/'; %filename = [resdir 'testrecoveryWT.mesh.txt']; filename = [resdir 'testspreadWT.mesh.txt']; MSH = MeshObj(filename); %snapfile = [resdir 'testrecoveryWT.snap.txt']; snapf...
6b1cc6211d67abefd1d7d4c3af63114f9d2a81d9425eb8b6decea5ad8d853d00
MATLAB
3,077
104
function glm_nsdrestingstate(ppdir,ppdirname,designfile,hrfbasisfile,tr,glmdirname,hrfmanifoldfile) glmdir = regexprep(ppdir,'ppdata',glmdirname); mkdirquiet(glmdir); %%%%% LOAD % define stimdur = 3; % figure out runs files0 = matchfiles(sprintf('%s/%s/run*.nii',ppdir,ppdirname)); assert(length(files0)==14); files0...
99eef752798dcc723778b64dd957ab2b81c20b20ba53676911d924c8ea5ac4cf
MATLAB
3,077
85
%% ===== PREDICTION + METRICS ===== close all; clc; clear all; %% ===== USER: EDIT THESE PATHS ===== featuresMat = 'C:\YOUR\PATH\TO\ResNet-101\Resnet-101_features_test'; % contains variable "features" mosMat = 'C:\YOUR\PATH\TO\Test_MOS_New'; % contains variable "MOS" (vector Nx1 or 1xN...
ae5e81e622164f29f5455498a0814423fa543940845d115911913b355d12bae0
MATLAB
3,077
102
function eval = clusteval(new,result,param) v = result.cluster.v; c = size(result.cluster.v,1);%c = param.c; if exist('param.m')==1, m = param.m;else m = 2;end; X=new.X; [N,n] = size(X); X1 = ones(N,1); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if isfield(result.clus...
bd9d78a891cba60b860161b36bce5d0929d3844fe342eaab54bd31e98e5bc8be
MATLAB
3,077
95
function run_permuanova1_examples %RUN_PERMUANOVA1_EXAMPLES Run one-way permutation ANOVA examples. % Generates random data for 5 groups along the columns of X. Each group % has a mean value of 0, except for the first group which has a mean % value of 1. Each group has 30 observations. The group labels are % r...
58771912a9e225c407d6599e23682395adb869ae2ab9aa05193b4d85018f5e5d
MATLAB
3,078
91
% SEEMOVIE - see an EEG movie produced by EEGMOVIE % % Usage: >> seemovie(Movie,ntimes,Colormap) % % Inputs: % Movie = Movie matrix returned by EEGMOVIE % ntimes = Number of times to display {0 -> -10} % If ntimes < 0, movie will play forward|backward % Colormap = Color m...
11ef1fce5033dc165373e1770f1dd8c967655ea2f4613c838f363e21a0db9f4e
MATLAB
3,080
79
function run_paper_examples %RUN_PAPER_EXAMPLES Run arXiv paper examples. % Generates random multivariate data for 2 "independent" samples X and Y. % Each sample has 20 variables, each with a mean value of 0, except for % the first 10 variables of Y which have a mean value of -1. Each % variable has 30 observa...
e3cc893dc72036623cce9c1d6c7cad4360c5168c9e96f6ebd386e78b10eba33c
MATLAB
3,080
87
textlabel = {'valence'}; plots = {'surface';'medial'}; filenames = {'emotrev4_posneg_t.txt'}; plotdims= [1 2]; conditions = { ... % plot 1 'strcmp(valence,''asdf'') | strcmp(valence,''fdas'')' ... 'strcmp(colors,''yv'')' ... 'strcmp(colors,''wo'')' ... 'strcmp(cogdemand,''y'') | strcmp(cogdemand,''n'')'...
44e1a47793ce1de843e7727c808e28724a39f716ab72e29de6fb783b8f0bb8bc
MATLAB
3,081
119
function [] = plotConnectivityProperties(adjM, e, lagval, maxSTTC, meanSTTC, ... ND, NS, MEW, FN, Params, figFolder, oneFigureHandle) % % Plots connectivity properties given the adjacency matrix (adjM) % Parameters % ---------- % adjM : matrix % adjacency matrix % e : int % index of the lagvals var...
c7c07a92f1b65562407b00b7dcdea56785ca8c26c394e07fde3c470ab8694c17
MATLAB
3,081
101
function [statlist, docinfo] = doxyread(filename) %DOXYREAD Read a 'search.idx' file generated by DOXYGEN % STATLIST = DOXYREAD(FILENAME) reads FILENAME (Doxygen search.idx % format) and returns the list of keywords STATLIST as a cell array. % [STATLIST, DOCINFO] = DOXYREAD(FILENAME) also returns a cell array % con...
2c8b1b89b9d0567f2589323fe4353e35c0ed969383d75a37a6b6a83332c06053
MATLAB
3,082
91
function [] = plotBiasAnalysis(saveFigures) % Plot results from bias analysis. if nargin==0 saveFigures = true; end % get file paths paths = addPaths(); analysisName = 'bias_analysis'; % Load results file = fullfile(paths.outputs, analysisName, [analysisName, '_results.csv']); if ~exist(file, 'file') error('...
7d4a2da700fe412692277be67f39384f59fc62ca0cd67c494a4ccb78c360d8f7
MATLAB
3,082
109
function terms = strsplit(s, delimiter) %STRSPLIT Splits a string into multiple terms % % terms = strsplit(s) % splits the string s into multiple terms that are separated by % white spaces (white spaces also include tab and newline). % % The extracted terms are returned in form of a cell array of % ...
4925a05352bdb062df846538d47dbe97a5b24945c31d77eaf37289d13af08016
MATLAB
3,083
90
function l = IsExtremum(samples,varargin) %IsExtremum - Identify local maxima or minima. % % Find the maxima (resp. minima) in a signal by smoothing the signal and then % finding the points where the derivative goes from positive to negative (resp. % from negative to positive). % % USAGE % % status = IsExtremum(sa...
ee525e033ddec14f37846699c5a0bfe285b0a4b5121e1cc7cbd089d4bf62a219
MATLAB
3,084
89
function filtered = FilterLFP(lfp,varargin) %FilterLFP - Filter the local field potentials, e.g. in the theta band. % % Filter the local field potentials using a cheby2 filter. % % USAGE % % filtered = FilterLFP(lfp,<options>) % % lfp local field potentials <a href="matlab:help samples">samples</a> %...
a0c5279dfdbb00bf74a3289a56f2b723b63fb34f2da428f540c3951d5e5a7a01
MATLAB
3,085
92
%reading the clinical and demographic data as well as the PAC values and preparing the table for statistical analysis clinical = readtable(fullfile(main_path, '/Dataset/eLife91044_processeddata_scalarmetrics.xlsx')); clinical.diagnosis = categorical(clinical.diagnosis); clinical.ID = categorical(clinical.ID); cl...
baef2eef86076bbf1b481b220a5ce6914cd19748a28275476fe17ac2c79d69c9
MATLAB
3,086
88
function MS = createMeshCylindrical3D(varargin) % MeshStructure = createMesh3D(Nr, Ntheta, Nz, Radius, theta, height) % MeshStructure = createMesh3D(facelocationR, facelocationTheta, facelocationZ) % builds a uniform 3D mesh: % Nx is the number of cells in x (horizontal) direction % Ny is the number of cells in y (vert...
4e426fc86fb1183381a9e0569b21cdb845f4ab8cd4b9128d57dd0012fc4dbe76
MATLAB
3,087
97
classdef MrGlm < MrCopyData % Class providing General Linear Model of fMRI data % (for mass-univariate analysis, i.e. per-voxel regression) % % % EXAMPLE % MrGlm % % See also % Author: Saskia Klein & Lars Kasper % Created: 2014-07-08 % Copyright (C) 2014 Institute...
d9b5448bcc3db3e1efed1b65997b0c534b8fdf023ade61698d58646e55f3347d
MATLAB
3,089
90
%This code will regress 3 TR (6.3 sec) lags of global components %Author: Kim Kundert-Obando for questions please reach out to me at k.rogge.obando@gmail.com %% %load subjects and paths subj= readtable('/data1/neurdylab/datasets/nki_rockland/vigilance_analysis/great_HR_sub_coded.txt', 'readvariablenames', 0); save_pa...
8461a7002f4f71269a3fbe265cfa1c4d0d0b5e8ce90812790207775b62b97b50
MATLAB
3,090
87
function varargout=pt_continuousabove(data,baseline,abovethresh,mintime,maxtime,ignorepts) % function varargout=continuousabove(data,baseline,abovethresh,mintime,maxtime,ignorepts); % % Finds periods in a linear trace that are above some baseline by some % minimum amount (abovethresh) for between some minimum amount of...
bdb7a66a4cf331f6e5c0cb08af24036604b9b728da565db6185dfb412e81fd97
MATLAB
3,090
100
function [groupingResult, numGroup] = groupUnits(zscoreMatrix, options) arguments zscoreMatrix (:,:) double ; options.numCluster = 8; options.cutoffLimit = 50; options.showGraph = false; end loadxkcd; Z_ = linkage(zscoreMatrix, 'average', 'correlation'); unitClusterId = cluster(Z_, 'maxclust', option...
911d8502b99a5ab1244cbeb8f15874bd156b0d2f189ea3228e8c5aefc16ddbdf
MATLAB
3,091
85
function M = dicom2transform(dcmheader) % DICOM2TRANSFORM converts the DICOM header parameters into a 4x4 homogenous % transformation matrix that maps voxel indices to the Patient Coordinate System. % Note that voxel indices are to be counted starting from 1 (MATLAB and Fortran % convention, not C/C++ and Python conve...
c6cd88a34b955cc079a86f60b9fcdec5b597df745362d4c0072a300b58062f47
MATLAB
3,091
79
function batchDetectStim(ExpName, Params, app) %BATCHDETECTSTIM Summary of this function goes here % Detailed explanation goes here if Params.guiMode == 1 app.MEANAPStatusTextArea.Value = [app.MEANAPStatusTextArea.Value; ... sprintf('Running stimulus detection')]; end spikeDetectionFolder = fullfile(Params.ou...
3cec472d0a56065b5ce8e7d281a6049a6639e1a3aa3523e0891c26ffa0f4f81f
MATLAB
3,092
82
function N = tangentspherefactory(M, x) % Returns a manifold struct. for the sphere on the tangent space to M at x. % % N = tangentspherefactory(M, x) % % N defines a manifold that is the unit sphere on the tangent space to M % at x. Points are represented as tangent vectors of unit norm. Tangent % vectors are represen...
8fac3df3b947f0505996008a8698a535064a5b73f459f49d33fb604399a229f1
MATLAB
3,092
86
function poolSubjects_slicesActivity(params, groupInfo) % plots brain slices (ax,cor,sag) & activations (ERP + freq.band + spectra) % pools together subject processed by a given job % settings (subjects, directory names, ...) are stored in 'params' % (c) Jiri, Apr18 if params.plot_brainSlices.plot_slices disp('Pl...
98358f4852ccca713b8776d5c825f88c129c5f8b758a751d3a6d81d64270345f
MATLAB
3,092
112
function Decis = ErrEval (FuncName, ErrCode); % % Decis = ErrEval (FuncName, ErrCode); % %This function displays an error message based on ErrCode and %returns 1 if it's a lethal error (Err_) , or 0 if it's %an error or a warning (Wrn_)that does not require aborting a function % % %ErrCode is a string made out of two p...
4a25626ebf653c9f0dc99982905abd238b5f3aa5ad3cc13a9c9cc2caad2d2b3e
MATLAB
3,093
119
function [err] = writeSPMmat (matin, matout) % % [err] = writeSPMmat (matin, [matout]); % %Purpose: % Write an ascii version of SPM's .mat files % containing a 4x4 transformation matrix. % The output of this function can be used % with 3dWarp to create AFNI-formatted data from % SPM datasets. % %Input Param...
876d9c84a27ad1fab32a21771a23a3be875fddec1dec9c447e62b4ff7d279de4
MATLAB
3,094
82
%{ a stand-alone script for MadMax stimulus processing of galvo traces %} %% prepare matched_trials = preprocess.Sync * vis.Trial * vis.Condition & 'trial_idx between first_trial and last_trial'; %% all galvo scans for which there is a monet stimulus madmax_keys = fetch(preprocess.Spikes*preprocess.SpikeMethod*prepro...
f0bf63b3bc048a0104d080b68da8532b5e23104d1182d916dbc878a60f8d2c31
MATLAB
3,094
117
function [WTOpt, WTMdl, BlkInf, Belief, Prior, Kappa] =... BayesMdlOpt(params, ratTrial,... noise_arg, gen_arg, noise_params) %GenerateSynthData_Bayes - generates synthetic wait times %for optimal Bayes model. % Inputs: % params - Parameter vector. [kappa_mi, kappa_hi, kappa_lo, D, lambda] % kappa_mi, k...
84c5f5dad8d093aa044864cabff60ce6b231d97fcacab223ce0c8465034349be
MATLAB
3,095
73
%% cluster based rois % this script reads the .mat file and the base space image that you select % manually to create rois % this script uses spm and marsbar % step 0: % follow the methods here to manually find and save your clusters % marsbar and som save a .mat file % https://marsbar-toolbox.github.io/tutorial/defi...
c6c24ca98d5151e3d69060aa6eba71606b9fbc2c6610e6bdf81c7a43f921cad4
MATLAB
3,095
77
function [distVec,links,distVec0,numItems] = BF_DoLinkage(distMat,whatDistance,linkageMeth) % BF_DoLinkage Process an input distance matrix for linkage clustering % (including custom processing for absolute correlation distances) %---INPUTS: % % %---OUTPUTS: % ----------------------------------------------------...
b79980cc37f4120fe10b71b4f7341a459db9ee5dcd0e1b8a9107e520c1f17a44
MATLAB
3,097
102
function M = skewsymmetricfactory(n, k) % Returns a manifold struct to optimize over k skew-symmetric matrices of size n % % function M = skewsymmetricfactory(n) % function M = skewsymmetricfactory(n, k) % % Returns M, a structure describing the Euclidean space of n-by-n % skew-symmetric matrices equipped with the stan...
42803d7727c847b01fb668bbeb004174b78d487a14b1ea9a1fa4a4db2e5defe6
MATLAB
3,099
43
matlabbatch{1}.spm.tools.physio.save_dir = {'physio_out'}; matlabbatch{1}.spm.tools.physio.write_bids.bids_step = 4; matlabbatch{1}.spm.tools.physio.write_bids.bids_dir = {''}; matlabbatch{1}.spm.tools.physio.write_bids.bids_prefix = 'sub-control01_task-YOURTASK_run-1'; matlabbatch{1}.spm.tools.physio.log_files.vendor ...
0030a37c4d17e1945193ef36a289566e6d4c0843eb440044b18175e43b9816fa
MATLAB
3,100
73
%% naj_postICAopt_master % Comparing five differennt pipelines post ICA decomposition to find the % otimal one for this dataset. % % preprocessing up to this point described by naj_neurCorrYoung_master % % this is the master script, calling all other scripts in the correct oder %% preparation % copy ICA decomposed dat...
a274292b6511914d274d1910e00e2e0e0e15a9e2c34a3780e2f363634b46f708
MATLAB
3,100
80
function calcProjMatContrastsSubj_forPalm_ShirleyPC(slName, n_sub, spm_path, data_path, util_path) % save single subject contrusts of Tim's PCA projections analysis addpath(genpath(spm_path)); addpath(genpath(util_path)); nFiles = 16; smoothKernel = 6; matFname = slName; projMat = zeros(91,109,91,nFiles); % dims of ...
29babfcfab11b057147cee9d2f0187e056b63ab0baa920e7b1d6bdb86ad8d6f4
MATLAB
3,101
95
function [y, x] = tapas_dcm_euler_gen(DCM, Ep) % [y, x] = tapas_dcm_euler_gen(DCM, Ep) % % Generates synthetic fMRI data under a given signal to noise ratio (SNR) % with the fixed hemodynamic convolution kernel % % Input: % DCM - model structure % Ep - data-generating parameters ...
6ddbb2b171fdd670cbb6eab4309ae22c65daf9c4507469667fbe02daabce6cf9
MATLAB
3,102
99
% op_getLW.m % Jamie Near, McGill University 2014. % % USAGE: % [FWHM]=op_getLW(in,Refppmmin,Refppmmax,zpfactor); % % DESCRIPTION: % Estimates the linewidth of a reference peak in the spectrum. By default, % the reference peak is water, between 4.4 and 5.0 ppm. Two methods are % used to estimate the linewidth: 1. F...
836b65e70047f75aafbec59a0d2525fbcd4fdfdd2a20e85f666068da6adf1b14
MATLAB
3,103
96
function derivative = Diff(samples,varargin) %Diff - Differentiate. % % USAGE % % derivative = Diff(samples,<options>) % % samples <a href="matlab:help samples">samples</a> to differentiate % <options> optional list of property-value pairs (see table below) % % ================================...
89e58e34d86cd2b7af902462528ba231744370a6627c7d4d4011142c3280e325
MATLAB
3,103
92
%% [chi] = Wrapper_QSM_QSMnet(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 dat...
0f39090f78cca56ca709340fd11908d84895848a4aa6817f6b15b4bced3f3073
MATLAB
3,104
74
% STD_CLUSTMAXELEC - function to find the electrode with maximum absolute projection % for each component of a cluster % Usage: % >> [eleclist, setlist, complist] = std_clustmaxelec(STUDY, ALLEEG, clustind); % % Inputs: % STUDY - STUDY set structure containing (loaded) EEG dataset str...
a66a0bdd2523ce545e0428dad5c535f193b6f2257632b97cd27b6a2d3c4a0dfb
MATLAB
3,104
79
%{ monet.Cos2Map (computed) # orientation tuning maps -> monet.OriMap ----- cos2_amp : longblob # dF/F at preferred direction cos2_r2 : longblob # fraction of variance explained (after gaussinization) cos2_fp : longblob # p-value of F-test (after gaussinization) pref_ori : longblob # (radians) prefe...
0579b7c5edc79f9ff9925c91baed576a097c4c0c4ab178683aa5984755e59286
MATLAB
3,105
94
% This function which initialises a struct containing the preferences and % details for a particular project; in this case the demo for the toolbox. % It should be edited to taste before a project is run, and a new one % created for each substantially different project (though the options % struct will be saved each ti...
6e65aa7a097e935a99c95ffa693364bed1f5b9909d53a19ef567cffa0674025d
MATLAB
3,105
60
% STD_ITCPLOT - Commandline function to plot cluster ITCs. Either displays mean cluster % ITCs, or else all cluster component ITCs, plus the mean cluster ITC, in % one figure per cluster and condition. ITCs can be visualized only if % component ITCs were calculated and...
943a6792101ca385d9bcf4afe91dc26790bea7a20d27bd3ba31b779948d78bc2
MATLAB
3,105
91
function ft_write_sens(filename, sens, varargin) % FT_WRITE_SENS writes electrode information to an external file for further processing in external software. % % Use as % ft_write_sens(filename, sens, ...) % % The specified filename can already contain the filename extention, % but that is not required since it will...
f2ea0e4b3ef57f0e50449741a99009fe3ee7dda59ece0a945e640c5a091f9062
MATLAB
3,106
74
% std_rmalldatafields - remove all data fields from STUDY (before saving % it for instance. % % Usage: % STUDY = std_rmalldatafields(STUDY, type); % % Input: % STUDY - EEGLAB study structure % % Optional input: % type - ['chan'|'clust'|'both'] remove from changrp channel loc...
3cef1c432bb3656130b28e95efc51949957a5fb36179d9b23f5831454c5a57aa
MATLAB
3,108
73
%{ monet.CleanRF (computed) # cleaned up and normalized receptive fields -> monet.RF ----- clean_map : longblob # cleaned up receptive field map %} classdef CleanRF < dj.Relvar & dj.AutoPopulate properties popRel = pre.ExtractSpikes & monet.RF end methods(Access=protected) function makeTuples(self, k...
47cdb662e81fb2f37e5a206f81565720a42808df23337c1c6d70789738d6ba1d
MATLAB
3,108
87
function [recon,cmap]=sero_pulseq_coilCombineAdaptive(yn,rn,norm) % function [recon,cmap]=sero_pulseq_coilCombineAdaptive(yn,rn,norm) % This function is copied from: % https://github.com/andyschwarzl/gpuNUFFT/blob/master/matlab/demo/utils/adapt_array_2d.m % Reconstruction of array data and computation of coil sensiti...
7b5444ed9bb9cd988b22836c85b6a5e758bd64ddbe3a4d0260e34b0fb0620dfe
MATLAB
3,108
111
%% [pSWI,dSWI,swi_phase] = swi(magn,phase,filterSize,thres,m) % % Input % -------------- % magn : image that combines with phase contrast, can be 3D/4D % phase : phase map (in rad) % filterSize : window length of Hamming filter % thres : threshold used to create positive/negative phase contr...
0cdbd203bbd986782d6f3db146d2a69b3aa0ef2185e2bd02fe2f5317aaade61b
MATLAB
3,109
79
function significance_distribution_check_v2(events,adjM,repNum,tail,method,downSample,lag,fs,genotype,bins) % H Smith, Cambridge, 2021 % Show changes in thresholding as number of repeats increases % Produces figure as described in significance_distribution_plots % INPUTS: % events = binary matrix of spikes/neu...
197155c64e19050c7686dcf60bff568cd5dfe0b249142029573ea92c36e873e4
MATLAB
3,110
97
%% load the fitted EC50 matrix load(fullfile('.', 'results', 'MLEFit.mat')); cMatrix = cMatrixMLE; load(fullfile('.', 'data', 'doseResponseData.mat')); %% Plot figure 3B % order for visualize ORNOrder = [19,21,3,6,8,14,10,16,9,7,11,4,12,13,1,2,20,5,17,15,18]; odorOrder = [19,33,12,32,27,15,14,7,8,9,6,22,24,31,30,29,1...
1ca43ee5ed6070ea15ed0f259aeca6aa0b9514070958bc02c6b78e372602a902
MATLAB
3,110
101
classdef toolsGetLargestCCTest < matlab.unittest.TestCase %TOOLSGETLARGESTCCTEST Unit tests for petraToCT.tools.getLargestCC. % % DESCRIPTION: % Verifies that getLargestCC retains the requested number of % largest connected components in 2D and 3D binary images, and % handles edge ca...
55dd6392a5f95d7a40e5d155d7c638cbae4b93c1a6c4809e82f727941a04bb41
MATLAB
3,110
112
% load in and visualize snapshots load('../../ERCaSims/networks/WT/WT_circreg.mat') NT = WTnetworks(1); %% load snapshot data resdir = '../test/'; %filename = [resdir 'testrecoveryWT.mesh.txt']; filename = [resdir 'testspreadLin.mesh.txt']; MSH = MeshObj(filename); %snapfile = [resdir 'testrecoveryWT.snap.txt']; snap...
ba191331b445ea6d996dfa4c4f324b0865a956e5f9af7db95e65c5373eaf7938
MATLAB
3,110
83
function [H] = quaternion(q) % QUATERNION returns the homogenous coordinate transformation matrix corresponding to % a coordinate transformation described by 7 quaternion parameters. % % Use as % [H] = quaternion(Q) % where % Q [q0, q1, q2, q3, q4, q5, q6] vector with parameters % H corresponding hom...
1f36956e782694d171e92b503179556705f2e3ffb64d490bf0b80aff5215fa45
MATLAB
3,111
81
function net = cnn_mnist_init(varargin) % CNN_MNIST_LENET Initialize a CNN similar for MNIST opts.batchNormalization = true ; opts.networkType = 'simplenn' ; opts = vl_argparse(opts, varargin) ; rng('default'); rng(0) ; f=1/100 ; net.layers = {} ; net.layers{end+1} = struct('type', 'conv', ... ...
549e0235c4468e98179eebd7266de6c75457be853a4bc8c5835fcc6e22778f88
MATLAB
3,111
121
classdef AffineGridGenerator < dagnn.Layer %DAGNN.AFFINEGRIDGENERATIOR Generate an affine grid for bilinear resampling % This layer maps 1 x 1 x 6 x N affine transforms to 2 x Ho x Wo x N % sampling grids compatible with dagnn.BlilinearSampler. % (c) 2016 Ankush Gupta properties Ho = 0; Wo = 0; end ...
93c6bdaa8fb6880942cef9caf2865e6e1296ba52ce6c653481b94f53bdcfd78a
MATLAB
3,111
90
close all clear all load('Z:\BCI\Data\NDNF_Opto\NDNF_06\062424_NDNF_06\Baseline\baselineMask_2.mat') dband = 80; dband2 = 40; frames_tmp = sbxgrabframe('Z:\Scanbox\Data\NDNF\NDNF_06\062424_NDNF_06\062424_NDNF_06_000_006\062424_NDNF_06_000_006', 1, 24000); frames_tmp = squeeze(frames_tmp); frames_pl1 = frames_tmp(:,:, ...
40b4632e093259443824a71539af9f3cc05e37cd3bb9494dcd99454b4bfeb4d9
MATLAB
3,112
97
function m = Monochrome(color,n,varargin) %Monochrome - Monochrome colormap (from white to a given color). % % USAGE % % m = Monochrome(color,n,<options>) % % color optional target color (default = black) % n optional number of rows in output matrix (default = 100) % <options> o...
edf3195cf1fa784d1dba631ce852a3c0a2627b75d9d7bdfcf28f452bb1b9cb6a
MATLAB
3,112
65
function emptyImage = create_empty_image(this, varargin) % Creates all-zeroes image with % % Y = MrImage() % Y.create_empty_image(varargin) % % This is a method of class MrImage. % % IN % % varargin 'ParameterName', 'ParameterValue'-pairs for the following % properties: % % Paramet...