mne.preprocessing.eyetracking.find_blinks#
- mne.preprocessing.eyetracking.find_blinks(inst, *, chs_src=None, method='dropout', dropout_value=None, description='BAD_blink', chs_dest=None, verbose=None)[source]#
Find blinks in eye-tracking data and create corresponding annotations.
- Parameters:
- instinstance of
Raw The data instance to use for finding blinks. Must contain pupil channels.
- chs_src
list|None A list of channel names that will be used to find blinks. None (default) will result in selecting all channels of type
pupil. See Notes for more information.- method
str Which method to use to find blinks in
inst. Currently the only supported method is'dropout'(default), which uses the value specified viadropout_valueto identify blinks.- dropout_value
float|None Which value in the data denotes a dropout. In Eyelink data, this is
0, whereas for other eye-tracking data this may benp.nan, or something else. Defaults to None, which sets thedropout_valuetonp.nan.- description
str Which description to use for the blink annotations. Defaults to
'BAD_blink'.- chs_dest
list|str|None Which channels to associate the blink annotations with. None (default) associates each blink annotation with the source channels (
chs_src) it was detected from. Passing'all'associates the annotations with all channels ininst. Alternatively, a list of channel names can be passed (e.g., EEG channels, for subsequent ocular artifact cleaning).- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- instinstance of
- Returns:
- annotinstance of
Annotations The annotations object containing blink annotations. It is not attached to
inst; useraw.set_annotationsto do so.
- annotinstance of
Notes
If multiple channels are used to find blinks in
inst, resulting overlapping blink annotations are always merged over all channels. That is, if a left and a right pupil channel would be used for blink detection, and each on their own would produce overlapping blink annotations with onsets[1.5, 1.6]and durations[0.2, 0.3], respectively, then passing both channels into this function will result in a single blink annotation with onset1.5and duration0.4. Note that this corresponds to the minimum onset and the maximum offset between the two annotations.