Repository navigation
Description
Potential killer feature: let domain experts (neurologists, EEG researchers) annotate recordings directly in the signal viewer using Hierarchical Event Descriptors (HED) vocabulary — mark time ranges and/or channels as epileptiform activity (seizures, spikes, sharp waves), sleep spindles, artifacts/noise, etc.
Vocabulary source: the HED SCORE library schema (hed-standard/hed-schemas, library_schemas/score) carries the clinical EEG reporting vocabulary (epileptiform patterns, seizure semiology, artifacts per the SCORE standard), and base HED covers general artifact/noise terms. The local hed-schemas checkout is 69 commits behind origin and needs a pull before extracting vocab. Ship the schema terms as a static, versioned JSON bundle (id, short tag, long-form path, description) — no runtime dependency on external schema servers.
Annotation UX (v1):
- Drag on the trace to select a time range (or click a channel label to scope to a channel); a popover offers a fuzzy-search box over the HED vocabulary plus a curated quick-pick list (common epilepsy + artifact tags).
- Annotations render as colored spans on the traces and marks on the events timeline, alongside the dataset's own events.
- Edit/delete; keyboard-friendly.
Persistence and export:
- Annotations are pure text with BIDS
events.tsvsemantics (onset,duration,channel,HEDcolumns) — export as_events.tsvdownload is always available regardless of sign-in. - Signed-in: persist in the browser (IndexedDB keyed by user id + dataset + recording + dataset version). Anonymous: same local persistence, plus a
beforeunloadwarning offering download or sign-in. - Open question (server-side storage): storing on our Cloudflare side adds nothing for a single user (it is tiny text), but it is the prerequisite for cross-device access and for any future community/shared annotation layer or contributing annotations back to datasets. Recommendation: v1 local-only + export; revisit CF storage when sharing becomes a goal. Decide before v1 only if we want the data model to anticipate it.
Relationship to existing work: distinct from Phase 3 HED visualization (#4, blocked on nemar-cli#511 QA artifacts) — this is annotation authoring. The events timeline/rendering infrastructure in src/lib/eeg-viewer/events.ts is the natural mount point.
This is the largest item in the viewer epic and will need its own phased breakdown (selection UI, vocabulary bundle + fuzzy search, persistence, export) when picked up.
Activity
neuromechanist commentedon Sep 1, 2026
Shipped in PR #263 (+ QA rounds #266-#269), merged to staging via epic PR #270 (merge commit 9e047c1). Closing by hand: closing keywords only fire on the default branch.