ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMorphologicalDistanceTransformImageFilter.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 itkMorphologicalDistanceTransformImageFilter_h
19 #define itkMorphologicalDistanceTransformImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkProgressReporter.h"
23 
26 #include "itkSqrtImageFilter.h"
27 
28 namespace itk
29 {
58 template< typename TInputImage, typename TOutputImage = TInputImage >
60  public ImageToImageFilter< TInputImage,
61  TOutputImage >
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_ASSIGN(MorphologicalDistanceTransformImageFilter);
65 
71 
73  itkNewMacro(Self);
74 
77 
79  using InputImageType = TInputImage;
80  using OutputImageType = TOutputImage;
81  using InputPixelType = typename TInputImage::PixelType;
84  using OutputPixelType = typename TOutputImage::PixelType;
85 
87  using InputImagePointer = typename TInputImage::Pointer;
88  using InputImageConstPointer = typename TInputImage::ConstPointer;
89 
91  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
92  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
93  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
94 
97  void Modified() const override;
98 
102  itkSetMacro(OutsideValue, InputPixelType);
103  itkGetConstReferenceMacro(OutsideValue, InputPixelType);
105 
107  void SetUseImageSpacing(bool uis)
108  {
109  m_Erode->SetUseImageSpacing(uis);
110  }
111 
112  const bool & GetUseImageSpacing()
113  {
114  return m_Erode->GetUseImageSpacing();
115  }
116 
117  itkSetMacro(SqrDist, bool);
118  itkGetConstReferenceMacro(SqrDist, bool);
119  itkBooleanMacro(SqrDist);
120 
121 #ifdef ITK_USE_CONCEPT_CHECKING
122 
123  itkConceptMacro( SameDimension,
124  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
125  itkGetStaticConstMacro(OutputImageDimension) > ) );
126 
127  itkConceptMacro( Comparable,
129 
131 #endif
132 protected:
135  void PrintSelf(std::ostream & os, Indent indent) const override;
137 
139  void GenerateData(void) override;
140 
141  // do everything in the output image type, which should have high precision
145 private:
147  typename ErodeType::Pointer m_Erode;
148  typename ThreshType::Pointer m_Thresh;
149  typename SqrtType::Pointer m_Sqrt;
150  bool m_SqrDist;
151 };
152 } // namespace itk
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkMorphologicalDistanceTransformImageFilter.hxx"
155 #endif
156 
157 #endif
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
typename itk::ParabolicErodeImageFilter< OutputImageType, OutputImageType > ErodeType
Define numeric traits for std::vector.
typename NumericTraits< InputPixelType >::RealType RealType
Distance transform of a mask using parabolic morphological methods.
Computes the square root of each pixel.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Class for morphological erosion operations with parabolic structuring elements.
Base class for all process objects that output image data.
typename itk::BinaryThresholdImageFilter< InputImageType, OutputImageType > ThreshType
Binarize an input image by thresholding.
typename InputImageType::Pointer InputImagePointer
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
typename itk::SqrtImageFilter< OutputImageType, OutputImageType > SqrtType