Head sphere fit failure in epoch plotting

Hello! I’m under MNE version 1.6.0 , Python 3.8.18 in Ubuntu 20.04.6 LTS .

The issue I’m encountering is simple. I have two participants, β€œ1006” and β€œ1008”, with the following (minimal reproduction) code:

import mne

def get_evoked(subject_name):
raw = mne.io.read_raw(get_subject_raw_path(subjects_fif_dir, subject_name))
events, events_dict = get_events_from_annotated_raw(raw)

evoked_click = mne.Epochs(raw, events, event_id={'0-back T_C': 2},tmin=-0.2, tmax=1.7, baseline=(-0.2,0), picks='meg').average()
return evoked_click

evoked_1006 = get_evoked(β€œ1006”)
evoked_1008 = get_evoked(β€œ1008”)

evoked_1006.plot_sensors(show_names=True, to_sphere=False,verbose=1)
evoked_1008.plot_sensors(show_names=True, to_sphere=False,verbose=1)

These yield respectively:

And:

This data was acquired in a neuromag system.

Comparing the locations and channel names yields no assertion error:

assert len(evoked_1008.ch_names) == len(evoked_1006.ch_names)
for i in range(len(evoked_1006.ch_names)):
assert evoked_1006.ch_names[i] == evoked_1008.ch_names[i]

for i, c in enumerate(evoked_1006.info[β€˜chs’]):
assert np.all(c[β€˜loc’] == evoked_1008.info[β€˜chs’][i][β€˜loc’])

Importantly, this is prior to any preprocessing (to avoid any coregistration shenanigan). As you can see, this is really in sensor space.

The error arises, I believe from here: mne-python/mne/bem.py at 966121be5931918ec63497aa4e9ba1404858007e Β· mne-tools/mne-python Β· GitHub

EDIT: The warning comes from estimated head origin from digitized points. More specifically, here are the digitized points and the estimated head origin for 1008 (β€œgood” participant):
image
Head origin: [-0.00151273, 0.00877649, 0.0497408 ]

And for 1006 (β€œbad” participant):
image

Head origin: [0.00350283, 0.02398606, 0.05428553]

My question now: how do I fix it?
Cheers!

Discuss today: the lack of digitization points on the back of the head leads to a fitted sphere (argument sphere="auto" in any topographic plot) with a center offset from the head coordinate frame origin. Nothing is wrong, the warning is sensible as any topographic map drawn with this setting might lead to a bias during interpretation.

Mathieu

1 Like