pymovements.base.Screen#
- class pymovements.base.Screen(width_px: int, height_px: int, width_cm: float, height_cm: float, distance_cm: float, origin: str)[source]#
Screen class for holding screen properties and transforming pixel coordinates to degrees of visual angle.
- width_px#
Screen width in pixels
- Type:
int
- height_px#
Screen height in pixels
- Type:
int
- width_cm#
Screen width in centimeters
- Type:
float
- height_cm#
Screen height in centimeters
- Type:
float
- distance_cm#
Eye-to-screen distance in centimeters
- Type:
float
- origin#
Specifies the screen location of the origin of the pixel coordinate system.
- Type:
str
- x_max_dva#
Maximum screen x-coordinate in degrees of visual angle
- Type:
float
- y_max_dva#
Minimum screen y-coordinate in degrees of visual angle
- Type:
float
- x_min_dva#
Maximum screen x-coordinate in degrees of visual angle
- Type:
float
- y_min_dva#
Minimum screen y-coordinate in degrees of visual angle
- Type:
float
- __init__(width_px: int, height_px: int, width_cm: float, height_cm: float, distance_cm: float, origin: str)[source]
Initializes 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) – Eye-to-screen distance in centimeters
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, x_max_dva=15.60, y_max_dva=12.43, x_min_dva=-15.60, y_min_dva=-12.43)
Methods
__init__(width_px, height_px, width_cm, ...)Initializes Screen.
pix2deg(arr)Converts pixel screen coordinates to degrees of visual angle.