ITK  6.0.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  * https://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 
49  itkOverrideGetNameOfClassMacro(VoronoiPartitioningImageFilter);
50 
52  using typename Superclass::BinaryObjectImage;
53  using typename Superclass::IndexList;
54  using typename Superclass::IndexType;
55  using typename Superclass::RegionType;
56  using typename Superclass::InputImageType;
57  using typename Superclass::OutputImageType;
58  using typename Superclass::OutputPixelType;
59 
60  using typename Superclass::PointType;
61  using typename Superclass::PointTypeDeque;
62  using typename Superclass::PointIdIterator;
63  using typename Superclass::CellAutoPointer;
64  using typename Superclass::EdgeIterator;
65  using typename Superclass::NeighborIdIterator;
66 
68  void
69  MakeSegmentBoundary() override;
70 
71  void
72  MakeSegmentObject() override;
73 
78  itkSetMacro(SigmaThreshold, double);
79  itkGetConstMacro(SigmaThreshold, double);
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
itkVoronoiSegmentationImageFilterBase.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Concept::SameDimension
Definition: itkConceptChecking.h:696
itk::VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage >::IndexList
std::vector< IndexType > IndexList
Definition: itkVoronoiSegmentationImageFilterBase.h:107
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
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::VoronoiPartitioningImageFilter
Definition: itkVoronoiPartitioningImageFilter.h:33
itk::Concept::Convertible
Definition: itkConceptChecking.h:216