ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkKLMSegmentationRegion_h 00019 #define __itkKLMSegmentationRegion_h 00020 00021 #include "itkKLMSegmentationBorder.h" 00022 #include "itkSegmentationRegion.h" 00023 00024 #include "vnl/vnl_vector.h" 00025 00026 namespace itk 00027 { 00087 class KLMSegmentationBorder; 00088 00089 class ITK_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 00117 typedef RegionBorderVectorType::const_iterator RegionBorderVectorConstIterator; 00118 00120 typedef Superclass::RegionLabelType RegionLabelType; 00121 00124 RegionBorderVectorIterator GetRegionBorderItBegin(); 00125 00126 RegionBorderVectorConstIterator GetRegionBorderConstItBegin(); 00127 00130 RegionBorderVectorIterator GetRegionBorderItEnd(); 00131 00132 RegionBorderVectorConstIterator GetRegionBorderConstItEnd(); 00133 00136 RegionBorderVectorSizeType GetRegionBorderSize() const; 00137 00139 itkSetMacro(MeanRegionIntensity, MeanRegionIntensityType) 00140 itkGetConstReferenceMacro(MeanRegionIntensity, MeanRegionIntensityType); 00141 00144 void SetRegionParameters(MeanRegionIntensityType meanRegionIntensity, 00145 double regionArea, 00146 RegionLabelType label); 00147 00149 void PrintRegionInfo(); 00150 00152 void PushFrontRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00153 00155 void PushBackRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00156 00159 void InsertRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00160 00162 void InsertRegionBorder(RegionBorderVectorIterator it, 00163 KLMSegmentationBorder *pBorderCandidate); 00164 00166 void DeleteRegionBorder(KLMSegmentationBorder *pBorderCandidate); 00167 00169 void DeleteAllRegionBorders(); 00170 00173 void CombineRegionParameters(const Self *region); 00174 00177 double EnergyFunctional(const Self *region); 00178 00181 void ResetRegionLabelAndUpdateBorders(Self *region); 00182 00209 void SpliceRegionBorders(Self *region); 00211 00214 void UpdateRegionBorderLambda(); 00215 00216 protected: 00217 KLMSegmentationRegion(); 00218 ~KLMSegmentationRegion(); 00219 void PrintSelf(std::ostream & os, Indent indent) const; 00220 00221 private: 00222 KLMSegmentationRegion(const Self &); // purposely not implemented 00223 void operator=(const Self &); // purposely not implemented 00224 00225 RegionBorderVectorType m_RegionBorderVector; 00226 MeanRegionIntensityType m_MeanRegionIntensity; 00227 }; // class SegmentationRegion 00228 } // namespace itk 00229 00230 #endif 00231