Skip to content

Chapter 5: Events and Epoching

Continuing from Chapter 4 — Artifact Removal with ICA.

With a cleaned continuous recording, this chapter marks the moments of interest and cuts the data into trials around them — the same process covered as code in the MNE-Python track's Events and Epoching chapter.

Events and annotations

The Markers menu covers both kinds of time markers MNE-Python distinguishes between:

  • Markers → Edit Events..., Import Events..., and Export Events... manage numeric event codes at exact sample points — MNE-Python's events array.
  • Markers → Edit Annotations..., Import Annotations..., and Export Annotations... manage labeled time spans — MNE-Python's Annotations, commonly used for marking bad segments or continuous conditions.
  • Markers → Find Events... scans a stimulus channel to generate events automatically, and Markers → Events from Annotations / Annotations from Events... convert between the two representations, matching mne.events_from_annotations() and its counterpart in code.

Creating epochs

Epochs → Create Epochs... cuts the continuous recording into fixed-length windows around a chosen set of event codes, with a time range (e.g. 200 ms before to 500 ms after) and an optional baseline period to subtract — the same parameters mne.Epochs() takes in code. Once run, the sidebar entry switches from a continuous recording to a stack of epochs, and every later menu action applies to the whole stack at once.

Cleaning epochs

  • Epochs → Drop Bad Epochs... removes any epoch whose peak-to-peak amplitude exceeds thresholds you set — the GUI equivalent of epochs.drop_bad() — catching residual artifacts ICA didn't fully remove.
  • Epochs → Detect Artifacts... offers additional automatic rejection criteria for flagging epochs before you commit to dropping them.

For the underlying epoching API these menu items wrap, see the MNE-Python track's Events and Epoching chapter.

Next: Chapter 6 — ERP Analysis