mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

13204: Fix label border rendering issue on flat brain surfaces

Open scrharsh opened this issue 7 months ago • 3 comments

Reference issue

Fixes #13204.

What does this implement/fix?

This pull request addresses an issue where label borders could not be rendered correctly on flat brain surfaces during 3D plotting. Attempting to render borders in this context previously led to errors or misleading visuals.

Changes include:

  • A conditional check to detect flat surfaces (is_flat).
  • Emitting a warning when borders=True on flat surfaces:
    "Label borders cannot be displayed on flat surfaces. Skipping borders."
  • Skipping border rendering entirely if the surface is flat.
  • Added a test to ensure the warning is correctly raised and handled.

Additional information

This fix improves visualization reliability and provides informative user feedback when label borders are incompatible with flat surface rendering.

scrharsh avatar Apr 17 '25 17:04 scrharsh

There seem to be other changed mixed in with the PR.

wmvanvliet avatar Apr 18 '25 12:04 wmvanvliet

There seem to be other changed mixed in with the PR.

Thanks for pointing that out! Those changes weren’t meant to be part of this PR — I’ll clean it up and push an update shortly.

scrharsh avatar Apr 18 '25 13:04 scrharsh

@larsoner please have a look.

scrharsh avatar Apr 18 '25 18:04 scrharsh