Convenience wrapper around ANN (Approximate Nearest Neighbours) for fast nearest-neighbour point searches.
More...
#include <mitkPointLocator.h>
Convenience wrapper around ANN (Approximate Nearest Neighbours) for fast nearest-neighbour point searches.
Usage:
- Set the point set via SetPoints(vtkPointSet*), SetPoints(mitk::PointSet*), or SetPoints(ITKPointSet*).
- Query the closest point to an arbitrary coordinate via FindClosestPoint().
No additional Update() call is needed – the internal kd-tree is built automatically when the points are set.
Currently only single nearest-neighbour queries are supported.
- Precondition
- At least 1 point must be contained in the point set.
- See also
- mitk::PointSet
Definition at line 47 of file mitkPointLocator.h.
◆ CoordRepType
◆ DistanceType
◆ IdType
◆ IdVectorType
◆ ITKPointSet
◆ MeshTraits
◆ MyANNdist
◆ MyANNdistArray
◆ MyANNidx
◆ MyANNidxArray
◆ MyANNpoint
◆ MyANNpointArray
◆ PixelType
◆ PointLocator()
| mitk::PointLocator::PointLocator |
( |
| ) |
|
|
protected |
◆ ~PointLocator()
| mitk::PointLocator::~PointLocator |
( |
| ) |
|
|
overrideprotected |
◆ Clone()
| Pointer mitk::PointLocator::Clone |
( |
| ) |
const |
◆ DestroyANN()
| void mitk::PointLocator::DestroyANN |
( |
| ) |
|
|
protected |
releases all memory occupied by the ann search tree and internal point set arrays
◆ FindClosestANNPoint()
Finds the nearest neighbour in the point set previously defined by SetPoints(). The Id of the point is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the nearest neighbour will be determined |
- Returns
- the id of the nearest neighbour of the given point. The id corresponds to the id which is given in the original point set.
◆ FindClosestPoint() [1/3]
| IdType mitk::PointLocator::FindClosestPoint |
( |
const double |
point[3] | ) |
|
Finds the nearest neighbour in the point set previously defined by SetPoints(). The Id of the point is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the nearest neighbour will be determined |
- Returns
- the id of the nearest neighbour of the given point. The id corresponds to the id which is given in the original point set.
◆ FindClosestPoint() [2/3]
| IdType mitk::PointLocator::FindClosestPoint |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
Finds the nearest neighbour in the point set previously defined by SetPoints(). The Id of the point is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| x | the x coordinated of the query point, for whom the nearest neighbour will be determined |
| y | the x coordinated of the query point, for whom the nearest neighbour will be determined |
| z | the x coordinated of the query point, for whom the nearest neighbour will be determined |
- Returns
- the id of the nearest neighbour of the given point. The id corresponds to the id which is given in the original point set.
◆ FindClosestPoint() [3/3]
Finds the nearest neighbour in the point set previously defined by SetPoints(). The Id of the point is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the nearest neighbour will be determined |
- Returns
- the id of the nearest neighbour of the given point. The id corresponds to the id which is given in the original point set.
◆ FindClosestPointAndDistance()
Finds the nearest neighbour in the point set previously defined by SetPoints(). The Index and minimal distance between this point and the closest point of the point set is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the minimal distance will be determined |
| id | |
| dist | |
- Returns
- the index of and distance (in world coordinates) between the nearest point in point set and the given point
◆ GetMinimalDistance() [1/2]
Finds the minimal distance between the given point and a point in the previously defined point set. The distance is returned. Please note, that there is no case, in which no distance is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the minimal distance to a point in the previously defined point set will be determined |
- Returns
- the squared distance in world coordinates between the given point and the nearest neighbour.
◆ GetMinimalDistance() [2/2]
Finds the nearest neighbour in the point set previously defined by SetPoints(). The minimal distance between this point and the closest point of the point set is returned. Please note, that there is no case, in which no point is found, since as a precondition at least one point has to be contained in the point set.
- Parameters
-
| point | the query point, for whom the minimal distance will be determined |
- Returns
- the distance in world coordinates between the nearest point in point set and the given point
◆ InitANN()
| void mitk::PointLocator::InitANN |
( |
| ) |
|
|
protected |
Initializes the ann search tree using previously defined points
◆ mitkClassMacroItkParent()
| mitk::PointLocator::mitkClassMacroItkParent |
( |
PointLocator |
, |
|
|
itk::Object |
|
|
) |
| |
◆ New()
| static Pointer mitk::PointLocator::New |
( |
| ) |
|
|
static |
◆ SetPoints() [1/3]
| void mitk::PointLocator::SetPoints |
( |
ITKPointSet * |
pointSet | ) |
|
Sets the point which will be used for nearest-neighbour searches. Note there must be at least one point in the point set.
- Parameters
-
| pointSet | the point set containing points for nearest neighbours searches. |
◆ SetPoints() [2/3]
Sets the point which will be used for nearest-neighbour searches. Note there must be at least one point in the point set.
- Parameters
-
| points | the point set containing points for nearest neighbours searches. |
◆ SetPoints() [3/3]
| void mitk::PointLocator::SetPoints |
( |
vtkPointSet * |
points | ) |
|
Sets the point which will be used for nearest-neighbour searches. Note there must be at least one point in the point set.
- Parameters
-
| points | the point set containing points for nearest neighbours searches. |
◆ m_ANNDataPoints
◆ m_ANNDimension
| unsigned int mitk::PointLocator::m_ANNDimension |
|
protected |
◆ m_ANNDistances
◆ m_ANNEpsilon
| double mitk::PointLocator::m_ANNEpsilon |
|
protected |
◆ m_ANNK
| unsigned int mitk::PointLocator::m_ANNK |
|
protected |
◆ m_ANNPointIndexes
◆ m_ANNQueryPoint
◆ m_ANNTree
| ANNkd_tree* mitk::PointLocator::m_ANNTree |
|
protected |
◆ m_IndexToPointIdContainer
◆ m_ItkPoints
◆ m_MitkPoints
◆ m_SearchTreeInitialized
| bool mitk::PointLocator::m_SearchTreeInitialized |
|
protected |
◆ m_VtkPoints
| vtkPoints* mitk::PointLocator::m_VtkPoints |
|
protected |
The documentation for this class was generated from the following file: