MCPcopy Index your code
hub / github.com/mne-tools/mne-python / get_screen_visual_angle

Function get_screen_visual_angle

mne/preprocessing/eyetracking/utils.py:28–45  ·  view source on GitHub ↗

Calculate the radians of visual angle that the participant screen subtends. Parameters ---------- calibration : Calibration An instance of Calibration. Must have valid values for ``"screen_size"`` and ``"screen_distance"`` keys. Returns ------- visual angle

(calibration)

Source from the content-addressed store, hash-verified

26
27
28def get_screen_visual_angle(calibration):
29 """Calculate the radians of visual angle that the participant screen subtends.
30
31 Parameters
32 ----------
33 calibration : Calibration
34 An instance of Calibration. Must have valid values for ``"screen_size"`` and
35 ``"screen_distance"`` keys.
36
37 Returns
38 -------
39 visual angle in radians : ndarray, shape (2,)
40 The visual angle of the monitor width and height, respectively.
41 """
42 _validate_type(calibration, Calibration, "calibration")
43 _check_calibration(calibration, want_keys=("screen_size", "screen_distance"))
44 size = np.array(calibration["screen_size"])
45 return 2 * np.arctan(size / (2 * calibration["screen_distance"]))

Callers 1

plot_gazeFunction · 0.85

Calls 2

_validate_typeFunction · 0.85
_check_calibrationFunction · 0.85

Tested by

no test coverage detected