9
9
from ...epochs import BaseEpochs
10
10
from ...evoked import Evoked
11
11
from ...io import BaseRaw
12
- from ...utils import _check_option , _validate_type , logger , warn
12
+ from ...utils import _check_option , _validate_type , logger , verbose , warn
13
13
from .calibration import Calibration
14
14
from .utils import _check_calibration
15
15
16
16
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 corresponds to the minimum onset and the maximum offset between
68
+ the two annotations.
69
+ """
70
+ logger .info ("Found blinks" )
71
+ return
72
+
73
+
17
74
# specific function to set eyetrack channels
18
75
def set_channel_types_eyetrack (inst , mapping ):
19
76
"""Define sensor type for eyetrack channels.
@@ -168,7 +225,8 @@ def _convert_deg_to_rad(array):
168
225
return array * np .pi / 180.0
169
226
170
227
171
- def convert_units (inst , calibration , to = "radians" ):
228
+ @verbose
229
+ def convert_units (inst , calibration , to = "radians" , verbose = None ):
172
230
"""Convert Eyegaze data from pixels to radians of visual angle or vice versa.
173
231
174
232
.. warning::
@@ -191,6 +249,7 @@ def convert_units(inst, calibration, to="radians"):
191
249
(in pixels).
192
250
to : str
193
251
Must be either ``"radians"`` or ``"pixels"``, indicating the desired unit.
252
+ %(verbose)s
194
253
195
254
Returns
196
255
-------
0 commit comments