Kdtree returned indices and distances

Good morning everyone,
I am using itk::Statistics::KdTreeGenerator::KdTree in order to find correspondences but it looks like distances are not sorted and always one value is 0 (which might be true for few vertices).

For example:
Point 4997 distances: 0.049331 0.043294 0 0.0407943 0.0460834
Point 4998 distances: 0.035021 0 0.0539435 0.043294 0.0524717
Point 4999 distances: 0 0.035021 0.045838 0.050482 0.0575521

Does this make any sense? Is the first index in the InstanceIdentifierVectorType the index to the closes point or do I need to look for the minimum value?

Thank you for the help in advance,
Anto.

1 Like