[FieldTrip] automatic artifact rejection: error with ft_artifact_zvalue

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue May 7 13:23:17 CEST 2019


Dear Erika,

I must confess that I am not familiar with that particular corner of the code, but reading your message (and the corresponding code), I get the impression that the cause of you ending up with an error (with the particular data you are using it with) is caused by the fact that the peak detection algorithm does not find a peak, leaving the ‘peaks’ variable undefined.

This means that the code is not sufficiently robust. I don’t know what the intended behavior is, but I could imagine that defining ‘peaks’ and ‘dssartifct’ to be empty variables, before entering the for loop in line 572 would do the trick.

This keeps unanswered my question why you want the arfctpeak to be defined in the first place… I agree that this is a poorly documented option, but I doubt whether you need it.

Best wishes,
Jan-Mathijs


On 7 May 2019, at 11:38, Erika Puiutta <erika.puiutta at uni-oldenburg.de<mailto:erika.puiutta at uni-oldenburg.de>> wrote:


Hello!

Short introduction as this is my first email to this mailing list: I am Erika, 28, master student of neurocognitive psychology in Germany. I am analyzing MEG data for my master thesis and would like to perform automatic artifact rejection using ft_artifact_zvalue. This has worked in the past, but now I get the error:

"Undefined function or variable 'peaks'.
Error in ft_artifact_zvalue (line 594)
  cfg.artfctdef.zvalue.peaks=peaks'; "

I call the funciton as [cfg, artifact] = ft_artifact_zvalue(cfg, data).
My cfg is comprised of:
                cfg=[];
                cfg.artfctdef.zvalue.channel = 'MEG';
                cfg.artfctdef.zvalue.cutoff = 7;
                cfg.artfctdef.zvalue.trlpadding = 0;
                cfg.artfctdef.zvalue.artpadding = 0;
                cfg.artfctdef.zvalue.fltpadding = 0;
                cfg.artfctdef.zvalue.interactive = 'no';
                cfg.artfctdef.zvalue.artfctpeak  = 'yes';
and my data is segmented and filtered MEG data:
hdr: [1×1 struct]
label: {200×1 cell}
time: {1×60 cell}
trial: {1×60 cell}
fsample: 1000
sampleinfo: [60×2 double]
trialinfo: [60×1 double]
grad: [1×1 struct]
elec: [1×1 struct]
cfg: [1×1 struct]

Googling hasn't brought me any closer to a solution. I tried removing fieldtrip from the path, adding it again, and calling ft_defaults again. I also downloaded a new version of fieldtrip.
Does anyone have an idea what might be the problem here?
Thanks for aswers in advance!

Kind regards
Erika


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190507/ff9a8645/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list