00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkKLMSegmentationRegion.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-02-05 19:04:58 $ 00007 Version: $Revision: 1.16 $ 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 #ifndef __itkKLMSegmentationRegion_h 00018 #define __itkKLMSegmentationRegion_h 00019 00020 #include "itkObject.h" 00021 #include "itkKLMSegmentationBorder.h" 00022 #include "itkSegmentationRegion.h" 00023 00024 #include "vnl/vnl_vector.h" 00025 00026 namespace itk 00027 { 00028 00087 class KLMSegmentationBorder; 00088 00089 class ITKCommon_EXPORT KLMSegmentationRegion : public SegmentationRegion 00090 { 00091 public: 00093 typedef KLMSegmentationRegion Self; 00094 typedef SegmentationRegion Superclass; 00095 typedef SmartPointer<Self> Pointer; 00096 typedef SmartPointer<const Self> ConstPointer; 00097 00099 itkNewMacro(Self); 00100 00102 itkTypeMacro(KLMSegmentationRegion,SegmentationRegion); 00103 00105 typedef vnl_vector<double> MeanRegionIntensityType; 00106 00109 typedef std::vector< KLMSegmentationBorder * > RegionBorderVectorType; 00110 typedef RegionBorderVectorType::size_type RegionBorderVectorSizeType; 00111 00113 typedef RegionBorderVectorType::iterator RegionBorderVectorIterator; 00114 00116 typedef RegionBorderVectorType::const_iterator RegionBorderVectorConstIterator; 00117 00119 typedef Superclass::RegionLabelType RegionLabelType; 00120 00123 RegionBorderVectorIterator GetRegionBorderItBegin(); 00124 RegionBorderVectorConstIterator GetRegionBorderConstItBegin(); 00126 00129 RegionBorderVectorIterator GetRegionBorderItEnd(); 00130 RegionBorderVectorConstIterator GetRegionBorderConstItEnd(); 00132 00135 RegionBorderVectorSizeType GetRegionBorderSize() const; 00136 00138 itkSetMacro(MeanRegionIntensity, MeanRegionIntensityType) 00139 itkGetConstReferenceMacro(MeanRegionIntensity, MeanRegionIntensityType); 00140 00143 void SetRegionParameters(MeanRegionIntensityType meanRegionIntensity, 00144 double regionArea, 00145 RegionLabelType label); 00146 00148 void PrintRegionInfo(); 00149 00151 void PushFrontRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00152 00154 void PushBackRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00155 00158 void InsertRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00159 00161 void InsertRegionBorder(RegionBorderVectorIterator it, 00162 KLMSegmentationBorder *pBorderCandidate); 00163 00165 void DeleteRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00166 00168 void DeleteAllRegionBorders(); 00169 00172 void CombineRegionParameters(const Self *region); 00173 00176 double EnergyFunctional(const Self *region); 00177 00180 void ResetRegionLabelAndUpdateBorders(Self *region); 00181 00208 void SpliceRegionBorders(Self *region); 00210 00213 void UpdateRegionBorderLambda(); 00214 00215 protected: 00216 KLMSegmentationRegion(); 00217 ~KLMSegmentationRegion(); 00218 void PrintSelf(std::ostream& os, Indent indent) const; 00219 00220 private: 00221 KLMSegmentationRegion(const Self&); // purposely not implemented 00222 void operator=(const Self&); // purposely not implemented 00223 00224 RegionBorderVectorType m_RegionBorderVector; 00225 MeanRegionIntensityType m_MeanRegionIntensity; 00226 00227 }; // class SegmentationRegion 00228 00229 00230 } // namespace itk 00231 00232 00233 #endif 00234