<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Erfan,
<div class=""><br class="">
</div>
<div class="">Could it be that there is a typo here?</div>
<div class=""><br class="">
</div>
<div class="">
<blockquote type="cite" class="">
<div dir="ltr" class="">
<div class="">cfg.artifactdef = cfg_artfctdef -> cfg.artfctdef = cfg_artfctdef;</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
Best wishes,</div>
<div class="">Jan-Mathijs<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 24 Jul 2023, at 08:43, Erfan Vi via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Dear FieldTrip users,
<div class="">I use the  <a href="https://urldefense.com/v3/__https://download.fieldtriptoolbox.org/tutorial/ArtifactMEG.zip__;!!HJOPV4FYYWzcc1jazlU!4vKXD91CTmKqghFOD3Hgu_P6uxQdXXMKO4yQwwLLlgsOkdwBZ385rFZK23er0FM8P4cEUSNk0NW_7HzsUvmxaFOIew$" style="box-sizing:border-box;color:rgb(113,24,28);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;text-align:justify" class="">
ArtifactMEG.zip</a><span style="color:rgb(33,37,41);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;text-align:justify" class=""> example
 MEG dataset</span> and code in the link <a href="https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/ica_artifact_cleaning/__;!!HJOPV4FYYWzcc1jazlU!4vKXD91CTmKqghFOD3Hgu_P6uxQdXXMKO4yQwwLLlgsOkdwBZ385rFZK23er0FM8P4cEUSNk0NW_7HzsUvmxQBI3Lw$" class="">https://www.fieldtriptoolbox.org/tutorial/ica_artifact_cleaning/</a>
 to remove the artifact as follows:</div>
<div class="">cfg = [];<br class="">
cfg.continuous = 'yes';  <br class="">
cfg.blocksize = 60;   <br class="">
cfg.plotevents = 'no';<br class="">
cfg.preproc.demean  = 'yes';<br class="">
cfg.layout = 'CTF151.lay';<br class="">
cfg = ft_databrowser(cfg, data);<br class="">
</div>
<div class="">cfg_artfctdef = cfg.artfctdef;<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.artifactdef = cfg_artfctdef;<br class="">
cfg.artfctdef.reject = 'nan';<br class="">
data_clean = ft_rejectartifact(cfg, data);<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">For two reasons, the specified regions of the artifact are not replaced by the null value:</div>
<div class="">1) The output printed in the command window is:</div>
<div class="">rejected   0 trials completely<br class="">
rejected   0 trials partially<br class="">
filled parts of   0 trials with NaNs<br class="">
filled parts of   0 trials with the specified value<br class="">
resulting   1 trials<br class="">
the call to "ft_rejectartifact" took 1 seconds<br class="">
</div>
<div class="">2) When I use the ft_databrowser function again for data_clean, basically the areas replaced with the null value should be invisible, which is not the case.</div>
<div class="">Can anyone explain to me what's the problem?</div>
<div class="">Thank you,</div>
<div class="">Erfan Vajdi</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5Elnov9n-jvdLZPJJ37SCY8838Vwb8g8vIJRVIkVY7LptSOmvV34t0KzX4srA9AfkpIhoWGHJfaHl0EV3aOz5ftlbI0xDb1XBiTiPA$
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>