Skip to content

Commit

Permalink
Fix EEGLAB import (nodatchans) (#13097)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
cbrnr and larsoner authored Feb 3, 2025
1 parent 715540a commit 9e7fe95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changes/devel/13097.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug when loading certain EEGLAB files that do not contain a ``nodatchans`` field, by `Clemens Brunner`_.
2 changes: 1 addition & 1 deletion mne/io/eeglab/eeglab.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _get_montage_information(eeg, get_pos, *, montage_units):
)

lpa, rpa, nasion = None, None, None
if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo["nodatchans"], dict):
if hasattr(eeg, "chaninfo") and isinstance(eeg.chaninfo.get("nodatchans"), dict):
nodatchans = eeg.chaninfo["nodatchans"]
types = nodatchans.get("type", [])
descriptions = nodatchans.get("description", [])
Expand Down

0 comments on commit 9e7fe95

Please sign in to comment.