Back to the main page.

Bug 653 - trialfun_trial should be enhanced to also return the trigger code (if possible)

Status CLOSED FIXED
Reported 2011-05-10 23:29:00 +0200
Modified 2011-06-22 14:18:56 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2011-05-10 23:29:26 +0200

in case the event structure contains a trigger event at the sample corresponding to t=0 for each trial, then the trigger value should be returned in the 4th column of trl. Look at event(i).sample - event(i).offset in each trial-event for the sample at which the t=0 is defined Example use cfg = dataset: 'Subject01.ds' trialfun: 'trial' >> cfg = ft_definetrial(cfg) evaluating trialfunction 'trialfun_trial' found 1343 events created 266 trials cfg = dataset: 'Subject01.ds' trialfun: 'trialfun_trial' trackconfig: 'cleanup' checkconfig: 'silent' checksize: 100000 datafile: 'Subject01.ds/Subject01.meg4' headerfile: 'Subject01.ds/Subject01.res4' event: [1343x1 struct] trl: [266x3 double] version: [1x1 struct] In this case it would be nice if cfg.trl would contain the 'backpanel trigger' and the 'STIM' values in the 4th and 5th column. Note that the 'Trial' events which are also present ([perhaps from the marker file) don't have a value.