<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Christine,
<div class=""><br class="">
</div>
<div class="">Are you sure that the tmpdata_small and data_segm_offsetcorr are consistent with respect to each other? As long as this is not the case, I am not surprised that fieldtrip ‘misbehaves’.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 08 May 2016, at 09:26, Blume Christine <<a href="mailto:christine.blume@sbg.ac.at" class="">christine.blume@sbg.ac.at</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">
<font size="2" class="">Good morning,<br class="">
<br class="">
I discovered that using ft_databrowser & ft_rejectartifact to preprocess my EEG data, often the wrong number of trials is rejected. This is the code I am using and it inherits data resulting from ft_redefinetrial.<br class="">
<br class="">
<font face="Courier New" class="">    cfg = [];<br class="">
    cfg.latency = [-2 2];<span class="Apple-converted-space"> </span><font color="808000" class="">% period of interest</font><br class="">
    tmpdata_small = ft_selectdata(cfg,data_segm_offsetcorr);<br class="">
<br class="">
    cfg = [];<br class="">
    cfg.layout = layout2;<br class="">
    cfg.showlabel = 'yes';<br class="">
    cfg.channel = 'EEG';<br class="">
    cfg.gradscale = 0.04;<br class="">
    cfg.continuous = 'no';<br class="">
 <font color="808000" class="">   % filtering only for artifact rejection</font><br class="">
    cfg.preproc.lpfilter  = 'yes';<br class="">
    cfg.preproc.lpfreq = 40;<br class="">
<br class="">
    cfg_databrowser = ft_databrowser(cfg, tmpdata_small);<br class="">
    data_segm_offsetcorr = ft_rejectartifact(cfg_databrowser, data_segm_offsetcorr);<br class="">
<br class="">
<font face="Calibri" size="3" class="">If I now, for example mark 10 trials in the databrowser and then run ft_rejectartifact, it tells me:<span class="Apple-converted-space"> </span><br class="">
<br class="">
<font face="Courier New" size="2" class="">detected 10 visual artifacts<br class="">
rejected 8 artifacts completely<br class="">
<br class="">
<font size="3" class=""><font face="Calibri" class="">Something seems to be wrong here as I clearly marked 10 artifacts (don't really care whether they are visual or not), but only 8 are removed. The problem gets worse when I call the function a second time,
 which is when usually none of the marked artefacts are rejected at all.<br class="">
<br class="">
Any idea where the problem could be?<br class="">
<br class="">
Many thanks!<br class="">
Best,<br class="">
Christine</font></font></font></font><span class="Apple-converted-space"> </span></font><br class="">
</font></div>
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:fieldtrip@donders.ru.nl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">fieldtrip@donders.ru.nl</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>