Skip to content

ENH: compress EGI MFF multi-epoch timeline and use 0-duration BAD_ACQ_SKIP - #14155

Open
PragnyaKhandelwal wants to merge 3 commits into
mne-tools:mainfrom
PragnyaKhandelwal:egi-mff-bad-acq-skip-side-by-side
Open

ENH: compress EGI MFF multi-epoch timeline and use 0-duration BAD_ACQ_SKIP#14155
PragnyaKhandelwal wants to merge 3 commits into
mne-tools:mainfrom
PragnyaKhandelwal:egi-mff-bad-acq-skip-side-by-side

Conversation

@PragnyaKhandelwal

Copy link
Copy Markdown
Contributor

Reference issue (if any)

Part of #13926 (Phase 1 — EGI MFF multi-epoch / paused recording handling).

What does this implement/fix?

Previously, read_raw_egi represented multi-epoch (paused) MFF recordings by placing recording epochs in a gapped timeline: the time between epochs was zero-padded, and BAD_ACQ_SKIP annotations had a non-zero duration covering the gap.

This PR changes the representation to match the pattern used by other MNE readers (e.g. EyeLink): recording epochs are placed side-by-side (compressed timeline, no zero-padding), and BAD_ACQ_SKIP annotations have duration=0 at each epoch boundary.

Concretely:

  • disk_samps is now np.arange(total_actual_samples) — sequential, no gap entries.
  • An egi_time_to_disk lookup maps EGI-timeline positions to compressed positions; gap positions map to -1.
  • The egi_events array has gap columns stripped before use, so the STI channel stays aligned.
  • BAD_ACQ_SKIP onset is disk_offsets[ei+1] / sfreq; duration=0.0.
  • In events_as_annotations mode, events in gaps or out of range are silently dropped (consistent with what the STI-channel path already did).

Test expected values for event sample positions and skip-timing constants are updated to reflect the compressed timeline. All 25 EGI tests pass.

Additional information

…ation BAD_ACQ_SKIP

Recording epochs are now placed consecutively (no zero-padding across gaps).
BAD_ACQ_SKIP annotations carry duration=0 at each epoch transition boundary,
matching the pattern used by other MNE readers for acquisition discontinuities.
@PragnyaKhandelwal
PragnyaKhandelwal marked this pull request as ready for review August 13, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant