ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkKLMSegmentationRegion.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkKLMSegmentationRegion_h
19 #define itkKLMSegmentationRegion_h
20 
22 #include "itkSegmentationRegion.h"
23 #include "ITKKLMRegionGrowingExport.h"
24 
25 #include "vnl/vnl_vector.h"
26 
27 namespace itk
28 {
89 // Forward reference because of circular dependencies
90 class ITK_FORWARD_EXPORT KLMSegmentationBorder;
91 
92 class ITKKLMRegionGrowing_EXPORT KLMSegmentationRegion:public SegmentationRegion
93 {
94 public:
95  ITK_DISALLOW_COPY_AND_ASSIGN(KLMSegmentationRegion);
96 
102 
104  itkNewMacro(Self);
105 
108 
110  using MeanRegionIntensityType = vnl_vector< double >;
111 
114  using RegionBorderVectorType = std::vector< KLMSegmentationBorder * >;
115  using RegionBorderVectorSizeType = RegionBorderVectorType::size_type;
116 
118  using RegionBorderVectorIterator = RegionBorderVectorType::iterator;
119 
122  using RegionBorderVectorConstIterator = RegionBorderVectorType::const_iterator;
123 
125  using RegionLabelType = Superclass::RegionLabelType;
126 
129  RegionBorderVectorIterator GetRegionBorderItBegin();
130 
131  RegionBorderVectorConstIterator GetRegionBorderConstItBegin();
132 
135  RegionBorderVectorIterator GetRegionBorderItEnd();
136 
137  RegionBorderVectorConstIterator GetRegionBorderConstItEnd();
138 
141  RegionBorderVectorSizeType GetRegionBorderSize() const;
142 
144  itkSetMacro(MeanRegionIntensity, MeanRegionIntensityType)
145  itkGetConstReferenceMacro(MeanRegionIntensity, MeanRegionIntensityType);
146 
149  void SetRegionParameters(MeanRegionIntensityType meanRegionIntensity,
150  double regionArea,
151  RegionLabelType label);
152 
154  void PrintRegionInfo();
155 
157  void PushFrontRegionBorder(KLMSegmentationBorder *pBorderCandidate);
158 
160  void PushBackRegionBorder(KLMSegmentationBorder *pBorderCandidate);
161 
164  void InsertRegionBorder(KLMSegmentationBorder *pBorderCandidate);
165 
167  void InsertRegionBorder(RegionBorderVectorIterator it,
168  KLMSegmentationBorder *pBorderCandidate);
169 
171  void DeleteRegionBorder(KLMSegmentationBorder *pBorderCandidate);
172 
174  void DeleteAllRegionBorders();
175 
178  void CombineRegionParameters(const Self *region);
179 
182  double EnergyFunctional(const Self *region);
183 
186  void ResetRegionLabelAndUpdateBorders(Self *region);
187 
214  void SpliceRegionBorders(Self *region);
216 
219  void UpdateRegionBorderLambda();
220 
221 protected:
223  ~KLMSegmentationRegion() override;
224  void PrintSelf(std::ostream & os, Indent indent) const override;
225 
226 private:
227  RegionBorderVectorType m_RegionBorderVector;
228  MeanRegionIntensityType m_MeanRegionIntensity;
229 }; // class SegmentationRegion
230 } // namespace itk
231 
232 #endif
Base class for KLMSegmentationRegion object.
Light weight base class for most itk classes.
Base class for SegmentationRegion object.
RegionBorderVectorType::size_type RegionBorderVectorSizeType
RegionBorderVectorType::const_iterator RegionBorderVectorConstIterator
class ITK_FORWARD_EXPORT KLMSegmentationRegion
vnl_vector< double > MeanRegionIntensityType
Base class for KLMSegmentationBorder object.
RegionBorderVectorType::iterator RegionBorderVectorIterator
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::RegionLabelType RegionLabelType
std::vector< KLMSegmentationBorder * > RegionBorderVectorType