Jump to content

Contributions:EyetrackerLoggerTobii3: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
No edit summary
Mellinger (talk | contribs)
No edit summary
Line 55: Line 55:
Unless otherwise specified, all states are prefixed with <code>Eyetracker<Left/Right>Eye</code> which corresponds with each individual eye.  The EyetrackerLogger extension does not support eye tracking with multiple subjects.
Unless otherwise specified, all states are prefixed with <code>Eyetracker<Left/Right>Eye</code> which corresponds with each individual eye.  The EyetrackerLogger extension does not support eye tracking with multiple subjects.


===GazeX, GazeY===
===EyetrackerTime===
Time stamp of eye data as reported by the eye tracker, and converted into time units compatible
with the [SourceTime] data time stamp.
Eye tracker data will be sample-aligned using this time stamp if possible, but may appear delayed
in a data file if transmission from the eye tracker is late.
In this case, the value of <tt>EyetrackerTimeStamp</tt> will differ from the value of [SourceTime] by more than a sample block duration in milliseconds.
 
===EyetrackerLeftEyeGazeX, EyetrackerLeftEyeGazeY, EyetrackerRightEyeGazeX, EyetrackerRightEyeGazeY===
Screen position where the subject is looking at, rescaled such that, in raw state values, point (0,0) corresponds to the top left of the screen, and (65535, 65535) corresponds to the bottom right of the screen.
Screen position where the subject is looking at, rescaled such that, in raw state values, point (0,0) corresponds to the top left of the screen, and (65535, 65535) corresponds to the bottom right of the screen.


===PosX, PosY, Dist===
===EyetrackerLeftEyePosX, EyetrackerLeftEyePosY, EyetrackerLeftEyeDist, EyetrackerRightEyePosX, EyetrackerRightEyePosY, EyetrackerRightEyeDist===
Eye position in the same screen-relative coordinate system used for GazeX and GazeY, extended by a Z axis normal to the screen plane, pointing towards the subject. Unlike X and Y coordinates, the Z coordinate's raw state value is not normalized but represents screen distance in millimeters. This measurement is an approximation.  The actual measurement may depend on whether or not the test subject is wearing glasses or not.
Eye position in the same screen-relative coordinate system used for gaze data, extended by a Z axis normal to the screen plane, pointing towards the subject. Unlike X and Y coordinates, the Z coordinate's raw state value is not normalized but represents screen distance in millimeters. This measurement is an approximation.  The actual measurement may depend on whether or not the test subject is wearing glasses or not.


===PupilSize===
===EyetrackerLeftPupilSize, EyetrackerRightPupilSize===
Pupil diameter as estimated by the eye tracker, scaled such that the raw state value represents the pupil diameter in tenths of millimeters (0.1mm).
Pupil diameter as estimated by the eye tracker, scaled such that the raw state value represents the pupil diameter in tenths of millimeters (0.1mm).


===EyeValidity===
===EyetrackerLeftEyeValidity, EyetrackerRightEyeValidity===
This state is a number from 0 to 4 and is documented in the Tobii SDK manual.  It is repeated here for convenience.
A number ranging between 0 and 4, representing the eyetracker's confidence to have identified
* 0 - The eye tracker is certain that the data for this eye is right.  There is no risk of confusing data from the other eye.
the eye in question. As suggested in the Tobii3 SDK's manual, EyetrackerLoggerTobii3 will ignore
* 1 - The eye tracker has only recorded one eye and made some assumptions and estimations regarding which is the left and which is the right eye.  However, it is still very likely that the assumption made is correct.  The validity code for the other eye is in this case always set to 3.
any _eye_data_ with an associated validity value greater or equal to 2, but will report
* 2 - The eye tracker has only recorded one eye, and has no way of determining which one is the left eye and which one is the right eye. The validity code for both eyes is set to 2.
time stamp and validity value for that data point nevertheless.
* 3 - The eye tracker is fairly confident that the actual gaze data belongs to the other eye.  The other eye will always have validity code 1.
When eye data are being ignored, all respective state variables will keep their previous values.
* 4 - The actual gaze data is missing or definitely belonging to the other eye.
 
{| class="wikitable"
|-
! Code (Right - Left)
! Description
|-
| 0 - 0
| Both eyes found.  Data is valid for both eyes.
|-
| 0 - 4 or 4 - 0
| One eye found.  Gaze data is the same for both eyes.
|-
| 1 - 3 or 3 - 1
| One eye found.  Gaze data is the same for both eyes.
|-
| 2 - 2
| One eye found.  Gaze data is the same for both eyes.
|-
| 4 - 4
| No eye found.  Gaze data for both eyes are invalid.
|}
 
EyetrackerLoggerTobii3 will record <tt>EyeValidity</tt> for all data received from the eye tracker but will ignore any gaze and position data for <tt>EyeValidity >= 2</tt>.
 
===EyetrackerTimeStamp===
Time stamp of eye data as reported by the eye tracker, and converted into the time units used to
represent the [SourceTime] data time stamp.
Eye tracker data will be sample-aligned using this time stamp if possible, but may appear delayed
in a data file if transmission from the eye tracker is late.
In this case, the value of <tt>EyetrackerTimeStamp</tt> will differ from the value of [SourceTime] by more than a sample block duration.  


==See also==
==See also==

Revision as of 15:28, 22 August 2017

Synopsis

A filter that records state information from Tobii Eyetrackers using the Tobii SDK 3.0 into state variables.

Location

http://www.bci2000.org/svn/trunk/src/contrib/Extensions/EyetrackerLoggerTobii3

Versioning

Authors

Kristopher Kaleb Goering (kaleb.goering@gmail.com)

Jürgen Mellinger (mellinger@neurotechcenter.org)

Version History

  • 2015-06-23: Initial public release
  • 2017-08-21:
    • adapted code to current version of BCI2000 framework
    • rewrote large parts for clarity
    • unified coordinate system for eye position, and gaze data

Source Code Revisions

  • Initial development: 4879
  • Tested under: 5696
  • Known to compile under: 5696
  • Broken since: --

Functional Description

In many cases, an experiment may require data about where the participant is looking. In these experiments, an eyetracker is the only way to gather data relating to gaze position and eye location. There are many eyetracking methods currently on the market, but many of these require the subject to hold their head steady -- often while strapped to a structure of some sort. The Tobii eyetrackers require no such restriction so they were a natural choice when it came to interfacing with BCI2000.

Integration into BCI2000

Compile the extension into your source module by enabling contributed extensions in your CMake configuration, and setting EXTENSIONS_EYETRACKERLOGGERTOBII3=On. Once the extension is built into the source module, enable it by starting the source module with the --LogEyetrackerTobii3=1 command line argument.

Usage and Calibration

Set up the eyetracker as detailed in the documentation that came with your device. The device will connect to your machine and communicate through the ethernet port. As such, it'd be wise to disconnect and turn off any other networking devices while using the eyetracker. It is possible that your network request could go out over a different network interface if you're not careful which makes for a troubleshooting nightmare. When you start the source module, ensure that the --LogEyetrackerTobii3=1 command line parameter is set. Run the Eyetracker Browser utility which came with your eyetracker drivers and use it to locate the device on your local network.

Calibration can now occur. Calibration should be done per subject per sitting. Re-calibration is not necessary between runs, but any time that the subject changes eyewear, makeup, or position, or if the lighting conditions change it should be re-calibrated. A good rule of thumb would be to recalibrate at the start of every session. Once a calibration is performed, it is saved in the Tobii device until the next calibration (even if there's a power loss).

BCI2000 does not provide any way to calibrate the eyetracker. This should be done using the Tobii.Calibration.exe program which came on the thumb drive with the eyetracker. It can be found in Setup/InstallationGuide. Run the executable and follow the onscreen instructions to calibrate.

Once the device is calibrated, it can be used reliably in BCI2000. The logger will report information about eye validity in a text visualization window and feed states into the system.

Parameters

The eyetracker is configured in the Source tab within the EyetrackerLogger section. The configurable parameters are:

  • LogEyetrackerTobii3 - Enables/Disables logging of Eyetracker states
  • LogGazeData - Enables/Disables logging of gaze data
  • LogEyePos - Enables/Disables logging of eye position (as seen from the camera)
  • LogPupilSize - Enables/Disables logging of pupil size (very rough)
  • LogEyeDist - Enables/Disables logging of the distance from the screen to the eyes (again, rough)
  • GazeScale - Scales the incoming gaze data first (deprecated)
  • GazeOffset - Offsets the incoming gaze data after scaling (deprecated)

Note: GazeScale and GazeOffset were quick hacks introduced in the original [EyetrackerLogger] to address an issue with gaze data being clamped around the edges of the screen. EyetrackerLoggerTobii3 uses additional bits to avoid issues with values being out of range, so these parameters serve no useful purpose any more, but are being kept for backward compatibility.

State Variables

Unless otherwise specified, all states are prefixed with Eyetracker<Left/Right>Eye which corresponds with each individual eye. The EyetrackerLogger extension does not support eye tracking with multiple subjects.

EyetrackerTime

Time stamp of eye data as reported by the eye tracker, and converted into time units compatible with the [SourceTime] data time stamp. Eye tracker data will be sample-aligned using this time stamp if possible, but may appear delayed in a data file if transmission from the eye tracker is late. In this case, the value of EyetrackerTimeStamp will differ from the value of [SourceTime] by more than a sample block duration in milliseconds.

EyetrackerLeftEyeGazeX, EyetrackerLeftEyeGazeY, EyetrackerRightEyeGazeX, EyetrackerRightEyeGazeY

Screen position where the subject is looking at, rescaled such that, in raw state values, point (0,0) corresponds to the top left of the screen, and (65535, 65535) corresponds to the bottom right of the screen.

EyetrackerLeftEyePosX, EyetrackerLeftEyePosY, EyetrackerLeftEyeDist, EyetrackerRightEyePosX, EyetrackerRightEyePosY, EyetrackerRightEyeDist

Eye position in the same screen-relative coordinate system used for gaze data, extended by a Z axis normal to the screen plane, pointing towards the subject. Unlike X and Y coordinates, the Z coordinate's raw state value is not normalized but represents screen distance in millimeters. This measurement is an approximation. The actual measurement may depend on whether or not the test subject is wearing glasses or not.

EyetrackerLeftPupilSize, EyetrackerRightPupilSize

Pupil diameter as estimated by the eye tracker, scaled such that the raw state value represents the pupil diameter in tenths of millimeters (0.1mm).

EyetrackerLeftEyeValidity, EyetrackerRightEyeValidity

A number ranging between 0 and 4, representing the eyetracker's confidence to have identified the eye in question. As suggested in the Tobii3 SDK's manual, EyetrackerLoggerTobii3 will ignore any _eye_data_ with an associated validity value greater or equal to 2, but will report time stamp and validity value for that data point nevertheless. When eye data are being ignored, all respective state variables will keep their previous values.

See also

User Reference:Logging Input, Contributions:Extensions, Contributions:EyetrackerLogger