00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkWeightedCentroidKdTreeGenerator_h
00018 #define __itkWeightedCentroidKdTreeGenerator_h
00019
00020 #include <vector>
00021
00022 #include "itkSample.h"
00023 #include "itkSubsample.h"
00024 #include "itkKdTree.h"
00025 #include "itkKdTreeGenerator.h"
00026 #include "itkStatisticsAlgorithm.h"
00027
00028 namespace itk{
00029 namespace Statistics{
00030
00059 template < class TSample >
00060 class ITK_EXPORT WeightedCentroidKdTreeGenerator :
00061 public KdTreeGenerator< TSample >
00062 {
00063 public:
00065 typedef WeightedCentroidKdTreeGenerator Self ;
00066 typedef KdTreeGenerator< TSample > Superclass ;
00067 typedef SmartPointer<Self> Pointer;
00068
00070 itkTypeMacro(WeightedCentroidKdTreeGenerator, KdTreeGenerator);
00071
00073 itkNewMacro(Self) ;
00074
00076 typedef typename Superclass::MeasurementVectorType MeasurementVectorType ;
00077 typedef typename Superclass::MeasurementType MeasurementType ;
00078 typedef typename Superclass::SubsampleType SubsampleType ;
00079 typedef typename Superclass::SubsamplePointer SubsamplePointer ;
00080 typedef typename Superclass::KdTreeType KdTreeType ;
00081 typedef typename Superclass::KdTreeNodeType KdTreeNodeType ;
00082 itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00083 TSample::MeasurementVectorSize);
00084
00085 protected:
00087 WeightedCentroidKdTreeGenerator() ;
00088
00090 virtual ~WeightedCentroidKdTreeGenerator() {}
00091
00092 void PrintSelf(std::ostream& os, Indent indent) const ;
00093
00095 virtual KdTreeNodeType* GenerateNonterminalNode(int beginIndex,
00096 int endIndex,
00097 MeasurementVectorType
00098 &lowerBound,
00099 MeasurementVectorType
00100 &upperBound,
00101 int level) ;
00102
00103 private:
00104 WeightedCentroidKdTreeGenerator(const Self&) ;
00105 void operator=(const Self&) ;
00106
00107 MeasurementVectorType m_TempLowerBound ;
00108 MeasurementVectorType m_TempUpperBound ;
00109 MeasurementVectorType m_TempMean ;
00110 } ;
00111
00112 }
00113 }
00114
00115 #ifndef ITK_MANUAL_INSTANTIATION
00116 #include "itkWeightedCentroidKdTreeGenerator.txx"
00117 #endif
00118
00119 #endif
00120
00121
00122
00123