Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <mitkPointLocator.h>
Public Types | |
typedef int | IdType |
typedef ScalarType | DistanceType |
typedef float | PixelType |
typedef double | CoordRepType |
typedef itk::DefaultStaticMeshTraits< PixelType, 3, 2, CoordRepType, CoordRepType, PixelType > | MeshTraits |
typedef itk::PointSet< PixelType, 3, MeshTraits > | ITKPointSet |
Public Member Functions | |
mitkClassMacroItkParent (PointLocator, itk::Object) | |
Pointer | Clone () const |
void | SetPoints (vtkPointSet *points) |
void | SetPoints (mitk::PointSet *points) |
void | SetPoints (ITKPointSet *pointSet) |
IdType | FindClosestPoint (const double point[3]) |
IdType | FindClosestPoint (double x, double y, double z) |
IdType | FindClosestPoint (mitk::PointSet::PointType point) |
DistanceType | GetMinimalDistance (mitk::PointSet::PointType point) |
bool | FindClosestPointAndDistance (mitk::PointSet::PointType point, IdType *id, DistanceType *dist) |
Static Public Member Functions | |
static Pointer | New () |
Protected Types | |
typedef std::vector< IdType > | IdVectorType |
typedef double * | MyANNpoint |
typedef int | MyANNidx |
typedef double | MyANNdist |
typedef MyANNpoint * | MyANNpointArray |
typedef MyANNidx * | MyANNidxArray |
typedef MyANNdist * | MyANNdistArray |
Protected Member Functions | |
PointLocator () | |
~PointLocator () override | |
void | InitANN () |
void | DestroyANN () |
IdType | FindClosestANNPoint (const MyANNpoint &point) |
DistanceType | GetMinimalDistance (const MyANNpoint &point) |
Protected Attributes | |
bool | m_SearchTreeInitialized |
IdVectorType | m_IndexToPointIdContainer |
vtkPoints * | m_VtkPoints |
mitk::PointSet * | m_MitkPoints |
ITKPointSet * | m_ItkPoints |
unsigned int | m_ANNK |
unsigned int | m_ANNDimension |
double | m_ANNEpsilon |
MyANNpointArray | m_ANNDataPoints |
MyANNpoint | m_ANNQueryPoint |
MyANNidxArray | m_ANNPointIndexes |
MyANNdistArray | m_ANNDistances |
ANNkd_tree * | m_ANNTree |
Convenience wrapper around ANN to provide fast nearest neighbour searches. Usage: set your points via SetPoints( vtkPointSet* Points ) or SetPoints(mitk::PointSet*). Then, you may query the closest point to an arbitrary coordinate by FindClosestPoint(). There is no further call to update etc. needed. Currently only calls for 1 nearest neighbour are supported. Feel free to add functions for K nearest neighbours. NOTE: At least 1 point must be contained in the point set.
Definition at line 39 of file mitkPointLocator.h.
typedef double mitk::PointLocator::CoordRepType |
Definition at line 52 of file mitkPointLocator.h.
Definition at line 49 of file mitkPointLocator.h.
typedef int mitk::PointLocator::IdType |
Definition at line 46 of file mitkPointLocator.h.
|
protected |
Definition at line 139 of file mitkPointLocator.h.
typedef itk::PointSet<PixelType, 3, MeshTraits> mitk::PointLocator::ITKPointSet |
Definition at line 54 of file mitkPointLocator.h.
typedef itk::DefaultStaticMeshTraits<PixelType, 3, 2, CoordRepType, CoordRepType, PixelType> mitk::PointLocator::MeshTraits |
Definition at line 53 of file mitkPointLocator.h.
|
protected |
Definition at line 149 of file mitkPointLocator.h.
|
protected |
Definition at line 152 of file mitkPointLocator.h.
|
protected |
Definition at line 148 of file mitkPointLocator.h.
|
protected |
Definition at line 151 of file mitkPointLocator.h.
|
protected |
Definition at line 147 of file mitkPointLocator.h.
|
protected |
Definition at line 150 of file mitkPointLocator.h.
typedef float mitk::PointLocator::PixelType |
Definition at line 51 of file mitkPointLocator.h.
|
protected |
constructor
Definition at line 17 of file mitkPointLocator.cpp.
|
overrideprotected |
destructor
Definition at line 33 of file mitkPointLocator.cpp.
References DestroyANN(), and m_SearchTreeInitialized.
Pointer mitk::PointLocator::Clone | ( | ) | const |
|
protected |
releases all memory occupied by the ann search tree and internal point set arrays
Definition at line 215 of file mitkPointLocator.cpp.
References m_ANNDataPoints, m_ANNDistances, m_ANNPointIndexes, m_ANNQueryPoint, m_ANNTree, and m_SearchTreeInitialized.
Referenced by InitANN(), and ~PointLocator().
|
protected |
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.
point | the query point, for whom the nearest neighbour will be determined |
Definition at line 178 of file mitkPointLocator.cpp.
References m_ANNDistances, m_ANNK, m_ANNPointIndexes, m_ANNTree, m_IndexToPointIdContainer, and m_SearchTreeInitialized.
Referenced by FindClosestPoint().
mitk::PointLocator::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.
point | the query point, for whom the nearest neighbour will be determined |
Definition at line 154 of file mitkPointLocator.cpp.
References FindClosestANNPoint(), and m_ANNQueryPoint.
mitk::PointLocator::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.
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 |
Definition at line 162 of file mitkPointLocator.cpp.
References FindClosestANNPoint(), and m_ANNQueryPoint.
mitk::PointLocator::IdType mitk::PointLocator::FindClosestPoint | ( | mitk::PointSet::PointType | point | ) |
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.
point | the query point, for whom the nearest neighbour will be determined |
Definition at line 170 of file mitkPointLocator.cpp.
References FindClosestANNPoint(), and m_ANNQueryPoint.
bool mitk::PointLocator::FindClosestPointAndDistance | ( | mitk::PointSet::PointType | point, |
IdType * | id, | ||
DistanceType * | dist | ||
) |
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.
point | the query point, for whom the minimal distance will be determined |
Definition at line 230 of file mitkPointLocator.cpp.
References m_ANNDistances, m_ANNK, m_ANNPointIndexes, m_ANNQueryPoint, m_ANNTree, and m_IndexToPointIdContainer.
mitk::PointLocator::DistanceType mitk::PointLocator::GetMinimalDistance | ( | mitk::PointSet::PointType | point | ) |
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.
point | the query point, for whom the minimal distance will be determined |
Definition at line 186 of file mitkPointLocator.cpp.
References m_ANNQueryPoint.
|
protected |
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.
point | the query point, for whom the minimal distance to a point in the previously defined point set will be determined |
Definition at line 194 of file mitkPointLocator.cpp.
References m_ANNDistances, m_ANNK, m_ANNPointIndexes, m_ANNTree, and m_SearchTreeInitialized.
|
protected |
Initializes the ann search tree using previously defined points
Definition at line 202 of file mitkPointLocator.cpp.
References DestroyANN(), m_ANNDataPoints, m_ANNDimension, m_ANNDistances, m_ANNK, m_ANNPointIndexes, m_ANNQueryPoint, m_ANNTree, m_IndexToPointIdContainer, and m_SearchTreeInitialized.
Referenced by SetPoints().
mitk::PointLocator::mitkClassMacroItkParent | ( | PointLocator | , |
itk::Object | |||
) |
|
static |
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.
points | the point set containing points for nearest neighbours searches. |
Definition at line 39 of file mitkPointLocator.cpp.
References InitANN(), m_ANNDataPoints, m_ANNDimension, m_IndexToPointIdContainer, and m_VtkPoints.
void mitk::PointLocator::SetPoints | ( | mitk::PointSet * | points | ) |
Sets the point which will be used for nearest-neighbour searches. Note there must be at least one point in the point set.
points | the point set containing points for nearest neighbours searches. |
Definition at line 74 of file mitkPointLocator.cpp.
References mitk::BaseData::GetMTime(), mitk::PointSet::GetPointSet(), mitk::PointSet::GetSize(), InitANN(), m_ANNDataPoints, m_ANNDimension, m_IndexToPointIdContainer, and m_MitkPoints.
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.
pointSet | the point set containing points for nearest neighbours searches. |
Definition at line 114 of file mitkPointLocator.cpp.
References InitANN(), m_ANNDataPoints, m_ANNDimension, m_IndexToPointIdContainer, and m_ItkPoints.
|
protected |
Definition at line 210 of file mitkPointLocator.h.
Referenced by DestroyANN(), InitANN(), and SetPoints().
|
protected |
Definition at line 208 of file mitkPointLocator.h.
Referenced by InitANN(), and SetPoints().
|
protected |
Definition at line 213 of file mitkPointLocator.h.
Referenced by DestroyANN(), FindClosestANNPoint(), FindClosestPointAndDistance(), GetMinimalDistance(), and InitANN().
|
protected |
Definition at line 209 of file mitkPointLocator.h.
|
protected |
Definition at line 207 of file mitkPointLocator.h.
Referenced by FindClosestANNPoint(), FindClosestPointAndDistance(), GetMinimalDistance(), and InitANN().
|
protected |
Definition at line 212 of file mitkPointLocator.h.
Referenced by DestroyANN(), FindClosestANNPoint(), FindClosestPointAndDistance(), GetMinimalDistance(), and InitANN().
|
protected |
Definition at line 211 of file mitkPointLocator.h.
Referenced by DestroyANN(), FindClosestPoint(), FindClosestPointAndDistance(), GetMinimalDistance(), and InitANN().
|
protected |
Definition at line 214 of file mitkPointLocator.h.
Referenced by DestroyANN(), FindClosestANNPoint(), FindClosestPointAndDistance(), GetMinimalDistance(), and InitANN().
|
protected |
Definition at line 198 of file mitkPointLocator.h.
Referenced by FindClosestANNPoint(), FindClosestPointAndDistance(), InitANN(), and SetPoints().
|
protected |
Definition at line 202 of file mitkPointLocator.h.
Referenced by SetPoints().
|
protected |
Definition at line 201 of file mitkPointLocator.h.
Referenced by SetPoints().
|
protected |
Definition at line 196 of file mitkPointLocator.h.
Referenced by DestroyANN(), FindClosestANNPoint(), GetMinimalDistance(), InitANN(), and ~PointLocator().
|
protected |
Definition at line 200 of file mitkPointLocator.h.
Referenced by SetPoints().