Commit 3fc49264 authored by Julian Kosciessa's avatar Julian Kosciessa
Browse files

corrected input checks for r adaptation

parent 14b0fb10
...@@ -93,17 +93,14 @@ end ...@@ -93,17 +93,14 @@ end
% read from an old *.mat file % read from an old *.mat file
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');
% % TODO check if the input cfg is valid for this function
% cfg = ft_checkconfig(cfg, 'renamed', {'blc', 'demean'});
% cfg = ft_checkconfig(cfg, 'renamed', {'blcwindow', 'baselinewindow'});
% ensure that the required options are present % ensure that the required options are present
cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'}); cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'});
% ensure that the options are valid % ensure that the options are valid
% cfg = ft_checkopt(cfg, 'normalized_r', 'double', {0, 1}); % 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, 'recompute_r', 'char', {'perscale_toi_sp', 'per_scale', 'per_toi'});
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 % get the options
cfg.trials = ft_getopt(cfg, 'trials', 'all', 1); cfg.trials = ft_getopt(cfg, 'trials', 'all', 1);
......
function mse = ft_permentropyanalysis(cfg, data) 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 % FT_PERMENTROPYANALYSIS performs temporally-resolved permutation entropy
% on time series data over multiple trials % on time series data over multiple trials
% %
...@@ -115,7 +102,8 @@ cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'}); ...@@ -115,7 +102,8 @@ cfg = ft_checkconfig(cfg, 'required', {'toi', 'timescales'});
% ensure that the options are valid % ensure that the options are valid
cfg = ft_checkopt(cfg, 'nrm', 'double', {0, 1}); 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 % get the options
cfg.trials = ft_getopt(cfg, 'trials', 'all', 1); 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