<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;">Hi Phyllis,<div><br></div><div>I have a similar situation - ft_databrowser after appending - and I solved the problem of not seeing events at the right times by manually rebuilding them. For artefact rejection I found it important to know when in the trial eg. blinks occurred. There is the (undocumented?) cfg.event input option, which I used in the following way</div><div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45);"><span style="color: rgb(0, 0, 0);">        </span>% ARTIFICIALLY REBUILD EVENTS</div><div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45);">        </div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        <span style="color: #0433ff">for</span> t = 1:length(data.trial),</div><p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px;">            <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45);"><span style="color: #000000">            </span>% get the distance between each event and the start of the trial</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            samples(t,1) = trl(t,2)-trl(t,1); <span style="color: #25992d">%int1</span></div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            samples(t,2) = trl(t,5)-trl(t,1); <span style="color: #25992d">%int2</span></div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            samples(t,3) = trl(t,8)-trl(t,1); <span style="color: #25992d">%resp</span></div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            samples(t,4) = trl(t,10)-trl(t,1); <span style="color: #25992d">%fb</span></div><p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px;">            <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45);"><span style="color: #000000">            </span>% add the length of this trial</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            samples(t,:) = samples(t,:) + (12*600*t-1);</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        <span style="color: #0433ff">end</span></div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        samples = reshape(samples', 1, numel(samples));</div><p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45);"><span style="color: #000000">        </span>% create events structure to feed into databrowser</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        <span style="color: #0433ff">for</span> i = 1:length(samples),</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            e(i).type = <span style="color: #b245f3">'x'</span>;</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            e(i).sample = samples(i);</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            e(i).value = [];</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            e(i).offset = 0;</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">            e(i).duration = 1;</div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        <span style="color: #0433ff">end</span></div><div style="margin: 0px; font-size: 10px; font-family: Courier;">        cfg.event = e;</div><div style="margin: 0px; font-size: 10px; font-family: Courier;"><br></div><div style="margin: 0px; font-size: 10px; font-family: Courier;"><div style="margin: 0px;">        cfg = ft_databrowser(cfg, data);</div></div><div><br></div><br><div><div>in which the trl matrix I use has samples of events at column 2, 5, 8, and 10, and the first column has the start of the trial in samples. Also, each trial takes 12 seconds at sampling rate 600 Hz. For trials of unequal length, you need to do a bit better bookkeeping on the assumption that fieldtrip treats epoched data as continuous data from the same recording.</div><div><br></div><div>Hope this helps!</div><div>Cheers,</div><div>Anne</div><div><br></div></div><div apple-content-edited="true">
<div class="" style="text-align: -webkit-auto; orphans: 2; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">---<br>Anne E. Urai, MSc<br>PhD student | Institute for Neuro- and Pathophysiology | University Medical Center Hamburg-Eppendorf  | Hamburg, Germany | <a href="http://anneurai.wordpress.com">anneurai.wordpress.com</a></div><div><br></div></div><div><div><br></div><div><br></div><div>On 14 Mar 2014, at 14:11, Jörn M. Horschig <<a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Heyho,<br><br>yes, I think the databrowser digs deep down in data.cfg to obtain the original event-matrix of your dataset. After the sampleinfo-field is reconstructed, the databrowser tries to relate the sampleinfo field with the original event-structure. As the two have nothing in common anymore, the output will of course be nonsense. Removing the cfg is imho the only option to prvent the databrowser from doing so. But this is clearly something that the databrowser should not do, because we want a smart databrowser, not a stupid one ;)<br>Phyllis, could you be so kind to open up a bug on <a href="http://bugzilla.fcdonders.nl">bugzilla.fcdonders.nl</a> about this? Just shortly describe what you are doing in terms of code and describing the error would be sufficient. We will then take care that this get's solved in future versions.<br>If you have questions about bugzilla or if you do not want to post the bug there, please let me/us know. But we'd appreciate if you could open up a bug :) Thanks in any case for your message!<br><br>Best,<br>Jörn<br><br><br>On 3/14/2014 1:52 PM, Phyllis Mania wrote:<br><blockquote type="cite"><br>Dear Eelke,<br><br>Calling ‘rmfield’ helped, thank you!<br><br>Cheers,<br><br>Phyllis<br><br><br><br>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br></blockquote><br><br>-- <br>Jörn M. Horschig<br>PhD Student<br>Donders Institute for Brain, Cognition and Behaviour<br>Centre for Cognitive Neuroimaging<br>Radboud University Nijmegen<br>Neuronal Oscillations Group<br>FieldTrip Development Team<br><br>P.O. Box 9101<br>NL-6500 HB Nijmegen<br>The Netherlands<br><br>Contact:<br>E-Mail: <a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a><br>Tel:    +31-(0)24-36-68493<br>Web: <a href="http://www.ru.nl/donders">http://www.ru.nl/donders</a><br><br>Visiting address:<br>Trigon, room 2.30<br>Kapittelweg 29<br>NL-6525 EN Nijmegen<br>The Netherlands<br><br>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br></blockquote></div><br></div></body></html>