EEG tutorial

EEG: convert a 28-run motor-imagery dataset.

PhysioNet's motor-imagery sample data. Two subjects, fourteen EDF runs each, packaged with binary .edf.event annotation files. The whole pipeline (scan, convert, enrich, validate) runs in under a minute on this dataset.

The EEG curation story is simpler than MRI's.

No DICOM clustering, no fmaps, no IntendedFor. But EEG datasets carry one quirk that needs human attention before conversion: the scanner-derived task entity defaults to the EDF filename token (S001R01, S001R02, …). Users have to relabel each run with the real protocol task name. We walk that step below.

Example data

PhysioNet motor imagery (2 subjects)

Mirror of the standard PhysioNet motor-imagery format. Two subject folders (S001, S002); each has 14 .edf recordings plus their binary .edf.event annotation siblings.

Download EEG sample dataset →

Dataset overview

2 subjects, 28 EDF files.

Standard PhysioNet motor-imagery layout. Each subject has 14 runs (R01R14). Each .edf is paired with a binary .edf.event annotation file the mne-bids backend reads alongside.

EEG_motor_imagery_sample_data/ 28 recordings
S001/ 14 runs
S001R01.edf + .edf.event
S001R02.edf + .edf.event
S001R03.edf + .edf.event empty events
S001R04.edf … S001R14.edf
S002/ 14 runs
S002R01.edf … S002R14.edf
64_channel_sharbrough.png, .pdf, RECORDS, SHA256SUMS, wfdbcal

The PhysioNet motor-imagery protocol

R01-R14 follow a fixed protocol; the recording filenames give no hint of the underlying task. Re-labelling them in the Inspection table before conversion gives every BIDS file a meaningful task entity. Common mapping:

EDF token Real task
R01baseline_eyes_open
R02baseline_eyes_closed
R03open_fist_real
R04open_fist_imagined
R05both_fists_real
R06both_fists_imagined
R07-R10(repeats R03-R06)
R11-R14(repeats R03-R06 again)
What you'll see

Real numbers from the EEG pipeline.

The same four commands you saw in the MRI tutorial work unchanged on the EEG dataset. Real outputs captured on the local copy of this sample:

Scan 28 inventory rows

One row per .edf. No skips (no scouts or scanner reports to flag). Subject identity comes from path prefix (S001sub-001).

Convert 27 / 28 runs written

mne-bids writes each EDF as a BIDS-named .edf with a matching channel TSV, events TSV, and JSON sidecar. One row fails on this dataset: sub-001_task-S001R03_run-3 has an empty events table that mne-bids cannot encode. The Log dock prints the failure cleanly; the rest completes.

Validate 113 / 29 / 0 ok / warn / err

Zero errors. The 29 warnings are all bidsmgr.todo_placeholder: the dataset-level fields (License, Authors, etc.) and the EEG-specific recommended fields (ManufacturersModelName, SoftwareVersions) that the enrichment cannot infer without help.

What's different vs MRI

One workflow, modality-specific quirks.

  • No DICOM clustering. EEG subjects come from the folder name (S001sub-001). PatientID is not in the EDF header.
  • Task names need user override. The classifier writes the EDF filename token (S001R01) into the task column. The user types the real protocol task in the Inspection table before conversion; the BIDS basename updates live (see Step 3, sub-step 3 in the MRI walkthrough).
  • One bulk edit relabels every run. Cmd-/shift-click selects every row ending in R01 across both subjects, then Bulk edit applies the real task name to all of them in one move.
  • Different backend. The Convert step calls mne-bids (write_raw_bids) instead of dcm2niix. Same orchestration layer.
  • No fmap fixups. EEG sidecars do not carry IntendedFor. The Convert step's "fmap fixups" lines that appear on MRI do not stream here.