Skip to content

BUG: Fix dev_head_t for EEG data#13112

Merged
drammock merged 8 commits into
mne-tools:mainfrom
larsoner:empty
Jul 24, 2025
Merged

BUG: Fix dev_head_t for EEG data#13112
drammock merged 8 commits into
mne-tools:mainfrom
larsoner:empty

Conversation

@larsoner
Copy link
Copy Markdown
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
Copy Markdown
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) ===================

larsoner added 3 commits July 23, 2025 10:06
* upstream: (115 commits)
  Capitalize Get Help (mne-tools#13340)
  Website page load fixes (mostly) (mne-tools#13343)
  MAINT: Restore statsmodels to pip-pre (mne-tools#13345)
  BUG: Fix bug with reading old reports (mne-tools#13341)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13338)
  MAINT: Fix ref cycle with vtkPolyData (mne-tools#13336)
  MAINT: Dont set private attributes for PyVista Actor (mne-tools#13334)
  Add icon links to our donation pages (mne-tools#13331)
  MAINT: Dont set attribute on PolyData (mne-tools#13330)
  MAINT: Bump mins, deprecations (mne-tools#13322)
  Fix changes in SSD for backward compatibility [circle deploy] (mne-tools#13327)
  ENH: Add GED transformer (mne-tools#13259)
  FIX: Links
  MAINT: Stabilize MxNE tests (mne-tools#13321)
  FIX: DigMontage.rename_channels should return self (mne-tools#13320)
  MAINT: Prep for release (mne-tools#13319)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13317)
  MAINT: Update code credit (mne-tools#13318)
  MAINT: Make MxNE test more robust (mne-tools#13315)
  Adjust Pupil channel units (again) (mne-tools#13314)
  ...
@larsoner larsoner marked this pull request as ready for review July 23, 2025 14:26
@larsoner
Copy link
Copy Markdown
Member Author

@drammock ready for review/merge from my end!

@drammock drammock merged commit fa11865 into mne-tools:main Jul 24, 2025
30 of 32 checks passed
@drammock drammock deleted the empty branch July 24, 2025 14:17
@drammock
Copy link
Copy Markdown
Member

thx @larsoner

WouterKroot pushed a commit to WouterKroot/mne-python that referenced this pull request Aug 13, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
zEdS15B3GCwq pushed a commit to zEdS15B3GCwq/mne-python that referenced this pull request Aug 25, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

4 participants