brainstorm-tools / brainstorm3

Brainstorm software: MEG, EEG, fNIRS, ECoG, sEEG and electrophysiology
http://neuroimage.usc.edu/brainstorm
GNU General Public License v3.0
377 stars 162 forks source link

Import Tobii Data #620

Open rfclambert opened 1 year ago

rfclambert commented 1 year ago

Hello, I am Raphaël Lambert, and I am currently working with a Tobii Glasses eye tracker and EEG for an experiment, and we had the project, with @ftadel to integrate some parts of EYE-EEG from Olaf Dimigen into Brainstorm and use the data collected as a good way to debug the process. After a first start last year with the inclusion of the possibility to open eye tracking data as events in brainstorm, and then much delay from my part, I can finally progress here. I was recommended to discuss things publicly here, for future reference on the choices made during development. If this should be in another place (like the forum?), don't hesitate to tell me.

For now, Brainstorm is able to import tobii tsv data as events in EEG. But, after closer inspection, it appears that Tobii Pro Lab (the software that extracts tobii data from their eye trackers) can extract tsv in a lot of different ways. In Eye EEG, they have a guide to guide you on what columns you have to extract for it to work: https://www.eyetracking-eeg.org/tobii.html . Should we follow the same kind of guidelines? And import data from a tsv file only when these precise columns are present?

Then, there is the question of the synchronisation. For now, the synch is assumed to have been done before importing. The synch process is also part of EYE-EEG, so maybe we should follow their example (see step 3 of https://www.eyetracking-eeg.org/tutorial.html )

Thank you for reading!

rcassani commented 1 year ago

Hi @rfclambert,

Thanks for opening the issue! This is the correct place to discuss on the potential new feature.

For now, Brainstorm is able to import tobii tsv data as events in EEG.

Indeed this is possible, but it is likely that the eye-tracker clock is not in synch with the EEG recording. Thus, importing tobii tsv as events in EEG data will not be enough for the sync.

In Eye EEG, they have a guide to guide you on what columns you have to extract for it to work: https://www.eyetracking-eeg.org/tobii.html . Should we follow the same kind of guidelines? And import data from a tsv file only when these precise columns are present?

It does make sense to follow their approach at require the fields: Eyetracker timestamp, Recording timestamp and Event value. With these fields the eye-tracking data can be imported not as events but as recordings with events. In that case the recordings would be either with real traces (gaze, gaze point, gaze direction, etc) if available, or as a dummy recording. One the eye-tracking data is imported as raw data, synch it with EEG can be done as in this Brainstorm tutorial: https://neuroimage.usc.edu/brainstorm/Tutorials/EyetrackSynchro

The steps described in the above tutorial are similar to the ones described in (see step 3 of https://www.eyetracking-eeg.org/tutorial.html ), where a common event is used for sync, and the other events are added (or subtracted) an offset to sych eye-tracking and EEG data.

A first step towards that integration would be to have samples of the Tobii Pro Lab tsv files to add the code to import them as signals in Brainstorm.