Surface Cutting Project - Extracting Cells within User-Specified Loop of Vertices

Hi,

I am working on developing a set of new filters in Paraview and was wondering if anyone could provide advice on how to implement it. The filters are supposed to be used on brain surfaces (i.e. processed MRI scans). The objective is for the user to select points on the surface of the brain mesh, and the first filter will connect the vertices using a geodesic line to form a loop. I have already implemented this first filter (see attached image).

Then, another filter is supposed to extract the cells inside of the loop. I tried using vtkImplicitSelectionLoop combined with the clip filter. According to the documentation, each vertex is projected onto the plane computed from the loop (i.e. implicit function), and an inside-outside test is conducted, which should theoretically allow the user to clip the cells within the loop. However, it is not working properly, as it fails to capture everything inside the loop, and sometimes captures cells outside of the specified region (see attached image)!

Is there a way to address this issue - or another way to somehow gather the coordinates of the cells inside the loop in order to extract them?

Thanks,

Connie