[FieldTrip] Replacing artifacts part of EEG/MEG signal by nan value

Erfan Vi erfan1994vi at gmail.com
Sun May 5 20:36:48 CEST 2024


Dear FieldTrip users,
I use the  ArtifactMEG.zip
<https://download.fieldtriptoolbox.org/tutorial/ArtifactMEG.zip> example
MEG dataset and code in the link
https://www.fieldtriptoolbox.org/tutorial/ica_artifact_cleaning/ to remove
the artifact as follows:
cfg = [];
cfg.continuous = 'yes';
cfg.blocksize = 60;
cfg.plotevents = 'no';
cfg.preproc.demean  = 'yes';
cfg.layout = 'CTF151.lay';
cfg = ft_databrowser(cfg, data);
cfg_artfctdef = cfg.artfctdef;

cfg = [];
cfg.artifactdef = cfg_artfctdef;
cfg.artfctdef.reject = 'nan';
data_clean = ft_rejectartifact(cfg, data);

For two reasons, the specified regions of the artifact are not replaced by
the nan value:
1) The output printed in the command window is:
rejected   0 trials completely
rejected   0 trials partially
filled parts of   0 trials with NaNs
filled parts of   0 trials with the specified value
resulting   1 trials
the call to "ft_rejectartifact" took 1 seconds
2) When I use the ft_singleplotER or ft_databrowser function again for
data_clean, basically the areas replaced with the nan value should be
invisible, which is not the case.
Can anyone explain to me what's the problem?
Thank you,
Erfan Vajdi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240505/938bbdc9/attachment.htm>


More information about the fieldtrip mailing list