Locate EOG artifacts. .. note:: To control true-positive and true-negative detection rates, you may adjust the ``thresh`` parameter. Parameters ---------- raw : instance of Raw The raw data. event_id : int The index to assign to found events. l
(
raw,
event_id=998,
l_freq=1,
h_freq=10,
filter_length="10s",
ch_name=None,
tstart=0,
reject_by_annotation=False,
thresh=None,
verbose=None,
)
| 13 | |
| 14 | @verbose |
| 15 | def find_eog_events( |
| 16 | raw, |
| 17 | event_id=998, |
| 18 | l_freq=1, |
| 19 | h_freq=10, |
| 20 | filter_length="10s", |
| 21 | ch_name=None, |
| 22 | tstart=0, |
| 23 | reject_by_annotation=False, |
| 24 | thresh=None, |
| 25 | verbose=None, |
| 26 | ): |
| 27 | """Locate EOG artifacts. |
| 28 | |
| 29 | .. note:: To control true-positive and true-negative detection rates, you |
| 30 | may adjust the ``thresh`` parameter. |
| 31 | |
| 32 | Parameters |
| 33 | ---------- |
| 34 | raw : instance of Raw |
| 35 | The raw data. |
| 36 | event_id : int |
| 37 | The index to assign to found events. |
| 38 | l_freq : float |
| 39 | Low cut-off frequency to apply to the EOG channel in Hz. |
| 40 | h_freq : float |
| 41 | High cut-off frequency to apply to the EOG channel in Hz. |
| 42 | filter_length : str | int | None |
| 43 | Number of taps to use for filtering. |
| 44 | %(ch_name_eog)s |
| 45 | tstart : float |
| 46 | Start detection after tstart seconds. |
| 47 | reject_by_annotation : bool |
| 48 | Whether to omit data that is annotated as bad. |
| 49 | thresh : float | None |
| 50 | Threshold to trigger the detection of an EOG event. This controls the |
| 51 | thresholding of the underlying peak-finding algorithm. Larger values |
| 52 | mean that fewer peaks (i.e., fewer EOG events) will be detected. |
| 53 | If ``None``, use the default of ``(max(eog) - min(eog)) / 4``, |
| 54 | with ``eog`` being the filtered EOG signal. |
| 55 | %(verbose)s |
| 56 | |
| 57 | Returns |
| 58 | ------- |
| 59 | eog_events : array |
| 60 | Events. |
| 61 | |
| 62 | See Also |
| 63 | -------- |
| 64 | create_eog_epochs |
| 65 | compute_proj_eog |
| 66 | """ |
| 67 | # Getting EOG Channel |
| 68 | eog_inds = _get_eog_channel_index(ch_name, raw) |
| 69 | eog_names = np.array(raw.ch_names)[eog_inds] # for logging |
| 70 | logger.info(f"EOG channel index for this subject is: {eog_inds}") |
| 71 | |
| 72 | # Reject bad segments. |