Jump to content

Contributions:EyetrackerLoggerSimulator

From BCI2000 Wiki

Synopsis

An extension that records data from a simulated eye tracker into event states.

Location

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

Versioning

Authors

Jürgen Mellinger (mellinger@neurotechcenter.org)

Version History

  • 2021-12-02: initial version

Source Code Revisions

  • Initial development: 6455
  • Tested under: 6455
  • Known to compile under: 7762
  • Broken since: --

Functional Description

Uses user-defined expressions to compute gaze and eye position, updated in regular intervals. Simulated data are recorded into event states.

Integration into BCI2000

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

Coordinate System

A simulated eye position and gaze is be expressed by 5 coordinate values,

  • GazeX: X coordinate of gaze position,
  • GazeY: Y coordinate of gaze position,
  • EyePosX: X coordinate of eye,
  • EyePosY: Y coordinate of eye,
  • EyeDist: Z coordinate of eye.

To preserve physical resolution and stay within the range of nonnegative integers, X, Y, and Z coordinates are multiplied by a resolution factor, and added to an offset.

Parameters

User configurable Parameters

The eye tracker is configured in the Source tab within the EyetrackerLoggerSimulator section.

LogEyetrackerSimulator

Set to 0 to disable the simulated eye tracker logger.

EyetrackerUpdateRate

The update rate for simulated eyetracker data, with physical unit, e.g. 1Hz.

EyetrackerInitialization

An expression that is evaluated at initialization time. This may be used to define initial values of variables, or constants. Note that the variable t is always defined, and contains the amount of time elapsed since the beginning of the current run, in seconds.

EyetrackerExpressions

A matrix with rows Left and Right, and columns for coordinates applying to each eye. Each matrix element holds an expression (possibly empty) that may refer to variables defined in the EyetrackerInitialization expression. In addition, the variable t holds the time elapsed since the beginning of the current run, in terms of the number of steps (see the EyetrackerFrequency parameter for how to modify update speed).

To match the range of an actual eyetracker, expressions in EyetrackerExpressions should evaluate to a range of [0, <screen width in mm>] x [0, <screen height in mm>].

State Variables

EyetrackerTime

Time stamp of eye data compatible with the SourceTime data time stamp.

EyetrackerLeftEyeGazeX, EyetrackerLeftEyeGazeY, EyetrackerRightEyeGazeX, EyetrackerRightEyeGazeY

Screen position where the simulated subject is looking at. Point (0,0) corresponds to the top left of the screen. Multiply each value by the unit given in the GazeResolution parameter in order to obtain the physical location relative to the screen's top left.

EyetrackerLeftEyePosX, EyetrackerLeftEyePosY, EyetrackerLeftEyeDist, EyetrackerRightEyePosX, EyetrackerRightEyePosY, EyetrackerRightEyeDist

Simulated eye position.


See also

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