Skip to content

Draft: Determine the farthest points of a vtkPoints instance

chir-set requested to merge chir-set/vtk:FarthestPoints into master

Hello,

Please consider this patch, the final goal of which if to determine the farthest points of a vtkPoints instance.

It adds a function in vtkDataArray that can locate the extreme tuples on a given dimension. A second function in vtkPoints gets these bounds on each axis and determine the farthest points by calculating the distances between the 6 resulting points.

I was using the Python version of these functions in one Slicer module, then required them in a second Slicer module. If you are agreeable for an inclusion in VTK, it may help such situations downstream.

To be complete, the question of 'finding the farthest' points has been initially discussed here. Following a valuable input from @lassoan, the original implementation has been updated to account for degenerate conditions. The included test cases check the latter conditions, at least what can be thought of.

Waiting to read your comments.

Regards.

Merge request reports

Loading