62 template<
typename TSample>
94 virtual const Self *
Left()
const = 0;
106 virtual unsigned int Size()
const = 0;
136 template<
typename TSample>
244 template<
typename TSample>
361 template<
typename TSample>
482 template<
typename TSample>
568 const unsigned int size =
static_cast< unsigned int >(
m_Distances.size() );
569 for (
unsigned int i = 0; i < size; i++ )
662 return m_Sample->GetMeasurementVector(
id );
669 return m_Sample->GetFrequency(
id );
714 std::ostream & os = std::cout )
const;
718 void PlotTree( std::ostream & os )
const;
733 virtual void PrintSelf( std::ostream & os,
Indent indent )
const ITK_OVERRIDE;
770 #ifndef ITK_MANUAL_INSTANTIATION
771 #include "itkKdTree.hxx"
void GetWeightedCentroid(CentroidType &)
const MeasurementVectorType & GetMeasurementVector(InstanceIdentifier id) const
void GetCentroid(CentroidType &)
KdTreeNode< TSample > Self
unsigned int m_FarthestNeighborIndex
void DeleteNode(KdTreeNodeType *)
TSample::ConstIterator ConstIterator
Light weight base class for most itk classes.
InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier index) const
KdTreeNodeType * GetEmptyTerminalNode()
Superclass::InstanceIdentifier InstanceIdentifier
const Superclass * Left() const
KdTreeNodeType * GetRoot()
This class defines the interface of its derived classes.
This is a subclass of the KdTreeNode.
const Superclass * Left() const
virtual bool IsTerminal() const
void GetCentroid(CentroidType ¢roid)
void AddInstanceIdentifier(InstanceIdentifier valueId)
const Superclass * Right() const
virtual ~KdTreeTerminalNode()
TSample::MeasurementVectorType MeasurementVectorType
void ReplaceFarthestNeighbor(InstanceIdentifier id, double distance)
TSample::AbsoluteFrequencyType AbsoluteFrequencyType
virtual void GetWeightedCentroid(CentroidType &)=0
virtual InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier) const =0
void GetWeightedCentroid(CentroidType &)
TSample::InstanceIdentifier InstanceIdentifier
void GetWeightedCentroid(CentroidType ¢roid)
void operator=(const Self &)
KdTreeWeightedCentroidNonterminalNode(unsigned int, MeasurementType, Superclass *, Superclass *, CentroidType &, unsigned int)
TSample::MeasurementType MeasurementType
MeasurementType m_PartitionValue
SizeValueType Size() const
EuclideanDistanceMetric< MeasurementVectorType > DistanceMetricType
Euclidean distance function.
void GetParameters(unsigned int &, MeasurementType &) const
ObjectType * GetPointer() const
InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier) const
bool BallWithinBounds(const MeasurementVectorType &, MeasurementVectorType &, MeasurementVectorType &, double) const
unsigned long SizeValueType
const Superclass * Left() const
Superclass::CentroidType CentroidType
void PrintTree(std::ostream &) const
KdTreeNode< TSample > KdTreeNodeType
void GetCentroid(CentroidType &)
InstanceIdentifier m_InstanceIdentifier
virtual bool IsTerminal() const
data structure for storing k-nearest neighbor search result (k number of Neighbors) ...
virtual ~KdTreeWeightedCentroidNonterminalNode()
This class is the node that doesn't have any child node. The IsTerminal method returns true for this ...
unsigned int Size() const
TSample::Iterator Iterator
unsigned int Size() const
MeasurementType m_PartitionValue
InstanceIdentifier m_InstanceIdentifier
const InstanceIdentifierVectorType & GetNeighbors() const
int NearestNeighborSearchLoop(const KdTreeNodeType *, const MeasurementVectorType &, MeasurementVectorType &, MeasurementVectorType &, NearestNeighbors &) const
InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier) const
DistanceMetricType * GetDistanceMetric()
void GetParameters(unsigned int &, MeasurementType &) const
void Search(const MeasurementVectorType &, unsigned int, InstanceIdentifierVectorType &) const
void SetRoot(KdTreeNodeType *root)
void AddInstanceIdentifier(InstanceIdentifier id)
virtual unsigned int Size() const =0
unsigned int Size() const
This is a subclass of the KdTreeNode.
void PlotTree(std::ostream &os) const
Superclass::InstanceIdentifier InstanceIdentifier
KdTreeNodeType * m_EmptyTerminalNode
MeasurementVectorSizeType GetMeasurementVectorSize() const
AbsoluteFrequencyType GetFrequency(InstanceIdentifier id) const
double GetLargestDistance()
virtual void GetCentroid(CentroidType &)=0
virtual void GetParameters(unsigned int &, MeasurementType &) const =0
DistanceMetricType::Pointer m_DistanceMetric
TSample::InstanceIdentifier InstanceIdentifier
const Superclass * Right() const
Array< double > CentroidType
std::pair< InstanceIdentifier, double > NeighborType
std::vector< InstanceIdentifier > InstanceIdentifierVectorType
KdTreeNonterminalNode(unsigned int, MeasurementType, Superclass *, Superclass *)
Superclass::MeasurementType MeasurementType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
InstanceIdentifier GetNeighbor(unsigned int index) const
Superclass::CentroidType CentroidType
unsigned int MeasurementVectorSizeType
const Superclass * Right() const
std::vector< InstanceIdentifier > m_InstanceIdentifiers
MeasurementVectorSizeType m_MeasurementVectorSize
void SetSample(const TSample *)
KdTreeNode< TSample > Superclass
TSample::MeasurementVectorSizeType MeasurementVectorSizeType
void resize(unsigned int k)
void GetParameters(unsigned int &, MeasurementType &) const
Control indentation during Print() invocation.
unsigned int m_PartitionDimension
KdTreeNode< TSample > Superclass
InstanceIdentifierVectorType m_Identifiers
Define additional traits for native types such as int or float.
virtual void AddInstanceIdentifier(InstanceIdentifier)=0
void AddInstanceIdentifier(InstanceIdentifier valueId)
MeasurementVectorSizeType m_MeasurementVectorSize
const TSample * GetSample() const
Base class for most ITK classes.
SmartPointer< Self > Pointer
KdTreeNode< TSample > Superclass
const std::vector< double > & GetDistances() const
int SearchLoop(const KdTreeNodeType *, const MeasurementVectorType &, double, MeasurementVectorType &, MeasurementVectorType &, InstanceIdentifierVectorType &) const
virtual bool IsTerminal() const =0
Superclass::MeasurementType MeasurementType
bool BoundsOverlapBall(const MeasurementVectorType &, MeasurementVectorType &, MeasurementVectorType &, double) const
Superclass::MeasurementType MeasurementType
This class provides methods for k-nearest neighbor search and related data structures for a k-d tree...
Superclass::CentroidType CentroidType
Superclass::InstanceIdentifier InstanceIdentifier
SmartPointer< const Self > ConstPointer
unsigned int m_PartitionDimension
TSample::MeasurementType MeasurementType
virtual ~KdTreeNonterminalNode()
void SetBucketSize(unsigned int)
std::vector< double > m_Distances
CentroidType m_WeightedCentroid