Hello,<br><br>The function can be run when I put cfg.trialfun = 'trialfun_general';<br>But I don't get the result that I supposed<br><br>The file:<br><br>cfg = [];<br>cfg.dataset = 'buffer://localhost:1972';<br>
cfg.channel = {'A1'};<br>cfg.trialfun = 'trialfun_general';<br>cfg.trialdef.eventtype = 'stimulus';<br>cfg.trialdef.eventvalue = 1;<br>cfg.trialdef.prestim = 0;<br>cfg.trialdef.poststim = 1;<br><br>
%cfg = ft_definetrial(cfg);<br><br> ft_realtime_average(cfg)<br><br>Is there any wrong in my function?<br><br>Hamza<br><br><div class="gmail_quote">On Tue, May 15, 2012 at 11:29 AM, Hamza Fawzi Altakroury (Student) <span dir="ltr"><<a href="mailto:hamzaf@sabanciuniv.edu" target="_blank">hamzaf@sabanciuniv.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello again <br><br>Realtime functions should work if I define the function as:<br><br>cfg.trialfun = 'trialfun_general';<br>
<br>Right?<span class="HOEnZb"><font color="#888888"><br><br>Hamza</font></span><div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Sun, May 13, 2012 at 5:46 PM, Hamza Fawzi Altakroury (Student) <span dir="ltr"><<a href="mailto:hamzaf@sabanciuniv.edu" target="_blank">hamzaf@sabanciuniv.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank you for your help Stephen<span><font color="#888888"><br><br>Hamza</font></span><div>
<div><br><br><div class="gmail_quote">On Thu, May 10, 2012 at 4:07 PM, Stephen Whitmarsh <span dir="ltr"><<a href="mailto:stephen.whitmarsh@gmail.com" target="_blank">stephen.whitmarsh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Hamza,<br>
<br>
I just saw you've been posting on the FT list for quite a while and<br>
have been working on offline analysis already. To answer your question<br>
more specifically: The trialfunction could be very simple in the first<br>
instance, but is needed to know what samples to read when<br>
preprocessing the data. You can find some examples here that you can<br>
adapt to your own purpose here:<br>
<a href="http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition" target="_blank">http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition</a><br>
<br>
Cheers,<br>
Stephen<br>
<div><div><br>
On 10 May 2012 14:51, Stephen Whitmarsh <<a href="mailto:stephen.whitmarsh@gmail.com" target="_blank">stephen.whitmarsh@gmail.com</a>> wrote:<br>
> Dear Hamza,<br>
><br>
> The trialfunction is an integral part of processing data in FieldTrip.<br>
> It is how you define your timepoints of interest, i.e. trials based on<br>
> recorded markers in your data, or based on user-defined events (e.g.<br>
> sleep stages).<br>
><br>
> If you are not yet familiar with the basic FieldTrip operations the<br>
> documentation of the realtime analysis might indeed seem somewhat<br>
> inadequate as it assumes this familiarity. FieldTrip's online analysis<br>
> tools are using many of the same functions of the offline ones, and<br>
> has a similar overall philosophy and approach. This makes it<br>
> relatively easy to understand and to use online analysis approach once<br>
> one is familiar with the offline one. Alas this translation is<br>
> assymmetric and doesn't hold for the other way around.<br>
><br>
> The good news is, however, that everything is there to get you on your<br>
> way once your take a little detour. You could take a look at the<br>
> tutorial documentation (<a href="http://fieldtrip.fcdonders.nl/tutorial" target="_blank">http://fieldtrip.fcdonders.nl/tutorial</a>) and<br>
> get a bit of hands-on working through some steps with the supplied<br>
> tutorial-data.<br>
><br>
> Specifically for your question these pages would be relevant:<br>
> <a href="http://fieldtrip.fcdonders.nl/example/getting_started_with_reading_raw_eeg_or_meg_data" target="_blank">http://fieldtrip.fcdonders.nl/example/getting_started_with_reading_raw_eeg_or_meg_data</a><br>
> <a href="http://fieldtrip.fcdonders.nl/tutorial/preprocessing" target="_blank">http://fieldtrip.fcdonders.nl/tutorial/preprocessing</a><br>
> <a href="http://fieldtrip.fcdonders.nl/tutorial/continuous" target="_blank">http://fieldtrip.fcdonders.nl/tutorial/continuous</a><br>
><br>
> For more overview and general operations I would advice reading through:<br>
> <a href="http://fieldtrip.fcdonders.nl/walkthrough" target="_blank">http://fieldtrip.fcdonders.nl/walkthrough</a><br>
><br>
> Most of all it might not be a bad idea to start with a pre-recorded<br>
> dataset and work on it offline, using the more standard and more<br>
> extensively documented offline functions for e.g. trial based<br>
> averaging. Once that works out for you can adapt it to the realtime<br>
> situation.<br>
><br>
> Hope this helps,<br>
> Stephen<br>
><br>
> On 10 May 2012 13:55, Hamza Fawzi Altakroury (Student)<br>
> <<a href="mailto:hamzaf@sabanciuniv.edu" target="_blank">hamzaf@sabanciuniv.edu</a>> wrote:<br>
>> Hello,<br>
>><br>
>> I don't know why should I define a function inside the<br>
>> ft_realtime_selectiveaverage.<br>
>> I just want to make an average of some segments.<br>
>><br>
>> Could you provide me with an example of cfg.trialfun<br>
>><br>
>> Hamza<br>
>><br>
>><br>
>> On Wed, May 9, 2012 at 11:33 AM, Hamza Fawzi Altakroury (Student)<br>
>> <<a href="mailto:hamzaf@sabanciuniv.edu" target="_blank">hamzaf@sabanciuniv.edu</a>> wrote:<br>
>>><br>
>>> Hello,<br>
>>><br>
>>> I am doing realtime processing, and I wanted to check ft_realtime_average<br>
>>> function and ft_realtime_selectiveaverage functions.<br>
>>><br>
>>> I faced a problem in defining cfg.trialfun<br>
>>><br>
>>> Could you help me<br>
>>><br>
>>> Best<br>
>>><br>
>>> --<br>
>>> Hamza Fawzi Altakroury<br>
>>> Graduate student - MA<br>
>>> Faculty of Engineering and Natural Sciences<br>
>>> Sabancı University<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Hamza Fawzi Altakroury<br>
>> Graduate student - MA<br>
>> Faculty of Engineering and Natural Sciences<br>
>> Sabancı University<br>
>><br>
>> _______________________________________________<br>
>> fieldtrip mailing list<br>
>> <a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
>> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></div></blockquote></div><br><br clear="all"><br>-- <br>Hamza Fawzi Altakroury<br>
Graduate student - MA<br>Faculty of Engineering and Natural Sciences<br>Sabancı University<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Hamza Fawzi Altakroury<br>Graduate student - MA<br>Faculty of Engineering and Natural Sciences<br>Sabancı University<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Hamza Fawzi Altakroury<br>Graduate student - MA<br>Faculty of Engineering and Natural Sciences<br>Sabancı University<br>