<div dir="ltr">Hi Matthias,<div><br></div><div>Perhaps you could try taking the part of the trial you want to reject and replacing the values there with NaNs? Then you'd be able to remove the artifact-related part of the data while keeping your trials of the same length. I know that some FieldTrip functions can deal with NaNs, so this may be a solution. </div><div><br></div><div>All the best,</div><div>Marisha</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, May 14, 2018 at 3:35 PM Matthias Franken <<a href="mailto:Matthias.Franken@ugent.be">Matthias.Franken@ugent.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="en-BE">
<div class="m_7342800930327893443WordSection1">
<p class="MsoNormal"><span lang="EN-US">Dear all,</span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have an EEG dataset that consists of quite long trials (>20s). Therefore, For artifact rejection I would like to only reject the part of the trial that contains the artifact, rather than throwing away the entire trial,
and thus I will use the cfg.artfctdef.method = ‘partial’; option in ft_rejectartifact.</span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">However, this leads to some trials being cut in two shorter “trials” (i.e., the part before the artifact and the part after the artifact). I’m guessing this will lead to edge artifacts in my time-frequency analysis, not
only at the edges of the original trials, but also at time points where artifacts were cut out. SO I’m not sure how to deal with this.</span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I guess one option would be to perform the time-frequency analysis first, and afterwards cut out the artifacts, although (1) that might lead to the artifact smearing into data points that were not cut out, depending on
the time window width during frequency analysis, and (2) the artifacts identified visually using ft_databrowser are define din ample numbers, and the result from ft_freqanalysis downsamples the data.</span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Did anyone face similar issues or have ideas on how to get around this?</span><span lang="en-BE"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-BE"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="en-BE"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="en-BE"><br>
________________________________________<br>
Matthias Franken<br>
postdoctoral researcher<br>
Experimental Psychology Department<br>
Ghent University<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-BE"><u></u> <u></u></span></p>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></blockquote></div>