BTW. this is a temporary fix, which breaks inline plotting with matplotlib. We have fixed it in the release branch. A slightly improved workaround may be to temporarily unset the MPLBACKEND environment variable before the call to HeadModelGeneration, e.g. something like this
import os
original_backend = os.environ.pop("MPLBACKEND", None)
labelfield = HeadModelGeneration(
images=image_list,
add_dura=True,
close_skin=True,
close_csf=True,
close_skull=True,
version=ImageML.eHeadModel.head16,
)
if original_backend is not None:
os.environ["MPLBACKEND"] = original_backend