<HTML>
<HEAD>
<TITLE>Re: [FIELDTRIP] trl information in ft_resampledata</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12pt'>Hi Hannah,<BR>
<BR>
What you need to do is also resample the start and stop indices in the trl, as this still contains the indices relative to the sample rate from before ft_resample. The line of code that did it for me was:<BR>
<BR>
        data.cfg.trl(:,1:3) = round(data.cfg.trl(:,1:3) * (1/cfg.fsample) * cfg.resamplefs);       %resample the trl indices too or visual artifact rejection won't work<BR>
<BR>
Where fsample is your original sample rate and resamplefs the sample rate after resampling. If all is well the trl is now also updated as you discard trials during visual artefact rejection.<BR>
<BR>
Hope this helps.<BR>
<BR>
Best,<BR>
Niels<BR>
<BR>
</SPAN><FONT SIZE="1"><SPAN STYLE='font-size:8pt'>---<BR>
<BR>
<FONT COLOR="#808080">Niels A. Kloosterman MSc.<B>|</B></FONT><B><FONT COLOR="#979797"> PhD student</FONT></B><FONT COLOR="#979797"> <B>| </B>University of Amsterdam <B>| </B>Cognitive Neuroscience Group <B>| </B>Dept. of Psychology <B>| </B>Roetersstraat 15, A614 <B>| </B>1018 WB Amsterdam <B>| </B>Tel: +31 20 525 6847<BR>
</FONT></SPAN></FONT><SPAN STYLE='font-size:12pt'><BR>
On 9/15/10 1:45 PM, "Hannah Schulz" <<a href="Hannah.schulz@UNI-KONSTANZ.DE">Hannah.schulz@UNI-KONSTANZ.DE</a>> wrote:<BR>
<BR>
<FONT COLOR="#0000FF">> Hello,<BR>
> <BR>
> I have a problem with a new fieldtrip version (7.9.2010). When I do  <BR>
> ft_resampledata after preprocessing and then do a reject visual with  <BR>
> cfg.method='summary' I get this warning :<BR>
> <BR>
> the input is raw data with 130 channels and 75 trials<BR>
> Warning: the trial definition in the<BR>
> configuration is inconsistent with the actual<BR>
> data<BR>
</FONT><FONT COLOR="#008000">>> In public/private/fixtrialdef at 66<BR>
</FONT><FONT COLOR="#0000FF">>    In checkdata at 559<BR>
>    In ft_rejectvisual at 159<BR>
> Warning: failed to create sampleinfo field<BR>
</FONT><FONT COLOR="#008000">>> In public/private/fixtrialdef at 73<BR>
</FONT><FONT COLOR="#0000FF">>    In checkdata at 559<BR>
>    In ft_rejectvisual at 159<BR>
> <BR>
> <BR>
> I also get an empty trl structure in the "artefact free" dataset .  <BR>
> Unfortunately I do need the proper trl structure for my further  <BR>
> analysis, could anybody help me how solve that problem? (With an older  <BR>
> fieldtrip version it workes fine)<BR>
> Thank you very much in advance,<BR>
> Hannah Schulz<BR>
> <BR>
> <BR>
> <BR>
> <BR>
> <BR>
> <BR>
> Dipl. Psych. Hannah Schulz<BR>
> <BR>
> OBOB-Lab<BR>
> University of Konstanz<BR>
> Department of Psychology<BR>
> P.O. Box D25<BR>
> 78457 Konstanz<BR>
> Germany<BR>
> <BR>
> Tel: ++49 - (0)7531 - 88 42 50<BR>
> Fax: ++49 - (0)7531 - 88 28 91<BR>
> Email: <a href="hannah.schulz@uni-konstanz.de">hannah.schulz@uni-konstanz.de</a><BR>
> Homepage: <a href="http://www.uni-konstanz.de/obob">http://www.uni-konstanz.de/obob</a><BR>
> <BR>
> ----------------------------------<BR>
> The aim of this list is to facilitate the discussion between users of the <BR>
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and <BR>
> EEG analysis. See also <a href="http://listserv.surfnet.nl/archives/fieldtrip.html">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <BR>
> <a href="http://www.ru.nl/neuroimaging/fieldtrip">http://www.ru.nl/neuroimaging/fieldtrip</a>.<BR>
</FONT></SPAN></FONT>
</BODY>
</HTML>

<p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>