[FieldTrip] Reading events from an EDF file

Robert Oostenveld r.oostenveld at donders.ru.nl
Fri Feb 8 13:51:31 CET 2013


Dear Emilio

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.

The EDF format is written in (short) segments, those are the trials you see in the event structure.

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
http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition
and
http://fieldtrip.fcdonders.nl/tag/trialfun?do=showtag&tag=trialfun

best regards,
Robert






On 6 Feb 2013, at 23:38, Emilio Valadez wrote:

> Dear FieldTrip users,
>  
> 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.
>  
> 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:
>  
> the following events were found in the datafile
> event type: 'trial' with event values:
> no trials have been defined yet, see FT_DEFINETRIAL for further help
> found 720 events
> created 0 trials
> the call to "ft_definetrial" took 1 seconds
>  
> 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?
>  
> Thanks in advance for your help.
>  
> Emilio
>  
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130208/d71ce72b/attachment.html>


More information about the fieldtrip mailing list