ITK  5.2.0
Insight Toolkit
itkDanielssonDistanceMapImageFilter.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 itkDanielssonDistanceMapImageFilter_h
19 #define itkDanielssonDistanceMapImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
58 template <typename TInputImage, typename TOutputImage, typename TVoronoiImage = TInputImage>
59 class ITK_TEMPLATE_EXPORT DanielssonDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_MOVE(DanielssonDistanceMapImageFilter);
63 
69 
71 
73  itkNewMacro(Self);
74 
77 
79  using InputImageType = TInputImage;
80 
82  using InputPixelType = typename InputImageType::PixelType;
83 
86 
88  using IndexType = typename RegionType::IndexType;
89 
91  using OffsetType = typename InputImageType::OffsetType;
92 
94  using SpacingType = typename InputImageType::SpacingType;
95  using SpacingValueType = typename InputImageType::SpacingValueType;
96 
98  using SizeType = typename RegionType::SizeType;
99 
102 
105  using OutputImageType = TOutputImage;
106 
108  using OutputPixelType = typename OutputImageType::PixelType;
109 
110  using VoronoiImageType = TVoronoiImage;
111  using VoronoiImagePointer = typename VoronoiImageType::Pointer;
112  using VoronoiPixelType = typename VoronoiImageType::PixelType;
113 
115  static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
116 
119 
121  using InputImagePointer = typename InputImageType::ConstPointer;
122 
124  using OutputImagePointer = typename OutputImageType::Pointer;
125 
128 
130  itkSetMacro(SquaredDistance, bool);
131 
133  itkGetConstReferenceMacro(SquaredDistance, bool);
134 
136  itkBooleanMacro(SquaredDistance);
137 
143  itkSetMacro(InputIsBinary, bool);
144 
146  itkGetConstReferenceMacro(InputIsBinary, bool);
147 
149  itkBooleanMacro(InputIsBinary);
150 
152  itkSetMacro(UseImageSpacing, bool);
153 
155  itkGetConstReferenceMacro(UseImageSpacing, bool);
156 
158  itkBooleanMacro(UseImageSpacing);
159 
166  GetVoronoiMap();
167 
177  GetDistanceMap();
178 
181  GetVectorDistanceMap();
182 
185  using Superclass::MakeOutput;
187  MakeOutput(DataObjectPointerArraySizeType idx) override;
188 
189 #ifdef ITK_USE_CONCEPT_CHECKING
190  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
191  static constexpr unsigned int VoronoiImageDimension = TVoronoiImage::ImageDimension;
192 
193  // Begin concept checking
196  itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, OutputPixelType>));
198  // End concept checking
199 #endif
200 
201 protected:
203  ~DanielssonDistanceMapImageFilter() override = default;
204  void
205  PrintSelf(std::ostream & os, Indent indent) const override;
206 
208  void
209  GenerateData() override;
210 
212  void
213  PrepareData();
214 
216  void
217  ComputeVoronoiMap();
218 
220  void
221  UpdateLocalDistance(VectorImageType *, const IndexType &, const OffsetType &);
222 
223 private:
227 
229 
230 }; // end of DanielssonDistanceMapImageFilter class
231 } // end namespace itk
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 # include "itkDanielssonDistanceMapImageFilter.hxx"
235 #endif
236 
237 #endif
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::VoronoiImagePointer
typename VoronoiImageType::Pointer VoronoiImagePointer
Definition: itkDanielssonDistanceMapImageFilter.h:111
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::VectorImagePointer
typename VectorImageType::Pointer VectorImagePointer
Definition: itkDanielssonDistanceMapImageFilter.h:127
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::SpacingValueType
typename InputImageType::SpacingValueType SpacingValueType
Definition: itkDanielssonDistanceMapImageFilter.h:95
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::VoronoiPixelType
typename VoronoiImageType::PixelType VoronoiPixelType
Definition: itkDanielssonDistanceMapImageFilter.h:112
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::IndexType
typename RegionType::IndexType IndexType
Definition: itkDanielssonDistanceMapImageFilter.h:88
itk::ImageSource< ImageType >::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::DanielssonDistanceMapImageFilter::m_SquaredDistance
bool m_SquaredDistance
Definition: itkDanielssonDistanceMapImageFilter.h:224
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:193
itkImageRegionIteratorWithIndex.h
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkDanielssonDistanceMapImageFilter.h:108
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::DanielssonDistanceMapImageFilter
This filter computes the distance map of the input image as an approximation with pixel accuracy to t...
Definition: itkDanielssonDistanceMapImageFilter.h:59
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkDanielssonDistanceMapImageFilter.h:82
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::VoronoiImageType
ImageType VoronoiImageType
Definition: itkDanielssonDistanceMapImageFilter.h:110
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ImageToImageFilter< ImageType, ImageType >::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter< ImageType, ImageType >::InputImageType
ImageType InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::DanielssonDistanceMapImageFilter::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkDanielssonDistanceMapImageFilter.h:226
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::OffsetType
typename InputImageType::OffsetType OffsetType
Definition: itkDanielssonDistanceMapImageFilter.h:91
itk::DanielssonDistanceMapImageFilter::m_InputIsBinary
bool m_InputIsBinary
Definition: itkDanielssonDistanceMapImageFilter.h:225
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::DanielssonDistanceMapImageFilter< ImageType, ImageType >::SizeType
typename RegionType::SizeType SizeType
Definition: itkDanielssonDistanceMapImageFilter.h:98
itk::DanielssonDistanceMapImageFilter::m_InputSpacingCache
SpacingType m_InputSpacingCache
Definition: itkDanielssonDistanceMapImageFilter.h:228
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::SizeValueType
typename SizeType::SizeValueType SizeValueType
Definition: itkDanielssonDistanceMapImageFilter.h:101
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::SpacingType
typename InputImageType::SpacingType SpacingType
Definition: itkDanielssonDistanceMapImageFilter.h:94
itk::ImageSource< ImageType >::OutputImageType
ImageType OutputImageType
Definition: itkImageSource.h:90
itk::DanielssonDistanceMapImageFilter< ImageType, ImageType >::RegionType
typename InputImageType::RegionType RegionType
Definition: itkDanielssonDistanceMapImageFilter.h:85