Reading data with trialfun_general

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Tue Dec 5 21:23:29 CET 2006


Hi Michael

On 5 Dec 2006, at 11:09, Michael Wibral wrote:
> I used the following lines in my code
> %
> cfg.trialdef.eventype = 'UPT001';
> cfg.trialdef.eventvalue = 3 ; % or 5, or 7
> cfg.trialdef.trigger = 3 ; % or 5, or 7
> %
> should the channel that carries the events really go into
> cfg.trialdef.eventvalue ? Then I might indeed be misunderstanding
> something.

Since the new CTF system can have triggers in multiple channels, it
is indeed neccessary to distinguish the different channels by their
name. So 'trigger' is not enough, but you need eventtype 'UPT001'. In
your code sample the element cfg.trialdef.trigger is not used by
trialfun_general. What is missing is the time before and after the
trigger.

See below for some sample code on a comparable dataset (275 channel
system, Munster). In this dataset there are events in the 'UPPT001'
trigger channel.

 >> cfg = [];
 >> cfg.dataset = 'A0132_Aud-Obj-Recognition_20051115_02.ds'
 >> cfg.trialdef.eventtype = 'UPPT001'
 >> cfg.trialdef.eventvalue = 4;
 >> cfg.trialdef.prestim = 0.2
 >> cfg.trialdef.poststim = 0.8

 >> cfg = definetrial(cfg)
evaluating trialfunction 'trialfun_general'
found 2389 events
created 148 trials

cfg =
        dataset: 'A0132_Aud-Obj-Recognition_20051115_02.ds'
       trialdef: [1x1 struct]
       datafile: 'A0132_Aud-Obj-Recognition_20051115_02.ds/A0132_Aud-
Obj-Recognition_20051115_02.meg4'
     headerfile: 'A0132_Aud-Obj-Recognition_20051115_02.ds/A0132_Aud-
Obj-Recognition_20051115_02.res4'
       trialfun: 'trialfun_general'
          event: [1x2389 struct]
            trl: [148x3 double]
        version: [1x1 struct]


%%%%%%%% also usefull is the following

cfg = []
cfg.dataset = 'A0132_Aud-Obj-Recognition_20051115_02.ds'
cfg.trialdef.eventtype = '?'
definetrial(cfg);
the following events were found in the datafile
event type: 'UPPT001' with event values: 2  3  4
event type: 'acousticTrg' with event values:
event type: 'do' with event values:
event type: 'doe' with event values:
event type: 'frontpanel trigger' with event values: 1  2  3  4
event type: 'go' with event values:
event type: 'goe' with event values:
event type: 'trial' with event values:
no trials have been defined yet, see DEFINETRIAL for further help
found 2389 events
created 0 trials

You can also read the help of read_fcdc_event and do
   event = read_fcdc_event(cfg.dataset)
and look into detail in the events.

best regards
Robert



More information about the fieldtrip mailing list