Issue with `omit_head_shape_points` not affecting point count in automatic coregistration

Hello,

I’m trying to perform automatic coregistration using MNE-Python. Below are the steps I’m following:

import mne

# Load the epochs and extract info
info = mne.read_epochs(epoched_fif, preload=True, verbose=True).info

# Use estimated fiducials from fsaverage
fiducials = "estimated"

# Initialize the Coregistration object
coreg = mne.coreg.Coregistration(info, 
                                 subject=fs_sub, 
                                 subjects_dir=fs_sub_dir,
                                 fiducials=fiducials)

# Fit fiducials
coreg.fit_fiducials(verbose=True)

# First ICP iteration
coreg.fit_icp(n_iterations=20, 
              nasion_weight=1., 
              verbose=True)

# Omit head shape points that are farther than 5mm
coreg.omit_head_shape_points(distance=5/1000) 

# Second ICP iteration with higher nasion weight
coreg.fit_icp(n_iterations=20, 
              nasion_weight=10., 
              verbose=True)

The initial coregistration setup and fit_fiducials seem to work correctly. However, when I attempt to omit head shape points using omit_head_shape_points, the points that are farther than 5mm are correctly identified (as confirmed by the logger and the self._extra_points_filter mask), but they are not removed from the actual points.

Upon comparing coreg._dig_dict before and after the call to omit_head_shape_points, the number of points remains unchanged. It seems like the mask is created, but not applied to filter out the points. This behavior continues even when I call fit_icp again.

Is this a bug in how the mask is applied, or am I missing something in my process? Any guidance would be appreciated!

Additional Information:

  • MNE version: 1.8.0
  • Operating system: macOS 14.5

Thank you for your help