Skip to content

BUG: Clear extra points filter when setting info in Coregistration (#14420) - #14458

Open
badrisatyam1-ctrl wants to merge 4 commits into
mne-tools:mainfrom
badrisatyam1-ctrl:fix-coreg-set-info-omit-hsp
Open

badrisatyam1-ctrl wants to merge 4 commits into
mne-tools:mainfrom
badrisatyam1-ctrl:fix-coreg-set-info-omit-hsp

Conversation

@badrisatyam1-ctrl

Copy link
Copy Markdown
Contributor

Reference issue (if any)

Fixes #14420.

What does this implement/fix?

When using Coregistration.omit_head_shape_points(), an omission mask is saved in self._extra_points_filter. When loading a new digitizer file or calling Coregistration.set_info(new_info) with a different number of head shape points, this stale filter was retained, causing an IndexError: boolean index did not match indexed array along axis 0 during subsequent fitting or distance calculation.

This PR resets self._extra_points_filter = None inside Coregistration.set_info(), clears the stale mask when digitizer info changes, and adds a regression assertion in test_coreg_fitting_invariants().

Additional information

AI assistance disclosure: developed with Antigravity using Gemini 3.8 Flash to trace the execution path and draft the regression assertion. The fix was tested locally against issue #14420.

@welcome

welcome Bot commented Oct 24, 2026

Copy link
Copy Markdown

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@payamsash

Copy link
Copy Markdown
Member

Thank you @badrisatyam1-ctrl for your time. This is already added in #14412, see this commit

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Dev version of coreg crashing sometimes during fiducial fit

2 participants