<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Ricarda,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">All three criteria have a certain threshold that has to be met in order for a trial to be marked as containing artifacts so for all criteria you could use ft_artifact_threshold
 (or ft_artifact_zvalue). The difference will be how you preprocess the signal. You would need to transform the signal so that for criteria nr. 2 the signal represents the potential difference over a 200ms window?, and for nr. 3 the potential difference per
 sampling point. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Number 3 is relatively easy, you can calculate the first temporal derivative (ie. the difference between two consecutive samples) with cfg.artfctdef.threshold.derivative
 = ‘yes’ (or ….threshold.absdiff = ‘yes’, if you want the absolute difference). So something like this should work:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cfg.artfctdef.threshold.channel   = cell-array with channel labels<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cfg.artfctdef.threshold.bpfilter  = 'no';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cfg.artfctdef.threshold.absdiff = ‘yes’;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cfg.artfctdef.threshold.max       = 50;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Number 2 is slightly more difficult because you want to integrate over a larger window. I don’t fully understand what you want to avoid, should the signal at
 time X stay within 3uV of the signal at time X + 200ms?  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Jim<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl]
<b>On Behalf Of </b>Ricarda Braukmann<br>
<b>Sent:</b> woensdag 18 november 2015 12:58<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> [FieldTrip] Automatized artifact rejection in FT<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi everyone,<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I would like to implement an automatized artifact rejection procedure for my EEG data and compare this to manual rejection.<br>
<br>
I would like to use the following criteria for rejection of a segment:<br>
<br>
1. amplitudes below -150 or above 150 µV<br>
2. a difference of 3 µV per 200 ms, <br>
3. or a voltage change of 50 µV per sampling point<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Is there a function in fieldtrip that I can use for implementing these different criteria?<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I know that FT_ARTIFACT_THRESHOLD can reject segments on basis of the first criteria but I am unsure how to implement the second two.<o:p></o:p></p>
</div>
<p class="MsoNormal">Any help would be highly appreciated.<o:p></o:p></p>
</div>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
</div>
<p class="MsoNormal">Ricarda<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><br>
Ricarda Braukmann, MSc<br>
PhD student<br>
              <br>
Radboud University Medical Centre & Baby Research Center       <br>
<br>
Donders Institute for Brain, Cognition and Behaviour, <br>
Centre for Neuroscience & Centre for Cognition<br>
<br>
Room B.01.22<br>
Phone: +31 (0) 24 36 12652<br>
Email: <a href="mailto:r.braukmann@donders.ru.nl" target="_blank">r.braukmann@donders.ru.nl</a>
<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Website: <a href="http://www.zebra-project.nl/" target="_blank">
http://www.zebra-project.nl/</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>