[FieldTrip] [fieldtrip] Re: Still Reading a Trigger Channel
r.oostenveld at donders.ru.nl
Wed Mar 16 17:05:27 CET 2011
EDF and triggers indeed don't go together that well. The formal "EDF+
standard" specifies how annotations can be added to a pseudo-channel,
but it is very awkward and does not wotk thaht well for triggers.
The problem you descibe below suggests an incompatibility of your edf
file with fieldtrip. Either the file is corrupt, or there is a problem
with some fieldtrip code. Could you post the problem below with the
edf file (which hopefully is not too large) to http://bugzilla.fcdonders.nl?
See http://fieldtrip.fcdonders.nl/bugzilla for more details
On 16 Mar 2011, at 12:55, Ivano Triggiani wrote:
> Hi Dear,
> Jan had a good idea... it seems that .edf files are not good to be
> read automatically for a trigger channel... but writing a simple
> function on my own I found some error (of course...):
> evaluating trialfunction 'fun2'
> error opening file: pippo.edf
> ??? One or more output arguments not assigned during call to
> Error in ==> read_edf>readLowLevel at 374
> buf = read_16bit(filename, offset, numwords);
> Error in ==> read_edf at 334
> buf = readLowLevel(filename, offset, epochlength); % see below
> in subfunction
> Error in ==> ft_read_data at 562
> dat = read_edf(filename, hdr, begsample, endsample, chanindx);
> Error in ==> fun2 at 13
> trg = ft_read_data(cfg.datafile, 'header', hdr, ...
> Error in ==> ft_definetrial at 123
> trl = feval(cfg.trialfun, cfg);
> Error in ==> program1 at 11
> cfg = ft_definetrial(cfg);
> have anyone some ideas about it ?
> Dear Ivano,
> I would first check what 'triggers' fieldtrip automatically detects
> from your data. As far as I am aware, there is no default reading of a
> 'trigger' channel for .edf data, but I am not sure.
> You can get an idea bout the event-info, by specifying
> cfg = ;
> cfg.dataset = ...
> cfg.trialdef.eventtyp = '?';
> This outputs some info to your screen, about which events are in the
> data. Each event is of a certain type 'type' , and may have a value
> 'value', e.g. when the acquisition system has an explicit trigger
> channel to which your stimulus presentation program, or response
> device sends discrete trigger pulses of varying height.
> In your case, I suspect that something else needs to be done (in case
> definetrial does not show triggers related to your trigger channel),
> i.e. you need to write your own 'trialfun'. Rather than using
> cfg.trialdef.eventtype/eventvalue, you need to specify cfg.trialfun =
> 'ivanoscooltrialfun', and you need to write your own file:
> trialfun_ivanoscooltrialfun which defines your segments of interest
> based on some feature in your trigger channel. Here's an example which
> uses an EMG-channel as epoch-defining signal. Of course your trigger
> channel needs to be processed in a different way but at least it gives
> you an impression.
> Good luck
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
More information about the fieldtrip