diff --git a/doc/changes/dev/13672.bugfix.rst b/doc/changes/dev/13672.bugfix.rst new file mode 100644 index 00000000000..3cf463e11d7 --- /dev/null +++ b/doc/changes/dev/13672.bugfix.rst @@ -0,0 +1 @@ +Allow reading alternative nasion label ("Nz") in SNIRF files when parsing landmarkPos3D, by :newcontrib:`Aniket Singh Yadav`. \ No newline at end of file diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 79db14d44e3..09c5818b6af 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -22,6 +22,7 @@ .. _Andrew Gilbert: https://github.com/adgilbert .. _Andrew Quinn: https://github.com/ajquinn .. _Aniket Pradhan: https://github.com/Aniket-Pradhan +.. _Aniket Singh Yadav: https://github.com/Aniketsy .. _Anna Padee: https://github.com/apadee/ .. _Annalisa Pascarella: https://github.com/annapasca .. _Anne-Sophie Dubarry: https://github.com/annesodub diff --git a/mne/io/snirf/_snirf.py b/mne/io/snirf/_snirf.py index 020e55f4d91..1b3f940a58d 100644 --- a/mne/io/snirf/_snirf.py +++ b/mne/io/snirf/_snirf.py @@ -399,7 +399,7 @@ def natural_keys(text): dign = dign.lower() if dign in [b"lpa", b"al"]: lpa = diglocs[idx, :3] - elif dign in [b"nasion"]: + elif dign in [b"nasion", b"nz"]: nasion = diglocs[idx, :3] elif dign in [b"rpa", b"ar"]: rpa = diglocs[idx, :3] diff --git a/mne/io/tests/test_raw.py b/mne/io/tests/test_raw.py index c03963c9854..13cf958d2ff 100644 --- a/mne/io/tests/test_raw.py +++ b/mne/io/tests/test_raw.py @@ -520,13 +520,16 @@ def _test_raw_reader( # make sure that dig points in head coords implies that fiducials are # present if len(raw.info["dig"] or []) > 0: - card_pts = [ - d for d in raw.info["dig"] if d["kind"] == _dig_kind_dict["cardinal"] + card_pts_head = [ + d + for d in raw.info["dig"] + if d["kind"] == _dig_kind_dict["cardinal"] + and d["coord_frame"] == FIFF.FIFFV_COORD_HEAD ] eeg_dig_head = [d for d in eeg_dig if d["coord_frame"] == FIFF.FIFFV_COORD_HEAD] if len(eeg_dig_head): - assert len(card_pts) == 3, "Cardinal points missing" - if len(card_pts) == 3: # they should all be in head coords then + assert len(card_pts_head) == 3, "Cardinal points missing" + if len(card_pts_head) == 3: # they should all be in head coords then assert len(eeg_dig_head) == len(eeg_dig) return raw