tobii2pix

tobii2pix(win, p)

Convert Tobii ADCS coordinates to PsychoPy pixel coordinates.

Low-level conversion function that transforms Tobii’s normalized ADCS coordinates to PsychoPy pixel coordinates. This is the inverse of pix2tobii() and is essential for displaying gaze data in PsychoPy windows.

Parameters

Name Type Description Default
win psychopy.visual.Window The PsychoPy window which provides screen dimensions for scaling. required
p tuple The Tobii ADCS coordinates to convert as (x, y) in range [0, 1]. Origin is top-left, x increases rightward, y increases downward. required

Returns

Name Type Description
tuple The converted PsychoPy pixel coordinates as (x, y) with origin at screen center. Values are rounded to nearest integer for pixel alignment.

Notes

The conversion involves: 1. Shifting origin from top-left to center (-0.5 offset) 2. Scaling by screen dimensions to get pixel values 3. Inverting the Y-axis to match PsychoPy’s bottom-up convention

Output coordinates follow PsychoPy’s pixel convention where (0, 0) is at screen center.

Back to top