<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</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="">Checking for the number of unique rows in the sampleinfo field does not ensure that the data are not overlapping.</div>
<div class=""><br class="">
</div>
<div class="">e.g.</div>
<div class=""><br class="">
</div>
<div class="">data.sampleinfo = [1 200;</div>
<div class="">                              100 300];</div>
<div class=""><br class="">
</div>
<div class="">is a valid specification, and unique(data.sampleinfo, ‘rows’) gives 2, yet the samples are overlapping.</div>
<div class=""><br class="">
</div>
<div class="">I don’t think the loss of chronology is causing the problem.</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 class="">
<blockquote type="cite" class="">
<div class="">On 08 May 2016, at 14:10, 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="">
Dear Jan-Mathijs,<br class="">
<br class="">
Many thanks for your swift response. You were right, I am losing the sampleinfo generating<font face="Courier New" class="">tmpdata_small</font>. However, even when I use the original data, i.e.<span class="Apple-converted-space"> </span><font face="Courier New" class="">data_segm_offsetcorr</font><span class="Apple-converted-space"> </span>that
 includes the sampleinfo, the problem continues to occur. However, I now get the warning that<span class="Apple-converted-space"> </span><font face="Courier New" class="">samples are present in multiple trials<font face="Tahoma" class="">. Checking the the
 number of unique rows in</font></font><font face="Courier New" class=""><font face="Tahoma" class=""><font face="Courier New" class="">data_segm_offsetcorr.sampleinfo<span class="Apple-converted-space"> </span><font face="Tahoma" class="">however finds the
 correct number of trials, it seems as if there were no doublings (which I would also not expect).<span class="Apple-converted-space"> </span><br class="">
<br class="">
My trials are not in chronological order, though, but sorted according to<span class="Apple-converted-space"> </span></font></font></font></font><font face="Courier New" class=""><font face="Tahoma" class=""><font face="Courier New" class=""><font face="Tahoma" class=""><font face="Courier New" class=""><font face="Courier New" class="">data_segm_offsetcorr.</font>trialinfo</font>.
 May that confuse fieldtrip?<br class="">
<br class="">
Best,<br class="">
Christine<br class="">
</font></font></font></font>
<div class=""><br class="">
</div>
<div style="font-family: 'Times New Roman'; font-size: 16px;" class="">
<hr tabindex="-1" class="">
<div id="divRpF721715" style="direction: ltr;" class=""><font face="Tahoma" size="2" class=""><b class="">Von:</b><span class="Apple-converted-space"> </span><a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>]"
 im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>]<br class="">
<b class="">Gesendet:</b><span class="Apple-converted-space"> </span>Sonntag, 08. Mai 2016 09:46<br class="">
<b class="">An:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list<br class="">
<b class="">Betreff:</b><span class="Apple-converted-space"> </span>Re: [FieldTrip] ft_databrowser & ft_rejectartifact - wrong number of trials rejected<br class="">
</font><br class="">
</div>
<div class=""></div>
<div 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 class="">
<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="" target="_blank" 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;">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="" target="_blank" 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;">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</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="">
<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=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a></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=""><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>