99from ...epochs import BaseEpochs
1010from ...evoked import Evoked
1111from ...io import BaseRaw
12- from ...utils import _check_option , _validate_type , logger , warn
12+ from ...utils import _check_option , _validate_type , logger , verbose , warn
1313from .calibration import Calibration
1414from .utils import _check_calibration
1515
1616
17+ @verbose
18+ def find_blinks (
19+ inst ,
20+ * ,
21+ chs_src = None ,
22+ method = "by_dropout" ,
23+ dropout_value = None ,
24+ description = "BAD_blink" ,
25+ chs_dest = None ,
26+ verbose = None ,
27+ ):
28+ """Find blinks in eye-tracking data and create corresponding annotations.
29+
30+ Parameters
31+ ----------
32+ inst : instance of Raw
33+ The data instance to use for finding blinks. Must contain pupil channels.
34+ chs_src : list | None
35+ A list of channel names that will be used to find blinks. None (default) will
36+ result in selecting all channels of type ``pupil``. See Notes for more
37+ information.
38+ method : str
39+ Which method to use to find blinks in ``inst``. Currently the only supported
40+ method is ``'by_dropout'`` (default), which uses the value specified via
41+ ``dropout_value`` to identify blinks.
42+ dropout_value : float | None
43+ Which value in the data denotes a dropout. In Eyelink data, this is ``0``,
44+ whereas for other eye-tracking data this may be ``np.nan``, or something else.
45+ Defaults to None, which sets the ``dropout_value`` to ``np.nan``.
46+ description : str
47+ Which description to use for the blink annotations. Defaults to ``'BAD_blink'``.
48+ chs_dest : list | None
49+ A list of channel names that will be associated with the blink annotations.
50+ None (default) and passing an empty lists will associate each blink annotation
51+ with all channels in ``inst``.
52+ %(verbose)s
53+
54+ Returns
55+ -------
56+ annots : mne.Annotations
57+ The annotations objects containing blink annotations.
58+
59+ Notes
60+ -----
61+ If multiple channels are used to find blinks in ``inst``, resulting overlapping
62+ blink annotations are always merged over all channels. That is, if a left and a
63+ right pupil channel would be used for blink detection, and each on their own would
64+ produce overlapping blink annotations with onsets ``[1.5, 1.6]`` and durations
65+ ``[0.2, 0.3]``, respectively, then passing both channels into this function will
66+ result in a single blink annotation with onset ``1.5`` and duration ``0.4``.
67+ Note that this correspondes to the minimum onset and the maximum offset between
68+ the two annotations.
69+ """
70+ logger .info ("Found blinks" )
71+ return
72+
73+
1774# specific function to set eyetrack channels
1875def set_channel_types_eyetrack (inst , mapping ):
1976 """Define sensor type for eyetrack channels.
@@ -168,7 +225,8 @@ def _convert_deg_to_rad(array):
168225 return array * np .pi / 180.0
169226
170227
171- def convert_units (inst , calibration , to = "radians" ):
228+ @verbose
229+ def convert_units (inst , calibration , to = "radians" , verbose = None ):
172230 """Convert Eyegaze data from pixels to radians of visual angle or vice versa.
173231
174232 .. warning::
@@ -191,6 +249,7 @@ def convert_units(inst, calibration, to="radians"):
191249 (in pixels).
192250 to : str
193251 Must be either ``"radians"`` or ``"pixels"``, indicating the desired unit.
252+ %(verbose)s
194253
195254 Returns
196255 -------
0 commit comments