ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMorphologicalSignedDistanceTransformImageFilter.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 itkMorphologicalSignedDistanceTransformImageFilter_h
19 #define itkMorphologicalSignedDistanceTransformImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkProgressReporter.h"
23 
28 
29 namespace itk
30 {
70 template< typename TInputImage, typename TOutputImage = TInputImage >
72  public ImageToImageFilter< TInputImage,
73  TOutputImage >
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_ASSIGN(MorphologicalSignedDistanceTransformImageFilter);
77 
83 
85  itkNewMacro(Self);
86 
89 
91  using InputImageType = TInputImage;
92  using OutputImageType = TOutputImage;
93  using InputPixelType = typename TInputImage::PixelType;
96  using OutputPixelType = typename TOutputImage::PixelType;
97 
99  using InputImagePointer = typename TInputImage::Pointer;
100  using InputImageConstPointer = typename TInputImage::ConstPointer;
101 
103  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
104  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
105  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
106 
109 
110  virtual void Modified() const;
111 
115  itkSetMacro(OutsideValue, InputPixelType);
116  itkGetConstReferenceMacro(OutsideValue, InputPixelType);
118 
120  itkBooleanMacro(UseImageSpacing);
121 
124  itkSetMacro(InsideIsPositive, bool);
125 
128  itkGetConstReferenceMacro(InsideIsPositive, bool);
129 
133  itkBooleanMacro(InsideIsPositive);
134 
136  void SetUseImageSpacing(bool uis)
137  {
138  m_Erode->SetUseImageSpacing(uis);
139  m_Dilate->SetUseImageSpacing(uis);
140  this->Modified();
141  }
143 
145  NOCHOICE = 0, // decices based on scale - experimental
146  CONTACTPOINT = 1, // sometimes faster at low scale
147  INTERSECTION = 2 // default
148  };
149 
157  itkSetMacro(ParabolicAlgorithm, int);
158  itkGetConstReferenceMacro(ParabolicAlgorithm, int);
159 
160  const bool & GetUseImageSpacing()
161  {
162  return m_Erode->GetUseImageSpacing();
163  }
164 
165 #ifdef ITK_USE_CONCEPT_CHECKING
166 
167  itkConceptMacro( SameDimension,
168  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
169  itkGetStaticConstMacro(OutputImageDimension) > ) );
170 
171  itkConceptMacro( Comparable,
173 
175 #endif
176 protected:
179  void PrintSelf(std::ostream & os, Indent indent) const;
181 
183  void GenerateData(void);
184 
186 
187  // do everything in the output image type, which should have high precision
192 private:
195  typename ErodeType::Pointer m_Erode;
196  typename DilateType::Pointer m_Dilate;
197  typename ThreshType::Pointer m_Thresh;
198  typename HelperType::Pointer m_Helper;
199 };
200 } // namespace itk
201 #ifndef ITK_MANUAL_INSTANTIATION
202 #include "itkMorphologicalSignedDistanceTransformImageFilter.hxx"
203 #endif
204 
205 #endif
typename itk::ParabolicDilateImageFilter< OutputImageType, OutputImageType > DilateType
Define numeric traits for std::vector.
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
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.
Signed distance transform of a mask using parabolic morphological methods.
Base class for all process objects that output image data.
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
Binarize an input image by thresholding.
typename InputImageType::Pointer InputImagePointer
Implements a pixel-wise operator to form a signed distance transform.
Class for morphological dilation operations with parabolic structuring elements.
TOutputImage OutputImageType
typename itk::BinaryThresholdImageFilter< InputImageType, OutputImageType > ThreshType
typename itk::MorphSDTHelperImageFilter< OutputImageType, OutputImageType > HelperType
typename itk::ParabolicErodeImageFilter< OutputImageType, OutputImageType > ErodeType
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
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer