You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pop_mneio: preserve electrode coordinates from the MNE montageΒ #840
π€ 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
Reproduce: eeg_mne2eeg (the eeglabio path) already keeps XYZ. mne_raw_to_eeg, used by pop_fileio, pop_biosig, pop_mffimport and the pop_mneio on the agent/issue-813 branch, builds chanlocs from labels only.
Write a failing test on a standard_1020 montage that checks the nose, left and up landmarks, metres, and agreement with MNE's EEGLAB export
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.
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.
Activity
claude commentedon Nov 29, 2026
π€ Plan:
eeg_mne2eeg(the eeglabio path) already keeps XYZ.mne_raw_to_eeg, used bypop_fileio,pop_biosig,pop_mffimportand thepop_mneioon theagent/issue-813branch, builds chanlocs from labels only.standard_1020montage that checks the nose, left and up landmarks, metres, and agreement with MNE's EEGLAB exportmne_raw_to_eegin [IO] Keep MNE montage electrode positions on importΒ #845test_stream9_readersand the file I/O suites passResearch.
mne_raw_to_eegnever readsraw.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+Xnosedir is ALS.Relevant code
_file_io.py#L262-L289: builds chanlocs without XYZmne/export/_eeglab.py_get_als_coords_from_chs: maps MNE RAS to EEGLAB ALSFix (#845). For channels with a finite, nonzero
loc[:3], the fix setsX=y, Y=-x, Z=zin metres, aseeg_mne2eegdoes.eeg_checkchanlocsthen fills theta, radius and the sph_* fields.Notes
eeg_mne2eegand MNE's EEGLAB export. Native.setfiles keep whatever units the file has, for example the radius-1 positions ineeglab_data.set. Theta and radius do not depend on the units.agent/issue-813branch also editsmne_raw_to_eegand says in its docs that coordinates are omitted. Drop that docs line when you rebase.Keep MNE montage positions in imported chanlocs