<div dir="ltr"><div>Hi Vahab,</div><div><br></div><div>Thanks for the response.<br></div><div><br></div><div>The data is already epoched so I tried ft_redefine trial as you suggested. I think the problem is that the segments marked as artefact are also marked with triggers. I therefore need some way of saying:<br></div><div><br></div><div>"cfg.trials = {'s 1', 's 2'} except those also marked 'Bad Interval'"      <br></div><div><br></div><div>I even tried cfg.trials = not('Bad Interval')  - it doesn't work. I tried it also with ft_rejectartifact but I'm not sure how to get it to recognise the 'Bad Interval' marking.</div><div><br></div><div>Any ideas?</div><div><br></div><div>Many thanks,<br></div><div>Kate<br></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 16, 2018 at 10:13 PM Vahab Yousofzadeh <<a href="mailto:bioeng.yoosofzadeh@gmail.com" target="_blank">bioeng.yoosofzadeh@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kate,<br>
<br>
if it is a continuous data (before epoching), you can treat bad<br>
segments as an artifact (e.g. eog or muscle, etc) and do something<br>
like this,<br>
<br>
% artifact_EOG = [100  500]; % in sample<br>
<br>
cfg = [];<br>
cfg.artfctdef.eog.artifact    = artifact_EOG;<br>
cfg.artfctdef.reject          = 'value';<br>
%     cfg.artfctdef.value           = 0;  % replacing values with nan or 0<br>
data_continuous_eog_clean = ft_rejectartifact(cfg, data); % data is<br>
the output from ft_preprocessing.<br>
<br>
% inspecting cleaned data<br>
cfg             = [];<br>
cfg.continuous  = 'yes';<br>
cfg.viewmode    = 'vertical'; % all channels seperate<br>
cfg.blocksize   = 5;         % view the continous data in 30-s blocks<br>
ft_databrowser(cfg, data_continuous_eog_clean);<br>
<br>
if the data is epoched, simply use ft_redefinetrial.<br>
<br>
Best,<br>
Vahab<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_6122728746879308340m_-7394332770552128799gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><font color="#888888"><div><div><div><div>Kate Stone<br></div>PhD candidate<br></div>Vasishth Lab | Department of Linguistics<br></div>Potsdam University, 14467 Potsdam, Germany<br></div><a href="https://auskate.github.io" target="_blank">https://auskate.github.io</a></font></span></div></div>