Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LNDG
mMSE
Commits
3fc49264
Commit
3fc49264
authored
Apr 11, 2019
by
Julian Kosciessa
Browse files
corrected input checks for r adaptation
parent
14b0fb10
Changes
2
Hide whitespace changes
Inline
Side-by-side
ft_entropyanalysis.m
View file @
3fc49264
...
...
@@ -93,17 +93,14 @@ end
% read from an old *.mat file
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
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
);
...
...
ft_permentropyanalysis.m
View file @
3fc49264
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment