Commit a62652e3 authored by Niels Kloosterman's avatar Niels Kloosterman
Browse files

added check for nans in input data, which can happen if coming from timelock...

added check for nans in input data, which can happen if coming from timelock with var trl lengths), which is converted to raw by ft_checkdata
parents d2c3b4c0 3fc49264
......@@ -115,8 +115,9 @@ cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'});
% ensure that the options are valid
% cfg = ft_checkopt(cfg, 'normalized_r', 'double', {0, 1});
cfg = ft_checkopt(cfg, 'recompute_r', 'char', {'perscale_toi_sp', 'per_scale'});
cfg = ft_checkopt(cfg, 'coarsegrainmethod', 'char', {'filtskip', 'pointavg', 'bp', 'hp'});
cfg = ft_checkopt(cfg, 'recompute_r', 'char', {'perscale_toi_sp', 'per_scale', 'per_toi'});
cfg = ft_checkopt(cfg, 'coarsegrainmethod', 'char', {'filtskip', 'pointavg'});
cfg = ft_checkopt(cfg, 'filtmethod', 'char', {'lp', 'hp', 'bp', 'no'});
% get the options
cfg.trials = ft_getopt(cfg, 'trials', 'all', 1);
......
function mse = ft_permentropyanalysis(cfg, data)
% 181019 JQK | line 131, 249, 259, 261 287 commented
% | line 163 verbosity changed
% | save r parameter
% | add option for HPF & BPF
% | also use coarsegrainmethod for scale 1 (e.g., HPF)
% 181026 JQK | 364 ff. change encoding from sc to s to allow for nonlinear scale encoding
% 191030 JQK | filter entire time series first, then temporally segment
% | do not require data.trialinfo, get trialsize from .trial
% 190401 JQK | removed floor() for frequencies, at scale 1 use no LPF
% 190402 JQK | replaced sample entropy with permutation entropy
% 190405 JQK | corrected BP setting: at scale 1 only use HP
% vs. LP
% FT_PERMENTROPYANALYSIS performs temporally-resolved permutation entropy
% on time series data over multiple trials
%
......@@ -115,7 +102,8 @@ cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'});
% ensure that the options are valid
cfg = ft_checkopt(cfg, 'nrm', 'double', {0, 1});
cfg = ft_checkopt(cfg, 'coarsegrainmethod', 'char', {'filtskip', 'pointavg', 'bp', 'hp'});
cfg = ft_checkopt(cfg, 'coarsegrainmethod', 'char', {'filtskip', 'pointavg'});
cfg = ft_checkopt(cfg, 'filtmethod', 'char', {'lp', 'hp', 'bp', 'no'});
% get the options
cfg.trials = ft_getopt(cfg, 'trials', 'all', 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment