Iohub + eye tracker trials identification in iohub data tables

You need to connect your ioHubConnection (let’s call it io below) to the TrialHandler for the relevant loop (let’s call it trials below:

# only do this once:
if trials.thisN == 0: # on the first trial,
    # connect the ioHub data store to our TrialHandler 
    # (i.e. to the loop called 'trials'): 
    io.createTrialHandlerRecordTable(trials)

At this point, the conditions table in the HDF file only contains the names of the variables. At the end of each trial, you should call this function actually fill in the row of values for each variable on this particular trial:

io.addTrialHandlerRecord(thisTrial.values)

If you want to save data that wasn’t in the original conditions file, that file needs to contain a column with the relevant header name, even though there is no data in its cells. Problem with IoHub datastore while using ioHubExperimentRuntime class

Do test this stuff out very carefully:

  • I’m not sure how ioHub figures out the correspondence between the values and their respective columns in the data table.
  • I think there might currently be an issue where a new session’s TrialHandlerRecordTable overwrites the previous one, rather than being added again and tagged to a new data set. If so, you might need to create a separate HDF file for each session (which negates some of the advantage of having a hierarchical file store.

If you want custom time-stamped information to be stored, this can be done simply like this:

io.sendMessageEvent('some_event_message')

Which ensures that the message will be stored in a table with a time stamp that matches your gaze data.