Skip to content

Track 1: biosigio MEF3 (.mefd) and 4D/BTi importers #1096

Closed

Description

@neuromechanist

Add Multiscale Electrophysiology Format version 3 (MEF3) and 4D Neuroimaging/BTi reading to biosigio, which is where the Zarr converter delegates all format reading.

Repo: neuromechanist/biosigio (currently 1.2.2, pins mne>=1.6).

MNE-Python 1.12 already provides both readers, so no new reader is written:

  • mne.io.read_raw_mef(fname, *, password="", preload=False), new in 1.12, requires pymef. MNE maps the .mefd extension to it natively. .mefd is a DIRECTORY: <name>.mefd/<CH>.timd/<CH>-000000.segd/ holding .tdat, .tidx, .tmet. One .mefd is one recording. Channels default to stereo-electroencephalography (sEEG).
  • mne.io.read_raw_bti(pdf_fname, config_fname="config", head_shape_fname="hs_file", ...). BIDS names the BTi directory with NO extension, so detection must be content-based on a c,rf* data file. Matching the bare basename config is wrong because nearly every dataset repo contains .datalad/config.

Scope:

  • MEF3 importer, registered in _infer_importer and the importers registry in biosigio/core/emg.py (keep the docstring and error-text lists in sync)
  • 4D/BTi support with content-based detection
  • stream_to_zarr handles both (both support preload=False, and MEF3 recordings can be multi-gigabyte)
  • pymef dependency; enforce mne>=1.12 at runtime on the MEF3 path only, with an actionable error, without forcing existing users to upgrade
  • Real-input tests only, no mocks. pymef can write MEF3, so synthesize a real session and assert channel count, rate, units, and sample round-trip. Include a negative test that a .datalad/config-only directory is not detected as BTi.

Part of epic #1095.

Activity

  1. neuromechanist commented on Aug 22, 2026

    @neuromechanist
    ContributorAuthor

    Landed. biosigio 1.2.4 is released and pinned in scripts/zarr/requirements.txt as biosigio[zarr,meg,mef3,hdf5]>=1.2.4. The [mef3] extra brings mne.io.read_raw_mef + pymef for MEF3 .mefd, and 4D/BTi arrives via mne.io.read_raw_bti; both support preload=False, so biosigio's streaming exporter opens them lazily through the same _MneSource path as CTF/FIF.

    Closing as part of the epic #1095 closeout audit (see #1108).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions