ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVoronoiPartitioningImageFilter.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 itkVoronoiPartitioningImageFilter_h
19 #define itkVoronoiPartitioningImageFilter_h
20 
22 
23 namespace itk
24 {
32 template< typename TInputImage, typename TOutputImage >
33 class ITK_TEMPLATE_EXPORT VoronoiPartitioningImageFilter:
34  public VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage >
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_ASSIGN(VoronoiPartitioningImageFilter);
38 
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(VoronoiPartitioningImageFilter,
51 
53  using BinaryObjectImage = typename Superclass::BinaryObjectImage;
54  using IndexList = typename Superclass::IndexList;
55  using IndexType = typename Superclass::IndexType;
57  using InputImageType = typename Superclass::InputImageType;
58  using OutputImageType = typename Superclass::OutputImageType;
59  using OutputPixelType = typename Superclass::OutputPixelType;
60 
61  using PointType = typename Superclass::PointType;
62  using PointTypeDeque = typename Superclass::PointTypeDeque;
63  using PointIdIterator = typename Superclass::PointIdIterator;
64  using CellAutoPointer = typename Superclass::CellAutoPointer;
65  using EdgeIterator = typename Superclass::EdgeIterator;
66  using NeighborIdIterator = typename Superclass::NeighborIdIterator;
67 
69  void MakeSegmentBoundary() override;
70 
71  void MakeSegmentObject() override;
72 
77  itkSetMacro(SigmaThreshold, double);
78  itkGetConstMacro(SigmaThreshold, double);
80 
82  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
83  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
84 
85 #ifdef ITK_USE_CONCEPT_CHECKING
86  // Begin concept checking
87  itkConceptMacro( SameDimensionCheck,
89  itkConceptMacro( IntConvertibleToOutputCheck,
91  // End concept checking
92 #endif
93 
94 protected:
96  ~VoronoiPartitioningImageFilter() override = default;
97  void PrintSelf(std::ostream & os, Indent indent) const override;
98 
99  // Classify all the voronoi cells as interior , exterior or boundary.
100  void ClassifyDiagram() override;
101 
102  // Generate the seeds to be added by dividing the boundary cells.
103  void GenerateAddingSeeds() override;
104 
105  // Are the pixels specified in the index list homogeneous?
106  bool TestHomogeneity(IndexList & Plist) override;
107 
108  // Threshold for homogeneity criterion
109  double m_SigmaThreshold{10};
110 };
111 } //end namespace
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkVoronoiPartitioningImageFilter.hxx"
115 #endif
116 
117 #endif
Base class for VoronoiSegmentationImageFilter.
typename Superclass::OutputPixelType OutputPixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename Superclass::NeighborIdIterator NeighborIdIterator
Base class for all process objects that output image data.
typename Superclass::EdgeIterator EdgeIterator
typename Superclass::PointTypeDeque PointTypeDeque
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::CellAutoPointer CellAutoPointer
#define itkConceptMacro(name, concept)
typename Superclass::BinaryObjectImage BinaryObjectImage
typename Superclass::PointIdIterator PointIdIterator