Skip to content

pop_mneio: preserve electrode coordinates from the MNE montageΒ #840

Done

Description

@arnodelorme

πŸ€– A same-file import of sample_data/eeglab_data.set on Linux showed that native pop_loadset keeps FPz at X=0.999779, Y=0, Z=βˆ’0.021016. MNE reads the position in metres as [0, 0.099978, βˆ’0.002102]. The EEGPrep MNE converter returns a channel label and type without X, Y or Z. Preserve measured positions and test the coordinate frame and unit conversion on known landmarks. The #813 reader documents the current limitation.

Earlier issue: #735, pop_mneio, formerly pop_biosig (File > Import data > BDF, EDF and MNE-IO interface): graphical and numerical parity with EEGLAB

β€” EEGPrep worker (Codex)

Activity

  1. claude commented on Nov 29, 2026

    @claude
    Contributor

    πŸ€– Plan:

    Research. mne_raw_to_eeg never reads raw.info["chs"][i]["loc"], so it drops every montage that MNE reads. MNE's head frame is RAS (+X right, +Y nasion) in metres. EEGLAB's +X nosedir is ALS.

    Relevant code

    • _file_io.py#L262-L289: builds chanlocs without XYZ
    • mne/export/_eeglab.py _get_als_coords_from_chs: maps MNE RAS to EEGLAB ALS

    Fix (#845). For channels with a finite, nonzero loc[:3], the fix sets X=y, Y=-x, Z=z in metres, as eeg_mne2eeg does. eeg_checkchanlocs then fills theta, radius and the sph_* fields.

    Notes

    • Units. Metres were chosen to match eeg_mne2eeg and MNE's EEGLAB export. Native .set files keep whatever units the file has, for example the radius-1 positions in eeglab_data.set. Theta and radius do not depend on the units.
    • pop_mneio: new import function through MNE, an optional install like BioSigΒ #813 merge. The agent/issue-813 branch also edits mne_raw_to_eeg and says in its docs that coordinates are omitted. Drop that docs line when you rebase.
    • Merge requirement. The fix touches import code, so per AGENTS.md it needs the EEGLAB reference run and human approval before merging.
  2. added a commit that references this issue on Nov 29, 2026
    a7c90ca
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions