Reference

Main Eye-tracker Class

The central class of the DeToX package, responsible for connecting to and managing the Tobii eye tracker. This class must be instantiated before any other functionality can be used. It provides access to calibration, recording control, and gaze-contingent presentation methods. Below are the main methods and properties of this class:

ETracker A high-level controller for running eye-tracking experiments with Tobii Pro and PsychoPy.

Control the Recording

Functions for starting, stopping, and managing the capture of eye-tracking data. These methods allow you to initiate and terminate recordings, mark events of interest, and save collected data to disk.

ETracker.start_recording Begin gaze data recording session.
ETracker.stop_recording Stop gaze data recording and finalize session.
ETracker.record_event Record timestamped experimental event during data collection.
ETracker.save_data Save buffered gaze and event data to file with optimized processing.

Calibration

Methods for running and managing eye tracker calibration. These include displaying calibration status, initiating calibration routines, and saving or loading calibration settings to ensure accurate gaze data.

ETracker.show_status Real-time visualization of participant’s eye position in track box.
ETracker.calibrate Run infant-friendly calibration procedure.
ETracker.save_calibration Save the current calibration data to a file.
ETracker.load_calibration Loads calibration data from a file and applies it to the eye tracker.

Gaze Contingent

Tools for running gaze-contingent experiments, where visual presentation adapts dynamically to a participants gaze position. Includes functionality for live gaze-contingent control and methods to compute average gaze positions for experimental logic.

ETracker.gaze_contingent Initialize real-time gaze buffer for contingent applications.
ETracker.get_gaze_position Get current gaze position from rolling buffer.

Internal Calibration

Classes for running eye-tracker calibration. These get called internally by the ETracker class, and are reported here only for completeness. They are comprise of a base calibration class that set the common interface, and the specific implementations for Tobii and Mouse calibration.

BaseCalibrationSession Base class with common functionality for both calibration types.
TobiiCalibrationSession Tobii-based calibration session for real eye tracking.
MouseCalibrationSession Mouse-based calibration session for simulation mode.

Coordinate Conversion

A collection of utility functions designed to help the conversion of the data from different formats. These are called internally by the ETracker class, but can be used independently if needed.

convert_height_to_units Convert a size from height units to the current window units.
get_psychopy_pos Convert Tobii ADCS coordinates to PsychoPy coordinates.
psychopy_to_pixels Convert PsychoPy coordinates to pixel coordinates.
get_tobii_pos Convert PsychoPy coordinates to Tobii ADCS coordinates.
pix2tobii Convert PsychoPy pixel coordinates to Tobii ADCS coordinates.
tobii2pix Convert Tobii ADCS coordinates to PsychoPy pixel coordinates.
get_psychopy_pos_from_trackbox Convert Tobii TBCS coordinates to PsychoPy coordinates.

Utilities

A set of utility classes and functions for presenting stimuli and formatted text. These are called internally by the ETracker class.

NicePrint Print a message in a box with an optional title AND return the formatted text.
InfantStimuli Stimuli manager for infant-friendly calibration procedures.

Configuration Settings

Configuration classes and module-level instances for customizing the behavior and appearance of the DeToX eye-tracking system. These settings control animation parameters, colors, UI element sizes, and data formats. Note: These settings should generally not be changed unless you have specific requirements. However, they can be modified through the module-level instances (e.g., ETSettings.animation) for easy configuration of your experiments.

ETSettings.AnimationSettings Animation parameters for calibration stimuli.
ETSettings.CalibrationPatterns Standard calibration point patterns in normalized coordinates.
ETSettings.CalibrationColors Color settings for calibration visual elements.
ETSettings.UIElementSizes Size settings for user interface elements.
Back to top