get_psychopy_pos_from_trackbox
get_psychopy_pos_from_trackbox(win, p, units=None)Convert Tobii TBCS coordinates to PsychoPy coordinates.
Transforms coordinates from Tobii’s Track Box Coordinate System (TBCS) to PsychoPy’s coordinate system. TBCS is used for the user position guide, showing where the participant’s eyes are located within the eye tracker’s track box (the 3D volume where eyes can be tracked).
In TBCS, coordinates represent position within the track box where (0,0) indicates the participant is positioned at the right edge from the tracker’s perspective, and (1,1) indicates the left edge. This apparent reversal is because TBCS uses the tracker’s perspective, not the user’s.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| win | psychopy.visual.Window | The PsychoPy window which provides information about units and size. Window properties determine the target coordinate system. | required |
| p | tuple | The Tobii TBCS coordinates to convert as (x, y). Values are in range [0, 1] representing position within the track box from the tracker’s perspective. | required |
| units | str | The target units for the PsychoPy coordinates. If None, uses the window’s default units. Supported: ‘norm’, ‘height’, ‘pix’, ‘cm’, ‘deg’, ‘degFlat’, ‘degFlatPos’. | None |
Returns
| Name | Type | Description |
|---|---|---|
| tuple | The converted PsychoPy coordinates in the specified unit system. Suitable for positioning visual feedback about user position. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If the provided units are not supported. |
Notes
TBCS coordinates are primarily used in the show_status() method to provide visual feedback about participant positioning. The X-axis is reversed compared to ADCS because TBCS uses the tracker’s perspective.
This function handles the perspective reversal and transforms to PsychoPy’s coordinate conventions for proper visualization.