Skill Tracer
Skills › Scientific Agent Skills › neurokit2 › eog.md

eog.md

154 lines · skills/neurokit2/references/eog.md at 5f2bc03

Open on GitHub
1# Electrooculography
2
3Checked **2026-10-01** against NeuroKit2 0.2.13 stable source/runtime
4and the official EOG API/example.
5

Electrooculography

Checked 2026-10-01 against NeuroKit2 0.2.13 stable source/runtime and the official EOG API/example.

Raw lines 1 to 5
6## Scope and orientation
7
8NeuroKit2's EOG pipeline is primarily a **vertical EOG blink** workflow. Stable
9`eog_process()` requires blinks to be positive-going peaks. Verify channel montage,
10polarity, reference, physical unit, sampling rate, hardware filters, amplifier range,
11clock, and synchronization before processing.
13Do not use this module as a full gaze, saccade, fixation, or sleep-scoring system.
14Horizontal/vertical eye-movement interpretation and clinical/drowsiness monitoring need
15separate validated methods.

Scope and orientation

NeuroKit2's EOG pipeline is primarily a vertical EOG blink workflow. Stable eog_process() requires blinks to be positive-going peaks. Verify channel montage, polarity, reference, physical unit, sampling rate, hardware filters, amplifier range, clock, and synchronization before processing.

Do not use this module as a full gaze, saccade, fixation, or sleep-scoring system. Horizontal/vertical eye-movement interpretation and clinical/drowsiness monitoring need separate validated methods.

Raw lines 6 to 16
17## Optional MNE default
19`eog_peaks()` and `eog_findpeaks()` default to `method="mne"`. In the core 0.2.13
20installation, MNE is optional; the default can therefore raise an ImportError. Either
21add MNE at a reviewed exact version to the project lock or choose a core method:
23```python
24signals, info = nk.eog_process(
25 veog,
26 sampling_rate=200,
27 method="neurokit",
29```
31`eog_process()` forwards `**kwargs` to cleaning and peak finding. Record the explicit
32method rather than relying on an environment-dependent default.

Optional MNE default

eog_peaks() and eog_findpeaks() default to method="mne". In the core 0.2.13 installation, MNE is optional; the default can therefore raise an ImportError. Either add MNE at a reviewed exact version to the project lock or choose a core method:

signals, info = nk.eog_process(
    veog,
    sampling_rate=200,
    method="neurokit",
)

eog_process() forwards **kwargs to cleaning and peak finding. Record the explicit method rather than relying on an environment-dependent default.

Raw lines 17 to 33
34## Stable schemas
36The high-level return is `(signals, info)`. Default columns are:
38```text
39EOG_Raw, EOG_Clean, EOG_Blinks, EOG_Rate
40```
42`info` has `EOG_Blinks` (sample indices) and `sampling_rate`.
44Low-level interfaces differ:
46```python
47clean = nk.eog_clean(veog, sampling_rate=200, method="neurokit")
49# Returns only an array of blink sample indices.
50blink_indices = nk.eog_findpeaks(
51 clean,
52 sampling_rate=200,
53 method="neurokit",
56# Returns (same-length marker DataFrame, info dict).
57blink_markers, blink_info = nk.eog_peaks(
58 clean,
59 sampling_rate=200,
60 method="neurokit",
62```
64The 0.2.13 `eog_peaks()` docstring return section says array, while its tagged source
65returns `(signals, info)`. The pinned source/runtime is authoritative for stable work.
67Stable cleaning methods include `neurokit`, `agarwal2019`, `mne`, `brainstorm`, and
68`kong1998`. Peak methods include `neurokit`, `mne`, `brainstorm`, and `blinker`.
69MNE and some method paths need optional dependencies.

Stable schemas

The high-level return is (signals, info). Default columns are:

EOG_Raw, EOG_Clean, EOG_Blinks, EOG_Rate

info has EOG_Blinks (sample indices) and sampling_rate.

Low-level interfaces differ:

clean = nk.eog_clean(veog, sampling_rate=200, method="neurokit")

# Returns only an array of blink sample indices.
blink_indices = nk.eog_findpeaks(
    clean,
    sampling_rate=200,
    method="neurokit",
)

# Returns (same-length marker DataFrame, info dict).
blink_markers, blink_info = nk.eog_peaks(
    clean,
    sampling_rate=200,
    method="neurokit",
)

The 0.2.13 eog_peaks() docstring return section says array, while its tagged source returns (signals, info). The pinned source/runtime is authoritative for stable work.

Stable cleaning methods include neurokit, agarwal2019, mne, brainstorm, and kong1998. Peak methods include neurokit, mne, brainstorm, and blinker. MNE and some method paths need optional dependencies.

Raw lines 34 to 70
71## Blink features
73```python
74features = nk.eog_features(
75 clean,
76 blink_info["EOG_Blinks"],
77 sampling_rate=200,
79```
81`eog_features()` needs both the cleaned signal and peak-index array. It returns a dict
82with event-level fields such as:
84```text
85Blink_LeftZeros, Blink_RightZeros, Blink_pAVR,
86Blink_nAVR, Blink_BAR, Blink_Duration
87```
89Do not pass the processed DataFrame as the only argument. Feature validity depends on
90positive orientation and accurate blink segmentation.

Blink features

features = nk.eog_features(
    clean,
    blink_info["EOG_Blinks"],
    sampling_rate=200,
)

eog_features() needs both the cleaned signal and peak-index array. It returns a dict with event-level fields such as:

Blink_LeftZeros, Blink_RightZeros, Blink_pAVR,
Blink_nAVR, Blink_BAR, Blink_Duration

Do not pass the processed DataFrame as the only argument. Feature validity depends on positive orientation and accurate blink segmentation.

Raw lines 71 to 91
92## Sampling and artifacts
94Choose a rate from the endpoint and hardware bandwidth, not a universal number. Basic
95blink timing may use lower rates than detailed eyelid velocity or saccade morphology.
96Validate temporal error against labeled data at the actual rate; 200–500 Hz is common
97in research but not a guarantee.
99Inspect:
101- saturation and clipping during large eye movements;
102- baseline drift and electrode polarization;
103- frontal/facial EMG and movement/cable artifacts;
104- line noise and channel detachment;
105- polarity and montage changes across sessions; and
106- missing samples and synchronization with EEG/events.
108Do not interpolate through a blink or across detachment. Preserve raw/clean overlays,
109blink markers, rejected segments, and manual review outcomes.

Sampling and artifacts

Choose a rate from the endpoint and hardware bandwidth, not a universal number. Basic blink timing may use lower rates than detailed eyelid velocity or saccade morphology. Validate temporal error against labeled data at the actual rate; 200–500 Hz is common in research but not a guarantee.

Inspect:

  • saturation and clipping during large eye movements;
  • baseline drift and electrode polarization;
  • frontal/facial EMG and movement/cable artifacts;
  • line noise and channel detachment;
  • polarity and montage changes across sessions; and
  • missing samples and synchronization with EEG/events.

Do not interpolate through a blink or across detachment. Preserve raw/clean overlays, blink markers, rejected segments, and manual review outcomes.

Raw lines 92 to 110
111## Event and interval analysis
113```python
114epochs = nk.epochs_create(
115 signals,
116 events,
117 sampling_rate=200,
118 epochs_start=-0.5,
119 epochs_end=2,
120 baseline_correction=False,
122event_features = nk.eog_eventrelated(epochs)
123interval_features = nk.eog_intervalrelated(signals)
124```
126Documented event-related fields include `EOG_Rate_Baseline`, rate min/max/mean/SD and
127times, plus `EOG_Blinks_Presence`. Interval analysis returns `EOG_Peaks_N` and
128`EOG_Rate_Mean` in the official example. It does not universally return blink
129amplitude or duration summaries. Inspect columns at runtime.
131Blink rate over short windows is unstable and task-dependent. A count/rate change does
132not uniquely identify attention, fatigue, stress, dry eye, dopamine, or a neurological
133condition.

Event and interval analysis

epochs = nk.epochs_create(
    signals,
    events,
    sampling_rate=200,
    epochs_start=-0.5,
    epochs_end=2,
    baseline_correction=False,
)
event_features = nk.eog_eventrelated(epochs)
interval_features = nk.eog_intervalrelated(signals)

Documented event-related fields include EOG_Rate_Baseline, rate min/max/mean/SD and times, plus EOG_Blinks_Presence. Interval analysis returns EOG_Peaks_N and EOG_Rate_Mean in the official example. It does not universally return blink amplitude or duration summaries. Inspect columns at runtime.

Blink rate over short windows is unstable and task-dependent. A count/rate change does not uniquely identify attention, fatigue, stress, dry eye, dopamine, or a neurological condition.

Raw lines 111 to 134
135## EEG integration
137EOG can help identify ocular contamination in EEG, but NeuroKit2 does not provide a
138complete validated correction pipeline here. With MNE:
1401. synchronize and preserve dedicated EOG channels;
1412. fit artifact identification/correction on appropriate data;
1423. verify component or regression selection without removing neural signal;
1434. compare raw and corrected ERPs/spectra/topographies; and
1445. report method, channels, filters, thresholds, components, and exclusions.
146Avoid circularly selecting correction settings to maximize an experimental result.

EEG integration

EOG can help identify ocular contamination in EEG, but NeuroKit2 does not provide a complete validated correction pipeline here. With MNE:

  1. synchronize and preserve dedicated EOG channels;
  2. fit artifact identification/correction on appropriate data;
  3. verify component or regression selection without removing neural signal;
  4. compare raw and corrected ERPs/spectra/topographies; and
  5. report method, channels, filters, thresholds, components, and exclusions.

Avoid circularly selecting correction settings to maximize an experimental result.

Raw lines 135 to 147
148## Sources checked 2026-10-01
150- [Official EOG API](https://neuropsychology.github.io/NeuroKit/functions/eog.html)
151- [Official EOG example](https://neuropsychology.github.io/NeuroKit/examples/eog_analyze/eog_analyze.html)
152- [Stable v0.2.13 EOG source](https://github.com/neuropsychology/NeuroKit/tree/v0.2.13/neurokit2/eog)
153- [Kleifges et al. (2017), BLINKER](https://doi.org/10.3389/fnins.2017.00012)
154- [Keil et al. (2014), EEG/MEG reporting guidance](https://doi.org/10.1111/psyp.12147)