Sometimes it may be useful to keep trial-specific information tightly linked to your data structure. This trial-specific information for example can relate to the experimental condition, or to behavioural parameters. Before July 2010 this was implemented in a rather obscure and undocumented way. It was possible to encode trial-specific information in additional columns to the trl-matrix, generated by a custom-written trialfun. The trl-matrix was passed on from one analysis step to another in the cfg structure, which in its turn was appended to the output data-structure. Subsequently, the trl-matrix was accessible by using the following command:
trl = findcfg(data.cfg, 'trl');
This procedure was not only obscure, as mentioned, but also not consistent with the notion that a FieldTrip data structure should be self contained, and with the notion that the cfg-field in a FieldTrip data structure just serves the purpose to keep track of previous analysis steps. Therefore we extended the FieldTrip data structures with two fields:
Note that the 3rd column of the original trl-matrix is not represented in a separate field. In raw data (data structure containing trials) the offset is represented in each trial's time axis. A few things can be mentioned about the sampleinfo/trialinfo fields:
data = checkdata(data, 'hastrialdef', 'yes');
Obviously, only a sampleinfo field will be appended if the data is a raw datatype and a trialinfo will only be appended if the original trl matrix contains more than 3 columns.
Share this page: