sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
1b9945bb15c9c624b1ef19d39576323b4dc6c227764c1982a7ec57da774836e2
MATLAB
1,141
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
e35f19f1bc03eba621976ce9ffa97ace22bdde2472ccd263a1888e8d17b49feb
MATLAB
1,141
33
function val = bigendian % BIGENDIAN returns 1 (true) on a big endian machine, e.g. with a SUN Sparc % or Apple G4 processor, or 0 (false) otherwise % % Example % if (bigendian) % % do something, e.g. swap some bytes % end % % See also LITTLEENDIAN, SWAPBYTES, TYPECAST % Copyrigth (C) 2007, Robert Oostenveld...
b1f865ab9aad0b652f0b841abb47d5cde5efc3f71ad443b90a4d826ebe05d365
MATLAB
1,142
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
570f6d5d77de97782ced93d232aa834f2e3050ecd1ca6aa4cc28fa82ca661aa1
MATLAB
1,143
39
function [MA_matrix] = create_matrix_MA(BS_window) %% Create moving averages matrix from BS data % % **Usage:** [MA_matrix] = create_matrix_MA(BS_window) % % Input(s): % - BS_window = preprocessed BS dataset. % % Output(s): % - MA_matrix = Moving averages matrix, these are the features for training % ...
55c6c70bec0329cba42b57a63b9cac10bf709e94ab5428c0986ec86cea9b9d92
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
5ed4114f2a53e8e9129182fd506e898f77a4bd22d5256da0c1f916cbcdf44d4c
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
89ff27cdcd7e05e43aa5e6e93c6260e0a3174dbf0e129a633e91761113582515
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
8cbeb4d2723ffe7498c1d8f826de738fee3284d66e8f33a3d99076dcca5596c7
MATLAB
1,144
37
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
9871ad7157c606fb84280591ac02cf5d47335ec2a1f9c7c6c1accdd5db898f1f
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
a5e9e5dea585ed3efd49ab1bf48db19646ef876d2f0440f8a81d1ef23ca40ae9
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
eb539324234331b384069df8920d02c111bda986fa75abc3500e7576cc6b6c9f
MATLAB
1,144
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
00ff9ca69466793bdee4e0f0936664ac0b44a428dc15858fb6775c778da034f3
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
4189d6a41092ef327e5ec190c1de67caa5fb00abfd184f348731769eada41130
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
63c105aebfb1bd2daad636384388c89a0e938daa1d9e1ed4e15dc85f39943f37
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
7650f8e1460054ae82a8cf8bab1edb9dca586ee997d6028150cdcc209f76c6f1
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
7b2120474dfa5836a8915ead735dc33503c8c3eb5c8732010f71d4acd97be0de
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
868c17fdff86855d0d0a4f435384e41c88b9c53eb8b7422d859872979afaa140
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
8712e3482416dffaf786d8aa41a2c3714d6c4de9235c1198c199752424307991
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
9220ef3470df52f96ffdb50a6dcf9ada6c24aaa30a7c90b0d5c068203c4453d0
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
9287cb9a0e001a7c037d0164189fac721ddb8c5a96f497686fd3d3a4f8a5c497
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
bf01cded8cb75f23d5b2abc37336be560855f2a82c017d9b1ef94cffc33d0fc5
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
c8e3f012798dbfbb83f394fe3f1afa5687da6b4eaf3b12a3fdf690b3af57c6c8
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
d81e9ddc73afb32c6298b671be1e15063412acf0775300f7ae8057d41332a250
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
e2f3ce0ac1248e5758c38a5f491e77a68df498d5797e74f7d6a7755208adaab8
MATLAB
1,145
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
012b9a2c83edf2127590698213f2a5a8379f20dd0a14f75cfc4e9aa7749f5c00
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
0c8e1ddd14ab5f415407be32ef22496dd5fee1a3fce1839856bcbd8f2b1a953b
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
2d41e4cae2faf1cabdba822dd6b86c1a7515cb6d31fc3aa8c13e57a7e28c663e
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
313307826e8ecfb61f79af38572db6e4be15f9833fb45789abfa65b96095952b
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
32b108ecdc1dcddc2ab8e0d830c38e835f96fa755b1768f300e4405c531fe054
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
35e0fb88a013d7efb82212e499ecbce4d289e4fd97da225f2aed5e39ae4742ad
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
3de20434c4276c868f9cf979971f0c03ddf585b540b1efd23b5a30102b234fbb
MATLAB
1,146
43
function CBIG_write_delimited_txtfile(filename, headers_cell, alldata_str, out_info) % Output specific field of headers cell array, all data string to textfile. % % CBIG_write_delimited_txtfile(filename, headers_cell, alldata_str, out_info) % Input: % filename : filename % headers_cell: header cell...
4b6ab28f479fdd3228268adeafc355a334962118ecff621b4997854f1fb80e05
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
670f61031e1a8b6b8858ad4106cc74a3e737463ad7336dbd0c44302cd4e44797
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
89d9ef6f7e0d15fe4dd29b6f07af018dfc51cdbf49d43229a931181eedf3ad9a
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
8e17cec53e81c3535bc217d1cc8f9a96f63352c90c634d5e3faec57d36bedd7d
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
90c7afd3a7219a12aa624683088d9a87434161fec570c39bd528ae8619d6b238
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
d151e9ed48d048553966ea989d125e87590e1a9c0ce762fa7e600d69ebb7876e
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
ecb0ea0852e3af4b017222e418499008a76a686aa3ffc1c88ee6bfeb29bd9781
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
f8242eaeae45419b7454ae515555239522637569c4ebb95c2a4da00ffa4d657f
MATLAB
1,146
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
1f889046874d35584007623aaa9c789ffc538ee833b7fcb283378cb33ba78847
MATLAB
1,147
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
6c77b2198e9bc024a8feafd7734711c3ba05941147eb21f87e6eb5cedd200f66
MATLAB
1,147
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
ad3a9ed7cf2a23b172398ba0e919ddb0b0a63f5438eb442f9dc52c3f192090cb
MATLAB
1,147
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
e65f4f560bbc4e552b21327f86c4cdf323a2b35514a8b915e5a34203419d14c4
MATLAB
1,147
38
% loop trough files in folder to make undistortion for all .nii files in % folder % Attention: the mask needs to be made first! (see % Use_mc_undist_wouter_dante.m) % This is STEP 2. clear % addpaths addpath('/fmri/apps/spm5') addpath('/fmri/spm5_scripts/') addpath('/fmri/spm5_templates/') addpath('/fmri/spm5_utils/'...
586daebc9016995ef452c3d24f6129cd65f857c2aca7f7c64eccd2c272e0c14d
MATLAB
1,148
43
%% % Pad the given input array so that it has the same dimensions as the % reference array. function padded = padlike(input, refSize, padwith, direction) excess = refSize; inSize = size(input); excess(1:numel(inSize)) ... = excess(1:numel(inSize)) - inSize; ...
8d8c50454bae7e4997650b254d70fcc50a18508f20c5c202e09237f6f40ada87
MATLAB
1,150
33
%HOT Black-red-yellow-white colormap % % Examples: % map = hot; % map = hot(len); % B = hot(A); % B = hot(A, lims); % % Similar to MATLAB's hot function, but also able to return a concise % colormap table. % % The function can additionally be used to convert a real-valued array into % a truecolor a...
cd85cf427e6ff48c1eef73e02753cdee680dd642a220ae84d39d03e8bb46fdd6
MATLAB
1,150
34
%HOT Black-red-yellow-white colormap % % Examples: % map = hot; % map = hot(len); % B = hot(A); % B = hot(A, lims); % % Similar to MATLAB's hot function, but also able to return a concise % colormap table. % % The function can additionally be used to convert a real-valued array into % a truecolor a...
9c02ff5680e949fa8dbaf0da637df8f6d5a84fae81030992a91195a656521858
MATLAB
1,152
29
function xmax=findpeaks(data,threshold) % Helper function to find peaks in a given continuous valued time series x % Usage: xmax=findpeaks(data,threshold) % Input: % data (data in time x channels/trials form or a single vector) % threshold (if specified returns locations of peaks at which data exceeds thr...
a8c7b3206b718331514bf12fbbfbe1816a3a28e045701a06a79e286c5b0f25b4
MATLAB
1,152
42
%% % function [f] = powerlawfit(x, y, yError2, zeroError2) % fitFunction object (static) persistent fitFunction; if isempty(fitFunction) fitFunction = fittype('a*x^b + p1/(1 + abs(x)^q1)'); end % Special case that returns the fittype if nargin < 1 f = fitFunction; ...
128816e0a429f9011d79908b86f44297c90be0473b0a3f7ae2be5ee20106eecf
MATLAB
1,158
33
%HOT Black-red-yellow-white colormap % % Examples: % map = hot; % map = hot(len); % B = hot(A); % B = hot(A, lims); % % Similar to MATLAB's hot function, but also able to return a concise % colormap table. % % The function can additionally be used to convert a real-valued array into % a truecolor a...
2b84f830c71f2f03bc9b50c414bf0a951a8a65872b87190a5ca1f451a87d5642
MATLAB
1,158
41
%% % Create a weighted histogram from the given data. function [histo] = hist2(xData, yData, weights, nBinsX, xMin, xMax, nBinsY, yMin, yMax, varargin) histo = zeros(nBinsY, nBinsX); dx = (xMax - xMin) / nBinsX; dy = (yMax - yMin) / nBinsY; % Find the bin for each data point x...
e2a58e70791176ab6f0b980c26fcff1b76a85af8bb6043e32e2a6253e6121aa5
MATLAB
1,158
42
%% % function [f] = cauchyfit(x, y, yError2, zeroError2) % fitFunction object (static) persistent fitFunction; if isempty(fitFunction) fitFunction = fittype('a / (1 + abs((x - o)/s)^b)'); end % Special case that returns the fittype if nargin < 1 f = fitFunction; r...
24fe019e1cb284d6c9e5043fdda392e4719b7be29837b417f0e8c7ec18d9a119
MATLAB
1,159
34
%COLD Black-blue-cyan-white colormap % % Examples: % map = cold; % map = cold(len); % B = cold(A); % B = cold(A, lims); % % A black to white colormap through cold shades. % % The function can additionally be used to convert a real-valued array into % a truecolor array using the colormap. % % IN: ...
32e0dc7415c1ce9613eb749dc5bec4ba5d0e97d8c52d27526d9e8bafc16dd137
MATLAB
1,161
41
function [hfig] = spectrogramFigure(spec,timeAxis,freqAxis,specLimits,smoothSpan,interpFactor,cLabel,specLabel); % % Plot based on the number of spectrograms switch (length(spec)) case 1 % Make Figure hfig = makeFigure([8,3]); % Plot plotSpectrogram(spec{1},freqAxis,timeAxis/1000,smoothSpan,interp...
9ae4e34c05a1d3495b3388513cbbe723ba2fc17b6a50d3d894b968ecb8c9be53
MATLAB
1,162
33
function [results_to_plot] = normalise_data(results, biom_1, results_folder, cat_disp,normalise_to_ctrl_rep, normalise_to_ctrl, name) if normalise_to_ctrl_rep results_to_plot=[]; for i =1:(size(results,1)/3) ctrl_mean = mean(results(i*3-2:i*3,5),'omitnan'); results_to_plot =...
28476cfe7bb77d7b7eb2682dbe5fec7fa130f575b6ae630aca653c96b5771257
MATLAB
1,163
35
function wod_writespykingcircus(slurm_task_id) if ispc addpath (genpath('\\lexport\iss01.charpier\analyses\wod\EpiCode\shared')) addpath (genpath('\\lexport\iss01.charpier\analyses\wod\EpiCode\external')) addpath (genpath('\\lexport\iss01.charpier\analyses\wod\EpiCode\templates')) addpath (genpath('\\l...
44fb988abc66b60ecef15aa034859412b4425c0481bb5f57484caad5e71a9463
MATLAB
1,163
39
function outpict = simnorm(inpict,constraint) % SIMNORM(INPICT,CONSTRAINT) % simply normalize data to fit within the unit interval [0 1] % % INPICT is an image or array of any shape or class % CONSTRAINT specifies the approach for rescaling data (default 'extrema') % 'extrema' transforms the data such t...
d185c2f593766c673ff99483f6d36bc8be8dc9a4aeec0cf4aaf892336d2b4e8d
MATLAB
1,166
45
paramArray(1).bottomWhisker = 1.5; paramArray(1).bottomBox = 2.5; paramArray(1).bottomNotch = 3; paramArray(1).center = 3.5; paramArray(1).topNotch = 4; paramArray(1).topBox = 4.5; paramArray(1).topWhisker = 5.2; paramArray(1).outliers = []; paramArray(2).bottomWhisker = 1.8; paramArray(2).bottomBox = 2.7; paramArray(...
c6280174d263d097e8ff4b76020be452bb2482a4441df73d5ce64810a22c1e7e
MATLAB
1,168
34
function run_all() % Conveniance function to run all the example analysis. % --------------------------------------------------------------------- % Copyright (C) 2024 Simon R. Steinkamp % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Pu...
8eb6e1c79fbc0075489f979d279e8ef9461887e18072c6a7be40a208ba6a11aa
MATLAB
1,169
35
function counts = validate_discrete_labels(y, Ym, funcName, varName) %VALIDATE_DISCRETE_LABELS Validate integer class labels and reject empty classes. % counts = validate_discrete_labels(y, Ym, funcName, varName) % checks that y contains integer labels in the range [0 Ym-1] and % that every class has at least one...
16845c0afbd751bf3510bc4c0e94754bf408b9267bda4a6b96255043202b0277
MATLAB
1,170
42
function [y,mn]=nt_rereference(x,w,factor) %[y,mn]=nt_rereference(x,w,factor) - rereference by subtracting weighted mean % % y: rereferenced data % mn: subtracted reference % % x: data to rereference (time*channels or time*channels*trials % w: mask % factor: apply to mean before subtracting [default: 1] % ...
6b58dbad577b9ef609cc5f239d05918a39441d0cb447a913aa29fb3cbe81dc6b
MATLAB
1,170
47
%% % Expands all inputs by repetition, until they have the same size. % function [varargout] = repeatAlike(varargin) %% Compute sizes of all varargin totalDims = max(cellfun(@ndims, varargin)); arraySize = cell(size(varargin)); example = []; for iA = 1:numel(varargin) arra...
0cd303340f999cde00c52f3020bf89d6caea61a5479571abcd0c40e3e2da8bd0
MATLAB
1,171
38
%% Function to get get reward location function [RZ_XY, RZ_loc] = GetRewardLocation(XY, event, Correct, context) if sum(ismember(context, 'A')) > 0 context_labels = ["A", "A'"]; Nrew = 2; else context_labels = ["B", "B'"]; Nrew = 1; end RZ_XY = zeros...
732303e928bf36c860e47195de8dde59e415e3f6b1260ce089bd82711424ba92
MATLAB
1,171
42
%% % function [f] = logcauchyfit(x, y, yError2, zeroError2) % fitFunction object (static) persistent fitFunction; if isempty(fitFunction) fitFunction = fittype('real( a / (1 + ((log(x) - o)/s)^b) )'); end % Special case that returns the fittype if nargin < 1 f = fitFun...
413dbcbb6ef95d38b756f6bbf6e029b221940ef0e1a5a856d322f56b71c201c1
MATLAB
1,172
41
function data = removeArtefactedTrials(cfg, data) %remove artefacted trials,, defined by a value >0 in trialinfo.artefact if isempty(data) return end for ipart = 1:size(data,2) fprintf('For part %d\n', ipart); for markername = string(fieldnames(data{ipart}))' fprintf('*** For %s...
662cd46a0a99d37f145be2852fb50b7985272c11412f5fe30c225712e2c869bd
MATLAB
1,174
38
function [adj, sz_links] = CBIG_components_subgraphs(adj) % Script to get components sub-graph. % % function [adj, sz_links] = CBIG_components_subgraphs(adj) % Input: % adj:adjacency matrix with values going from 1 to number of components with % more than 1 node. The script assues that the ...
7e54cada7d785f558ad483ec1148146503e88a92f624242faadc2ed9fa0f8a37
MATLAB
1,174
52
function maskstack = mlmask(inpict,numlevels) % OUTMASK=MLMASK(INPICT,NUMLEVELS) % Simple multilevel mask generation tool. Resultant mask describes % the distribution of image content falling into equal-width bins % from black to white. % % INPICT is a single-frame I/RGB image of any standard im...
568678f100069cd3be1a7e8127f246766b4301dcf75d7da10ee9663d43c6efd6
MATLAB
1,175
28
function PET_project_grandaverage restoredefaultpath if ispc addpath (genpath('\\lexport\iss02.charpier\analyses\vn_pet\EpiCode\shared')) addpath (genpath('\\lexport\iss02.charpier\analyses\vn_pet\EpiCode\external')) addpath (genpath('\\lexport\iss02.charpier\analyses\vn_pet\EpiCode\templates')) addpat...
e35d53ccc56bbd765bef4dd734a84d127dfe81ba72b3160437e0035b6032cb62
MATLAB
1,177
27
function matrix = get_SN_vector(raster, signal_threshold, noise_start, noise_stop) % get the signal - noise vector from the raster % % arguments: raster - cell array structure: (i.e output of get_raster function) % signal_threshold - float: indicating time from flash onset ReaChR signal is expected t...
5f4b9f6ec5efce42f5f9e2cc17aadbb3efa095205e8b5dfff97509e0f96208a7
MATLAB
1,178
41
function addaxis_zoom_post(obj,evd) % update the added axes with new zoom % disp('zoom post'); %==================================================================== % This is a modification to accomodate the ADDAXIS commands. % Check to see if add axis has been used and update the axes using % ...
dcd262cd7770b138609d0bba64630269cd1de89f79f2bf29297e2600e7b7de8c
MATLAB
1,183
51
% % isInstalled = checkMatlabToolbox(tb) % % Description: % check if a particular toolbox is installed % % Input: % tb - toolbox short name, only support pct, smlt, ipt now % % Output: % isInstalled - whether is installed or not % % Copyright: % 2013-2018 (c) USC Biomedical Imaging Group (BigLab) % ...
dcb2864440017534cd0a0ad18134f9619978de6f0f05b60ca612e281b9afebee
MATLAB
1,187
46
function I = gcmi_cc(x, y) % GCMI_CC Gaussian-Copula Mutual Information between two continuous variables. % I = gcmi_cc(x,y) returns the MI between two (possibly multidimensional) % continuous variables, x and y, estimated via a Gaussian copula. % If x and/or y are multivariate rows must correspond to samples, co...
03123f891b11a43b45132afa22598ed066eba41905f3576459adb5b973b19ff3
MATLAB
1,188
33
%HOT Black-red-yellow-white colormap % % Examples: % map = hot; % map = hot(len); % B = hot(A); % B = hot(A, lims); % % Similar to MATLAB's hot function, but also able to return a concise % colormap table. % % The function can additionally be used to convert a real-valued array into % a truecolor a...
b9f1be95cebe99b9e45e876d26c30560898a6e562699ffcaac464f22650b4df5
MATLAB
1,188
60
function D = EuDist2(fea_a,fea_b,bSqrt) %EUDIST2 Efficiently Compute the Euclidean Distance Matrix by Exploring the %Matlab matrix operations. % % D = EuDist(fea_a,fea_b) % fea_a: nSample_a * nFeature % fea_b: nSample_b * nFeature % D: nSample_a * nSample_a % or nSample_a * nSample_b % % Ex...
db1ca00b8bb5ec0bf838f999d0a98eb52716e4f9254b91cd2d0691f8b591fdcf
MATLAB
1,188
51
function outpict = hsi2rgb(inpict) % HSI2RGB(INPICT) % undoes an HSI conversion from (RGB2HSI) % % INPICT is an image of class double wherein % H: [0 360) % S: [0 1] % L: [0 1] % % Return type is double, scaled [0 1] % % See also: rgb2hsv, rgb2hsl, rgb2hsi, rgb2hwb % keep in mind that ...
5b24d2e98b9aa4186673770fe274dffdb456e051db583d722ee3ed603a086e92
MATLAB
1,189
39
function outnum = roundodd(innum,varargin) % ROUNDODD(INNUM,{TYPE}) % Round numbers to odd integers, in the direction specified. % % INNUM is a real-valued numeric scalar or array % TYPE specifies the type of rounding (default 'round') % 'round' is similar to the inbuilt function round() in that values are %...
4ae576df5f9cc26367322742933239c67e1fe890146c9f589db83ef87d3d791b
MATLAB
1,191
43
clear, clc; outputFolder = fullfile(pwd,'prt'); %% PRT Parameters PRTParameters = struct(); PRTParameters.FileVersion = 2; PRTParameters.Resolution = 'Volumes'; PRTParameters.ExperimentName = 'MusicNF_Main'; PRTParameters.BackgroundColor = [0 0 0]; PRTParameters.TextColor = [255 255 255]; PRTParameters.TimeCourseCol...
96a843566d79ae04da3303aa5068620104f51e1927ee8bf27dff63940a8be4e4
MATLAB
1,192
46
function varargout=nt_spect_plot2(x,varargin) %nt_spect_plot2 - plot power spectrum % % The power spectral densities of all columns are calculated. % The result is either plotted as an image or returned. % % See nt_spect_plot, and pwelch for syntax. if ndims(x)>2; [m,n,o]=size(x); x=reshape(x,[m,n*o]); ...
4c5d48abc2d48fe7c7ba57fdf0ff93d752602828a3044f17955b57f09d0568ac
MATLAB
1,193
33
function CBIG_SPGrad_create_cifti_template(resolution, output_dir) % CBIG_SPGrad_create_cifti_template(resolution, output_dir) % % This script creates a cifti template for a given resolution % % Input: % - resolution: (scalar) % the number of vertices of surface mesh, e.g. 40962. % % - output_dir: % ...
c53f20d73546c695defb1b0f07309bd80a67cb6be3a41c09de58c0ab5f91d418
MATLAB
1,193
42
function [bin, varargout] = findBin(x, xCenters, varargin) % FINDBIN Locates the bin in xCenters in which x falls. % % If out of range, returns a negative answer unless a third argument is % provided and is false. In the latter case containment checking is % turned off. % % Note that the left edges of...
30f48b0198f062bff7cc25b5515bb66d4644a9c9d8016cf1d7e713a06abf2060
MATLAB
1,195
57
function [L, dLmedian]=PF_lengths_sub(Xt, Yt, Zt, maxk, mode) %% Calculating PF lengths if mode == 1 Nz=(abs(Xt)+abs(Yt)+abs(Zt))~=0; else Nz=(abs(Xt)+abs(Zt))~=0; end IndexToNonZero=Nz; IndexToNonZero(1,:)=[]; %calculate the length along each PF dXt=diff(Xt); if mode == 1 dYt=diff(Yt); e...
86ca86386def24732d6f8b44158a3fdf5dd0ccb7f5cf665554e1323a8f44eeed
MATLAB
1,200
44
function [fy, ty, iAlign] = alignedResample(fx, tx, tAlign, dt, tBinRange) % Data should be laid out in columns if size(fx,1) == 1 fx = fx(:); end if size(tx,1) == 1 tx = tx(:); end % Compute center of alignment bin iAlign = ceil((tAlign - tx(1)) / dt); ...
9680867f755910dbf0096382db99b53f85d25af0ab5cf89667f2220ffee26a12
MATLAB
1,200
40
function [U,S,V] = addSVD_Hall( UX, SX, VX, muX, NX ... , UY, SY, VY, muY, NY ... ) UTX = UX'; gp = UTX * (muX - muY); Gpq = UTX * UY; Hnq = UY - UX * Gpq; hn = (muX - muY) - UX * gp; vnt ...
f44021387c72413531c72d66292c0f35aa6eea1bc5b283d8942c978a8269b90c
MATLAB
1,200
73
function y = filter_iir_Q(x,a,b,N,Q) % size_x = size(x,1); % y = x; % w_a = 0; % w_b = 0; % N = N; % for i = 1:N % for j = 1: i % w_a = b(j) * x(i-(j-1))/Q + w_a; % end % if(i == 1) % w_b = 0; % else % for j = 2: i % w_b = a(j) * y(i-(j-1))/Q + w_b; % end % end % y(i) = w_...
112d9c8833eeb3ab0aba96c772772537e186f20bae68989b6fa17c0643f6657a
MATLAB
1,203
47
function [position] = findpos(array, value, comparator, outcome) % FINDALL Returns the index of all items matching the given % criteria. % % FINDALL(array, value, [comparator = @eq], [outcome = true]) narginchk(3, inf); %----- Special case where a test function is provided if isa(val...
648a4dfcbbbd6a7dfa634af19044b603bfc73c8bef7978e0007a2268f840f8c4
MATLAB
1,204
43
clear, clc; outputFolder = fullfile(pwd,'prt'); %% PRT Parameters PRTParameters = struct(); PRTParameters.FileVersion = 2; PRTParameters.Resolution = 'Volumes'; PRTParameters.ExperimentName = 'MusicNF_Main'; PRTParameters.BackgroundColor = [0 0 0]; PRTParameters.TextColor = [255 255 255]; PRTParameters.TimeCourseCol...
757cc6f0d3783b6925733a346101c022b633e2f8f934317211b2de259a612488
MATLAB
1,206
62
function y = stretchcurve(x,k,n) % OUTPICT = STRETCHCURVE(INPICT,K,{N}) % power-function based symmetric contrast adjustment tool % this is used by imlnc(), etc % % INPICT is a unit-scale float array % values must lie in the unit interval % K is a scalar adjustment factor >=0 % N specifies the number of points to us...
ebe9a214a2097f16599443bd64e0cde678436631d7099dc1b98509af99b4de06
MATLAB
1,212
43
function runIntersect = mintersect(varargin) %MINTERSECT Multiple set intersection. % MINTERSECT(A,B,C,...) when A,B,C... are vectors returns the values % common to all A,B,C... The result will be sorted. A,B,C... can be cell % arrays of strings. % % MINTERSECT repeatedly evaluates INTERSECT on successive p...
080fe64ad43584767566a8b2dcf345f3d4af8db9eb8af2541762cbf4504030f3
MATLAB
1,213
36
function [PFM] = CBIG_compute_PFM_general(feature_file, y_pred_train_file) % [PFM] = CBIG_compute_PFM_general(feature_file, y_pred_train_file) % % This function computes the predictive network features for general purpose % by computing the covariance between the features and the predicted behavior % (Haufe et al. 20...
81b50f98a528a82248bb2f601234359c3abf6ad62a2527414b5366b89e6f7588
MATLAB
1,214
39
function outpict = eoline(inpict,dim,rat,offset) % EOLINE(INPICT, DIM, RATIO, {OFFSET}) % extracts every N/D lines from INPICT % can be used for generating grids and regular line fields % % INPICT is a 2-D, 3-D or 4-D image array % DIM specifies the dimension along which to scan % 1 returns rows...
e8749822be07353c0484fbdc634a91d2413561631f55d9958254253267313be9
MATLAB
1,216
42
%% % Function version of if ... else ... end statement. The syntax is % conditional(test1, yes1, test2, yes2, ..., testN, yesN, allNo) % If all tests fail then the return value is allNo. % function [answer] = conditional(varargin) if nargin < 3 || mod(nargin, 2) ~= 1 error('An odd number of ar...
e9d43e8a6e22ef955fd7d228852286c9a4c76e20536903a7030e9da4782f8124
MATLAB
1,216
22
% Score for how much a given data point is an outlier, based on a range-scaled distance from the mode function outlierness = outlierScore(score, bulkProb) %% Find the mode and range of the score distribution, the latter as the location that has probability density that is a specified fraction of the modal densi...
58ea47223074467053a7cdfbcbdc8216c669b1f0bea84251f4ea578683ef966d
MATLAB
1,218
43
function data = remove_artefacted_trials(cfg, data) %remove artefacted trials,, defined by a value >0 in trialinfo.artefact if isempty(data) return end cfg.minbadtime = ft_getopt(cfg, 'minbadtime', []); for ipart = 1:size(data,2) fprintf('For part %d\n', ipart); for markername = string(fieldnam...
63f240d161987a3776cb02fbaf94c7a3e07c5b9f98e7b5ad3898061493688b00
MATLAB
1,219
43
function isort = sort_spike_trains(S) [U, Sv, ~] = svd(S); % U has "eigenvectors" ("principal components") of S, Sv the "eigenvalues" [~, isort] = sort(U(:, 1), 'descend'); % sort by "first component" if min(size(S, 1), size(S, 2)) < 100 iPC = 1 : min(size(S, 1), size(S, 2)); else iPC = 1 : 100; end S = U(:,...
b7253e86511526286ea1b8e52f824b5862d27376ad9d414ae61d3a213ff23416
MATLAB
1,222
47
function [flt_data] = getcleanedbsdata(bsvals,fs,range); % Usage. [DataOut numrej idjrej]= getcleanedbsdata(DataIn,fs, range) % Performs, outlier detection, removal and bandpass filtering % % Input(s): % - DataIn, are the bendsensor values % - fs, is the sample rate as in 1000 samples per second % - range...
9c25001ee4ba0e0754a4e31efe91522dad488b8e69cd960e630c4c5665affd2f
MATLAB
1,224
47
function [trimmed] = trimarray(array, direction, varargin) % TRIMARRAY Removes leading and/or training elements of the given array % that are close to zero. % % The following syntaxes are supported: % trimarray([...]) % trimarray([...], 'pre') % trimarray([...], 'post') % trimar...
796b239aeaeefec6cf7b664778659129e5f7d80c12ee4a41662ef7476a6c22bb
MATLAB
1,226
41
function v=mysmooth(v,k,p) %Fast convolution Gaussian smoothing in 3D % k: Scalar smoothing kernel for eigencoil calculation in image domain % specified in voxels. % p: Padding for eigencoil calculation in image space [voxels]; for no % padding supply [0,0,0] % Assumes even padded dimensions dims=size(v); % ...
ea69053fd466fcbef6e29bbf7bea99c0de9c756ef878fa3acf77db2f5333301c
MATLAB
1,226
29
%% Demo 2 - Paired t-test equivalent (random intercept per subject) % When the same subjects are measured under both conditions, accounting for the % pairing is both more correct and more powerful. Shown on the sleep dataset % (R base), where both drugs were measured on the same 10 patients. A random % intercept per pa...
90439f24c5c6d5ef43c7653afeeedec83f334dd99bb551b5f98d74e22f0a8fe9
MATLAB
1,227
35
function Y = tiff_reader(name,T) % Y = tiff_reader(name,T) % % read tiff stack. Optional truncate to first T timesteps % % The inputs to this function are % name: String pointing to the tif file to load % T: Number of frames to extract % % The output to this function is % Y: 3D array...
3fda75f1d1650b8f46ca32828ac029acfc854249a4aeaec5a54e4b1527690892
MATLAB
1,228
46
clc clear all data = readNPY('D:\YCB\YCB\PROJECT\EEG_signal_processing\python\raw_signal.npy'); %ese a0 =[ 1. -0.93906251]; b0 =[ 0.96953125 -0.96953125]; x_filtered_band0 = filter(b0,a0, data); x_filtered_band_abs = abs(x_filtered_band0); a1 = [ 1. -0.99748988]; b1 = [0.00125506 0.00125506]...
6b3b88baebe2df7da9d468640cc371c085b08a24e6fee20a32408a63c566b7cb
MATLAB
1,228
72
function M = par2affineMat(t,r,s,h) % Creates a 3D affine transformation matrix from translation (t), % rotation(r), scale(s) and shear(h) parameters. % % t: [t_x t_y t_z] % r: [rotateX rotateY rotateZ] in degrees % s: [scaleX scaleY scaleZ] % h: [ShearXY, ShearXZ, ShearYX, ShearYZ, ShearZX, ShearZY] % if ~exi...