No GUI window is displayed when running mne.gui.coregistration().

  • MNE version: 1.12.1

  • operating system: Ubuntu Server 24.04.3 LTS

  • Python version: 3.11.15(also tested following script in version 3.12.3)

# %%

import mne

from mne.datasets import sample


print(mne.__version__)

mne.viz.set_3d_backend("notebook")

data_path = sample.data_path()

print(data_path)

# the raw file containing the channel location + types

sample_dir = data_path / "MEG" / "sample"

raw_fname = sample_dir / "sample_audvis_raw.fif"

# The paths to Freesurfer reconstructions

subjects_dir = data_path / "subjects"

subject = "sample"

#%%

mne.gui.coregistration(subject=subject, subjects_dir=subjects_dir)

Running the above code results in the following error, and no GUI window pops up.

TraitError: The 'children' trait of a HBox instance contains an Instance of a TypedTuple which expected a Widget, not the Image <PIL.Image.Image image mode=RGB size=800x600 at 0x70721B47FBD0>.

before:

mne.viz.set_3d_backend("notebook")

When I replace the code with the following, the GUI pops up normally.

after:

mne.viz.set_3d_backend("pyvistaqt")

Even if I delete this line, it still works fine.

Yes, the coregistration GUI does not work with the notebook backend. Thanks for posting the solution!