<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" class="" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear Jan-Mathijs,<br>
<br>
Many thanks for your swift response. You were right, I am losing the sampleinfo generating
<font face="Courier New">tmpdata_small</font>. However, even when I use the original data, i.e.
<font face="Courier New">data_segm_offsetcorr</font> that includes the sampleinfo, the problem continues to occur. However, I now get the warning that
<font face="Courier New">samples are present in multiple trials<font face="Tahoma">. Checking the the number of unique rows in
</font></font><font face="Courier New"><font face="Tahoma"><font face="Courier New">data_segm_offsetcorr.sampleinfo
<font face="Tahoma">however finds the correct number of trials, it seems as if there were no doublings (which I would also not expect).
<br>
<br>
My trials are not in chronological order, though, but sorted according to </font>
</font></font></font><font face="Courier New"><font face="Tahoma"><font face="Courier New"><font face="Tahoma"><font face="Courier New"><font face="Courier New">data_segm_offsetcorr.</font>trialinfo</font>. May that confuse fieldtrip?<br>
<br>
Best,<br>
Christine<br>
</font></font></font></font>
<div><br>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF721715"><font face="Tahoma" color="#000000" size="2"><b>Von:</b> fieldtrip-bounces@science.ru.nl [fieldtrip-bounces@science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen@donders.ru.nl]<br>
<b>Gesendet:</b> Sonntag, 08. Mai 2016 09:46<br>
<b>An:</b> FieldTrip discussion list<br>
<b>Betreff:</b> Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected<br>
</font><br>
</div>
<div></div>
<div>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="" target="_blank">christine.blume@sbg.ac.at</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" 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; direction:ltr; font-family:Tahoma; font-size:10pt">
<font class="" size="2">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 class="" face="Courier New">    cfg = [];<br class="">
    cfg.latency = [-2 2];<span class="Apple-converted-space"> </span><font class="" color="808000">% 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 class="" color="808000">   % 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 class="" face="Calibri" size="3">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 class="" face="Courier New" size="2">detected 10 visual artifacts<br class="">
rejected 8 artifacts completely<br class="">
<br class="">
<font class="" size="3"><font class="" face="Calibri">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 class="" 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; float:none; display:inline!important">_______________________________________________</span><br class="" 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">
<span class="" 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; float:none; display:inline!important">fieldtrip
 mailing list</span><br class="" 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">
<a href="mailto:fieldtrip@donders.ru.nl" class="" 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" target="_blank">fieldtrip@donders.ru.nl</a><br class="" 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">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="" 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" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>