00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMeanShiftModeSeekerBase.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:46 $ 00007 Version: $Revision: 1.5 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 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 00064 itkTypeMacro(MeanShiftModeSeekerBase, Object); 00065 itkNewMacro(Self) ; 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(TSample* sample) ; 00079 00080 TSample* GetInputSample() 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::Pointer m_InputSample ; 00108 unsigned int m_MaximumIteration ; 00109 typename CacheMethodType::Pointer m_CacheMethod ; 00110 } ; // end of class 00111 00112 } // end of namespace Statistics 00113 } // end of namespace itk 00114 00115 #ifndef ITK_MANUAL_INSTANTIATION 00116 #include "itkMeanShiftModeSeekerBase.txx" 00117 #endif 00118 00119 #endif 00120