pymovements.gaze.Screen.__init__#
- Screen.__init__(width_px: int, height_px: int, width_cm: float, height_cm: float, distance_cm: float | None = None, origin: str = 'lower left')[source]#
Initialize Screen.
- Parameters:
width_px (int) – Screen width in pixels
height_px (int) – Screen height in pixels
width_cm (float) – Screen width in centimeters
height_cm (float) – Screen height in centimeters
distance_cm (float | None) – Eye-to-screen distance in centimeters. If None, a distance_column must be provided in the DatasetDefinition or GazeDataFrame, which contains the eye-to-screen distance for each sample in millimeters.
origin (str) – Specifies the screen location of the origin of the pixel coordinate system.
Examples
>>> screen = Screen( ... width_px=1280, ... height_px=1024, ... width_cm=38.0, ... height_cm=30.0, ... distance_cm=68.0, ... origin='lower left', ... ) >>> print(screen) Screen(width_px=1280, height_px=1024, width_cm=38.00, height_cm=30.00, distance_cm=68.00, origin=lower left)
We can also access the screen boundaries in degrees of visual angle. This only works if the distance_cm attribute is specified.
>>> screen.x_min_dva -15.59... >>> screen.x_max_dva 15.59... >>> screen.y_min_dva -12.42... >>> screen.y_max_dva 12.42...