00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkMeanShiftModeSeekerBase_h
00019 #define __itkMeanShiftModeSeekerBase_h
00020
00021 #include "itkObject.h"
00022 #include "itkVector.h"
00023 #include "itkMatrix.h"
00024 #include "itkNumericTraits.h"
00025 #include "itkMeanShiftModeCacheMethod.h"
00026
00027 namespace itk{
00028 namespace Statistics{
00029
00053 template< class TSample >
00054 class MeanShiftModeSeekerBase :
00055 public Object
00056 {
00057 public:
00059 typedef MeanShiftModeSeekerBase Self;
00060 typedef Object Superclass ;
00061 typedef SmartPointer<Self> Pointer;
00062 typedef SmartPointer<const Self> ConstPointer;
00063
00065 itkTypeMacro(MeanShiftModeSeekerBase, Object);
00066
00067 itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00068 TSample::MeasurementVectorSize) ;
00069
00071 typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00072 typedef typename TSample::MeasurementType MeasurementType ;
00073 typedef typename TSample::InstanceIdentifier InstanceIdentifier ;
00074
00075 typedef std::vector< InstanceIdentifier > SearchResultVectorType ;
00076 typedef MeanShiftModeCacheMethod< MeasurementVectorType > CacheMethodType ;
00077
00078 void SetInputSample(const TSample* sample) ;
00079
00080 const TSample* GetInputSample() const
00081 { return m_InputSample.GetPointer() ; }
00082
00083 void SetMaximumIteration(unsigned int number)
00084 { m_MaximumIteration = number ; }
00085
00086 unsigned int GetMaximumIteration()
00087 { return m_MaximumIteration ; }
00088
00089 void SetCacheMethod(CacheMethodType* method) ;
00090
00091 CacheMethodType* GetCacheMethod()
00092 { return m_CacheMethod.GetPointer() ; }
00093
00095 MeasurementVectorType Evolve(MeasurementVectorType instance) ;
00096
00097 protected:
00098 MeanShiftModeSeekerBase() ;
00099 virtual ~MeanShiftModeSeekerBase() ;
00100 void PrintSelf(std::ostream& os, Indent indent) const;
00101
00102 virtual bool ComputeMode(MeasurementVectorType queryPoint,
00103 MeasurementVectorType& newPoint) = 0 ;
00104
00105
00106 private:
00107 typename TSample::ConstPointer m_InputSample ;
00108 unsigned int m_MaximumIteration ;
00109 typename CacheMethodType::Pointer m_CacheMethod ;
00110 } ;
00111
00112 }
00113 }
00114
00115 #ifndef ITK_MANUAL_INSTANTIATION
00116 #include "itkMeanShiftModeSeekerBase.txx"
00117 #endif
00118
00119 #endif
00120