00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkHypersphereKernelMeanShiftModeSeeker.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/07/26 15:54:57 $ 00007 Version: $Revision: 1.8 $ 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 __itkHypersphereKernelMeanShiftModeSeeker_h 00019 #define __itkHypersphereKernelMeanShiftModeSeeker_h 00020 00021 #include "itkMeanShiftModeSeekerBase.h" 00022 00023 #include "itkFixedArray.h" 00024 #include "itkNumericTraits.h" 00025 00026 namespace itk{ 00027 namespace Statistics{ 00028 00042 template< class TSample > 00043 class HypersphereKernelMeanShiftModeSeeker : 00044 public MeanShiftModeSeekerBase< TSample > 00045 { 00046 public: 00048 typedef HypersphereKernelMeanShiftModeSeeker Self; 00049 typedef MeanShiftModeSeekerBase< TSample > Superclass ; 00050 typedef SmartPointer<Self> Pointer; 00051 typedef SmartPointer<const Self> ConstPointer; 00052 00054 itkTypeMacro(HypersphereKernelMeanShiftModeSeeker, 00055 MeanShiftModeSeekerBase); 00056 itkNewMacro(Self) ; 00057 00059 typedef typename Superclass::MeasurementVectorType MeasurementVectorType ; 00060 typedef typename Superclass::SearchResultVectorType SearchResultVectorType ; 00061 typedef typename Superclass::MeasurementType MeasurementType ; 00062 00064 typedef double RealMeasurementType ; 00065 00068 typedef Array< RealMeasurementType > MeasurementVectorSumType; 00069 00071 void SetSearchRadius(double radius) ; 00072 00074 double GetSearchRadius() 00075 { return m_SearchRadius ; } 00076 00078 MeasurementVectorType Evolve(MeasurementVectorType instance) ; 00079 00080 protected: 00081 HypersphereKernelMeanShiftModeSeeker() ; 00082 virtual ~HypersphereKernelMeanShiftModeSeeker() ; 00083 void PrintSelf(std::ostream& os, Indent indent) const; 00084 00087 inline bool ComputeMode(MeasurementVectorType queryPoint, 00088 MeasurementVectorType& newPoint) ; 00089 00090 private: 00092 double m_SearchRadius ; 00093 00095 MeasurementVectorSumType m_TempVectorSum ; 00096 00098 MeasurementVectorType m_TempVector ; 00099 } ; // end of class 00100 00101 } // end of namespace Statistics 00102 } // end of namespace itk 00103 00104 #ifndef ITK_MANUAL_INSTANTIATION 00105 #include "itkHypersphereKernelMeanShiftModeSeeker.txx" 00106 #endif 00107 00108 #endif 00109