Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix dev_head_t for EEG data #13112

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented Feb 11, 2025

Seems like a bug that for EEG-only data formats like egi-mff that info["dev_head_t"] is not None. There is no MEG device so device to head transform. We currently set it to the identity matrix.

This is also relevant for example when concatenating MEG and EEG data -- if the MEG data has a dev_head_t (and it should) and the EEG data has dev_head_t of None everything works okay. If the EEG data has the identity matrix we get:

...
    meg.add_channels([eeg])
  File "/home/larsoner/python/mne-python/mne/channels/channels.py", line 741, in add_channels
    new_info = _merge_info(infos, force_update_to_first=force_update_info)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<decorator-gen-34>", line 12, in _merge_info
  File "/home/larsoner/python/mne-python/mne/_fiff/meas_info.py", line 3089, in _merge_info
    raise ValueError(msg)
ValueError: Measurement infos provide mutually inconsistent dev_head_t

Opening as draft because I think we need to go through and find all EEG-only formats and fix this, so far I've only done it for EGI-MFF.

  • Ensure CIs happy for MFF
  • Add to other EEG formats with tests

@sappelhoff
Copy link
Member

Could it be that this is also the reason that the mne-bids test pipeline is currently failing?

https://github.com/mne-tools/mne-bids/actions/runs/13351688224/job/37289052292

FAILED mne_bids/tests/test_read.py::test_get_head_mri_trans - ValueError: Coordinate frame not supported: None
================== 1 failed, 288 passed in 264.35s (0:04:24) ===================

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.

2 participants