Skip to content

read_raw_eeglab does not read nasion, lpa and rpa values from .set file #10474

@cmadjar

Description

@cmadjar

Describe the bug

read_raw_eeglab does not read properly the nasion, lpa and rpa coordinates of a .set file.

Steps to reproduce

This can be reproduced on the sample data eeglab_data.set file that comes with EEGLAB.

>>> import mne
>>> import os
>>> from mne_bids import write_raw_bids, BIDSPath
>>> import eeglabio
>>> file = "/Users/cmadjar/Documents/MATLAB/eeglab2022.0/sample_data/eeglab_data.set"
>>> raw = mne.io.read_raw_eeglab(input_fname=file, preload=False, verbose=True)
Reading /Users/cmadjar/Documents/MATLAB/eeglab2022.0/sample_data/eeglab_data.fdt
>>> 
>>> raw.get_montage()
<DigMontage | 0 extras (headshape), 0 HPIs, 0 fiducials, 32 channels>

>>> raw.get_montage().get_positions()
.... 'coord_frame': 'head', 'nasion': None, 'lpa': None, 'rpa': None, 'hsp': None, 'hpi': None

Screen Shot 2022-03-30 at 1 11 21 PM

However, when looking in the Matlab structure, the coordinates for nasion, lpa and rpa are indeed present in the file. So for some reason, this gets lost when loading the .set file with read_raw_eeglab

Additional information

Reproduced on several versions of mne and different OS.

Latest information:

>>> mne.sys_info()
Platform:         macOS-11.3-x86_64-i386-64bit
Python:           3.9.12 (main, Mar 26 2022, 15:52:10)  [Clang 13.0.0 (clang-1300.0.29.30)]
Executable:       /Users/cmadjar/Development/python_venv/python_intel_3.9.4/eeg2bids_py3.9.12/bin/python
CPU:              i386: 8 cores
Memory:           Unavailable (requires "psutil" package)
mne:              1.0.0
numpy:            1.21.5 {blas=openblas, lapack=openblas}
scipy:            1.8.0
matplotlib:       3.5.1 {backend=MacOSX}

sklearn:          1.0.2
numba:            0.55.1
nibabel:          Not found
nilearn:          Not found
dipy:             Not found
cupy:             Not found
pandas:           1.4.1
pyvista:          Not found
pyvistaqt:        Not found
ipyvtklink:       Not found
vtk:              Not found
PyQt5:            Not found
ipympl:           Not found
pooch:            v1.6.0

mne_bids:         0.10
mne_nirs:         Not found
mne_features:     0.2
mne_qt_browser:   Not found
mne_connectivity: Not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions