ITK  5.2.0
Insight Toolkit
itkVoronoiPartitioningImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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_MOVE(VoronoiPartitioningImageFilter);
38 
44 
46  itkNewMacro(Self);
47 
50 
52  using BinaryObjectImage = typename Superclass::BinaryObjectImage;
53  using IndexList = typename Superclass::IndexList;
54  using IndexType = typename Superclass::IndexType;
56  using InputImageType = typename Superclass::InputImageType;
57  using OutputImageType = typename Superclass::OutputImageType;
58  using OutputPixelType = typename Superclass::OutputPixelType;
59 
60  using PointType = typename Superclass::PointType;
61  using PointTypeDeque = typename Superclass::PointTypeDeque;
62  using PointIdIterator = typename Superclass::PointIdIterator;
63  using CellAutoPointer = typename Superclass::CellAutoPointer;
64  using EdgeIterator = typename Superclass::EdgeIterator;
65  using NeighborIdIterator = typename Superclass::NeighborIdIterator;
66 
68  void
69  MakeSegmentBoundary() override;
70 
71  void
72  MakeSegmentObject() override;
73 
78  itkSetMacro(SigmaThreshold, double);
79  itkGetConstMacro(SigmaThreshold, double);
81 
83  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
84  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
85 
86 #ifdef ITK_USE_CONCEPT_CHECKING
87  // Begin concept checking
89  itkConceptMacro(IntConvertibleToOutputCheck, (Concept::Convertible<int, OutputPixelType>));
90  // End concept checking
91 #endif
92 
93 protected:
95  ~VoronoiPartitioningImageFilter() override = default;
96  void
97  PrintSelf(std::ostream & os, Indent indent) const override;
98 
99  // Classify all the voronoi cells as interior , exterior or boundary.
100  void
101  ClassifyDiagram() override;
102 
103  // Generate the seeds to be added by dividing the boundary cells.
104  void
105  GenerateAddingSeeds() override;
106 
107  // Are the pixels specified in the index list homogeneous?
108  bool
109  TestHomogeneity(IndexList & Plist) override;
110 
111  // Threshold for homogeneity criterion
112  double m_SigmaThreshold{ 10 };
113 };
114 } // namespace itk
115 
116 #ifndef ITK_MANUAL_INSTANTIATION
117 # include "itkVoronoiPartitioningImageFilter.hxx"
118 #endif
119 
120 #endif
itk::VoronoiPartitioningImageFilter::OutputPixelType
typename Superclass::OutputPixelType OutputPixelType
Definition: itkVoronoiPartitioningImageFilter.h:58
itkVoronoiSegmentationImageFilterBase.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::VoronoiPartitioningImageFilter::IndexType
typename Superclass::IndexType IndexType
Definition: itkVoronoiPartitioningImageFilter.h:54
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::VoronoiPartitioningImageFilter::CellAutoPointer
typename Superclass::CellAutoPointer CellAutoPointer
Definition: itkVoronoiPartitioningImageFilter.h:63
itk::VoronoiPartitioningImageFilter::EdgeIterator
typename Superclass::EdgeIterator EdgeIterator
Definition: itkVoronoiPartitioningImageFilter.h:64
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::VoronoiSegmentationImageFilterBase
Base class for VoronoiSegmentationImageFilter.
Definition: itkVoronoiSegmentationImageFilterBase.h:59
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::VoronoiPartitioningImageFilter::PointTypeDeque
typename Superclass::PointTypeDeque PointTypeDeque
Definition: itkVoronoiPartitioningImageFilter.h:61
itk::VoronoiPartitioningImageFilter::IndexList
typename Superclass::IndexList IndexList
Definition: itkVoronoiPartitioningImageFilter.h:53
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::VoronoiPartitioningImageFilter
Definition: itkVoronoiPartitioningImageFilter.h:33
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::VoronoiPartitioningImageFilter::PointIdIterator
typename Superclass::PointIdIterator PointIdIterator
Definition: itkVoronoiPartitioningImageFilter.h:62
itk::VoronoiPartitioningImageFilter::RegionType
typename Superclass::RegionType RegionType
Definition: itkVoronoiPartitioningImageFilter.h:55
itk::VoronoiPartitioningImageFilter::PointType
typename Superclass::PointType PointType
Definition: itkVoronoiPartitioningImageFilter.h:60
itk::VoronoiPartitioningImageFilter::NeighborIdIterator
typename Superclass::NeighborIdIterator NeighborIdIterator
Definition: itkVoronoiPartitioningImageFilter.h:65
itk::VoronoiPartitioningImageFilter::BinaryObjectImage
typename Superclass::BinaryObjectImage BinaryObjectImage
Definition: itkVoronoiPartitioningImageFilter.h:52
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90