Repository navigation
Description
Goal
Add a scientifically faithful spatial workbench for fNIRS and intracranial EEG, linked to NEMAR's existing signal viewer. Support fNIRS source-detector layouts, depth-electrode contacts and surface grids/strips without inventing missing anatomy or geometry. Build our own integrated interface, using prior platforms as references rather than copying their assets.
Phases
- Establish spatial metadata contracts, coordinate provenance and real-data coverage.
- Render fNIRS sources, detectors and channels linked to signals.
- Render depth electrodes and surface grids/strips linked to iEEG channels.
- Add optional, authorized anatomy and verified coordinate transforms.
- Deliver linked interaction, accessibility and performance gates.
- Validate representative datasets and publish concise usage documentation.
Each phase is an independently tested and reviewed PR into an epic branch based on staging. Follow AGENTS.md, the viewer architecture and the epic-dev workflow; plan each phase before coding. The final epic merge and production release remain separate decisions.
Invariants
- Reuse NEMAR's existing viewer, metadata and stable data-plane routes. New backend fields require an explicit backend issue, not frontend fabrication.
- Coordinates need documented units, coordinate system, origin, provenance and transformations. Missing or ambiguous geometry shows a clear unavailable state, never a guessed brain placement.
- Distinguish template from subject anatomy and measured contacts from projections. No clinical interpretation or implied localization accuracy.
- Multiple fNIRS wavelengths may share a source-detector pair; bipolar iEEG channels reference two contacts. Channel-to-geometry mappings must preserve these distinctions.
- Anatomy is optional and must be authorized for use. No patient-identifying assets or unsupported access expansion.
- Light and dark themes, keyboard operation, no-WebGL/error recovery, bounded loading and recording changes are acceptance gates.
- Test with real, authorized source data and traceable coordinate fixtures under repository rules. Synthetic illustrative layouts are not scientific validation.
Dependencies and related work
Check existing viewer work #256 and #261 before implementation; coordinate with eegdash/eegdash-viewer and eegdash/electrodes rather than duplicating their public interfaces. First phase establishes exact ownership and files from current source. Backend spatial requirements are linked before implementation.
Phase issue tracker
- Phase 1: Spatial metadata contract and provenance #538: Spatial metadata contract and provenance
- Phase 2: fNIRS geometry linked to signals #539: fNIRS geometry linked to signals
- Phase 3: Depth electrodes and surface grids #540: Depth electrodes and surface grids
- Phase 4: Optional anatomy and verified transforms #541: Optional anatomy and verified transforms
- Phase 5: Linked interaction and accessibility #542: Linked interaction and accessibility
- Phase 6: Scientific validation and documentation #543: Scientific validation and documentation
Activity