00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkKLMSegmentationRegion.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/11/04 20:40:40 $ 00007 Version: $Revision: 1.11 $ 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 private: 00093 typedef vnl_vector<double> MeanRegionIntensityType; 00094 00095 public: 00097 typedef KLMSegmentationRegion Self; 00098 typedef SegmentationRegion Superclass; 00099 typedef SmartPointer<Self> Pointer; 00100 typedef SmartPointer<const Self> ConstPointer; 00101 00103 itkNewMacro(Self); 00104 00106 itkTypeMacro(KLMSegmentationRegion,SegmentationRegion); 00107 00110 typedef std::vector< KLMSegmentationBorder * > RegionBorderVectorType; 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(); 00125 00128 RegionBorderVectorIterator GetRegionBorderItEnd(); 00129 RegionBorderVectorConstIterator GetRegionBorderConstItEnd(); 00130 00133 int GetRegionBorderSize() const; 00134 00136 itkSetMacro(MeanRegionIntensity, MeanRegionIntensityType) 00137 itkGetConstReferenceMacro(MeanRegionIntensity, MeanRegionIntensityType); 00138 00141 void SetRegionParameters(MeanRegionIntensityType meanRegionIntensity, 00142 double regionArea, 00143 RegionLabelType label); 00144 00146 void PrintRegionInfo(); 00147 00149 void PushFrontRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00150 00152 void PushBackRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00153 00156 void InsertRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00157 00159 void InsertRegionBorder(RegionBorderVectorIterator it, 00160 KLMSegmentationBorder *pBorderCandidate); 00161 00163 void DeleteRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00164 00166 void DeleteAllRegionBorders(); 00167 00170 void CombineRegionParameters(const Self *region); 00171 00174 double EnergyFunctional(const Self *region); 00175 00178 void ResetRegionLabelAndUpdateBorders(Self *region); 00179 00206 void SpliceRegionBorders(Self *region); 00207 00210 void UpdateRegionBorderLambda(); 00211 00212 protected: 00213 KLMSegmentationRegion(); 00214 ~KLMSegmentationRegion(); 00215 void PrintSelf(std::ostream& os, Indent indent) const; 00216 00217 private: 00218 KLMSegmentationRegion(const Self&); // purposely not implemented 00219 void operator=(const Self&); // purposely not implemented 00220 00221 RegionBorderVectorType m_RegionBorderVector; 00222 MeanRegionIntensityType m_MeanRegionIntensity; 00223 00224 }; // class SegmentationRegion 00225 00226 00227 } // namespace itk 00228 00229 00230 #endif