Skip to content

Commit 4a88d1b

Browse files
committed
BUG: Fix dev_head_t for EEG data
1 parent cf5ef5f commit 4a88d1b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

mne/_fiff/meas_info.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,7 +3315,7 @@ def create_info(ch_names, sfreq, ch_types="misc", verbose=None):
33153315
)
33163316

33173317

3318-
def _empty_info(sfreq):
3318+
def _empty_info(sfreq, *, dev_head_t=True):
33193319
"""Create an empty info dictionary."""
33203320
from ..transforms import Transform
33213321

@@ -3364,7 +3364,11 @@ def _empty_info(sfreq):
33643364
info["highpass"] = 0.0
33653365
info["sfreq"] = float(sfreq)
33663366
info["lowpass"] = info["sfreq"] / 2.0
3367-
info["dev_head_t"] = Transform("meg", "head")
3367+
if dev_head_t is True:
3368+
dev_head_t = Transform("meg", "head")
3369+
elif dev_head_t is False:
3370+
dev_head_t = None
3371+
info["dev_head_t"] = dev_head_t
33683372
info._update_redundant()
33693373
info._check_consistency()
33703374
return info

mne/io/egi/egimff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def __init__(
440440
assert egi_events.shape[1] == egi_info["last_samps"][-1]
441441

442442
meas_dt_utc = egi_info["meas_dt_local"].astimezone(datetime.timezone.utc)
443-
info = _empty_info(egi_info["sfreq"])
443+
info = _empty_info(egi_info["sfreq"], dev_head_t=False)
444444
info["meas_date"] = _ensure_meas_date_none_or_dt(meas_dt_utc)
445445
info["utc_offset"] = egi_info["utc_offset"]
446446
info["device_info"] = dict(type=egi_info["device"])

mne/io/egi/tests/test_egi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def test_egi_mff_pause(fname, skip_times, event_times):
8383
events_as_annotations=False,
8484
)
8585
assert raw.info["sfreq"] == 250.0 # true for all of these files
86+
assert raw.info["dev_head_t"] is None # no MEG data
8687
assert len(raw.annotations) == len(skip_times)
8788

8889
# assert event onsets match expected times

0 commit comments

Comments
 (0)