<html><head><base href="x-msg://41/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Emilio<div><br></div><div>EDF is a fileformat that is widely supported, but that does not have a standard way of storing events in the file. Hence FieldTrip cannot find them. The later EDF+ extension to the fileformat describes how to store annotations (like events) in the file, but this "annotation channel" is not used by many software packages as it is rather clumsy for storing trigger information. Consequently, most software packages have their own ways of storing events. Usually it is dealt with in a very similar manner by adding a binary channel with the same sampling rate and with 0 if there is no, and another value if there is a trigger.</div><div><br></div><div>The EDF format is written in (short) segments, those are the trials you see in the event structure.</div><div><br></div><div>If there is a trigger, status, or event channel, you'll have to detect that yourself (e.f. using ft_databrowser). Subsequently you can make a custom "trial function", i.e. a function that reads that channel and defines the data segments to your requirements. Have a look at</div><div><a href="http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition">http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition</a></div><div>and</div><div><a href="http://fieldtrip.fcdonders.nl/tag/trialfun?do=showtag&tag=trialfun">http://fieldtrip.fcdonders.nl/tag/trialfun?do=showtag&tag=trialfun</a></div><div><br></div><div>best regards,</div><div>Robert</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><div>On 6 Feb 2013, at 23:38, Emilio Valadez wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Dear FieldTrip users,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I am trying to define trials from a continuous EEG data set that was exported from BESA to .edf format, but I’m having trouble reading the events with FieldTrip. The events are located in a separate channel that was appended to the EEG data.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">After running ft_definetrial with cfg.trialdef.eventtype set to ‘?’ (in order to see the event types and event values in the data), I received the following output:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">the following events were found in the datafile<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">event type: 'trial' with event values:<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">no trials have been defined yet, see FT_DEFINETRIAL for further help<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">found 720 events<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">created 0 trials<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; ">the call to "ft_definetrial" took 1 seconds<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">It seems that ft_definetrial is not reading any events except for trials, which should not be present in the data. As a comparison, I opened the data set with eeglab, which did read the events properly, leading me to believe that the event information is in fact part of the file. How can I get ft_definetrial to correctly read the events?<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks in advance for your help.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Emilio<span style="font-size: 10pt; "><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" style="color: blue; text-decoration: underline; ">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: blue; text-decoration: underline; ">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></blockquote></div><br></div></body></html>