|
74 | 74 | # will return a list of :class:`~mne.preprocessing.eyetracking.Calibration` instances, |
75 | 75 | # one for each calibration. We can index that list to access a specific calibration. |
76 | 76 |
|
77 | | -cals = read_eyelink_calibration(et_fpath) |
| 77 | +cals = read_eyelink_calibration(et_fpath, screen_resolution=(1920, 1080)) |
78 | 78 | print(f"number of calibrations: {len(cals)}") |
79 | 79 | first_cal = cals[0] # let's access the first (and only in this case) calibration |
80 | 80 | print(first_cal) |
|
97 | 97 | # and the offsets (in visual degrees) between the calibration position and the actual |
98 | 98 | # gaze position of each calibration point. |
99 | 99 |
|
| 100 | +# %% |
100 | 101 | first_cal.plot() |
101 | 102 |
|
| 103 | +# %% |
| 104 | +# .. hint:: |
| 105 | +# If you supply the eyetracker monitor’s screen resolution to |
| 106 | +# :class:`~mne.preprocessing.eyetracking.Calibration`, |
| 107 | +# :meth:`~mne.preprocessing.eyetracking.Calibration.plot` will automatically set the |
| 108 | +# canvas bounds accordingly. |
| 109 | + |
102 | 110 | # %% |
103 | 111 | # Standardizing eyetracking data to SI units |
104 | 112 | # ------------------------------------------ |
105 | 113 | # |
106 | 114 | # EyeLink stores eyegaze positions in pixels, and pupil size in arbitrary units. |
107 | 115 | # MNE-Python expects eyegaze positions to be in radians of visual angle, and pupil |
108 | 116 | # size to be in meters. We can convert the eyegaze positions to radians using |
109 | | -# :func:`~mne.preprocessing.eyetracking.convert_units`. We'll pass the calibration |
110 | | -# object we created above, after specifying the screen resolution, screen size, and |
111 | | -# screen distance. |
| 117 | +# :func:`~mne.preprocessing.eyetracking.convert_units`. In addition to the |
| 118 | +# screen resolution, we need to supply the eyetracker screen size and screen distance |
| 119 | +# to our :class:`~mne.preprocessing.eyetracking.Calibration` object, before calling the |
| 120 | +# convert units function. |
112 | 121 |
|
113 | | -first_cal["screen_resolution"] = (1920, 1080) |
114 | 122 | first_cal["screen_size"] = (0.53, 0.3) |
115 | 123 | first_cal["screen_distance"] = 0.9 |
116 | 124 | mne.preprocessing.eyetracking.convert_units(raw_et, calibration=first_cal, to="radians") |
|
0 commit comments