ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkParabolicErodeDilateImageFilter.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 itkParabolicErodeDilateImageFilter_h
19 #define itkParabolicErodeDilateImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkProgressReporter.h"
24 
25 namespace itk
26 {
82 template< typename TInputImage,
83  bool doDilate,
84  typename TOutputImage = TInputImage >
86  public ImageToImageFilter< TInputImage, TOutputImage >
87 {
88 public:
89  ITK_DISALLOW_COPY_AND_ASSIGN(ParabolicErodeDilateImageFilter);
90 
96 
98  itkNewMacro(Self);
99 
102 
104  using InputImageType = TInputImage;
105  using OutputImageType = TOutputImage;
106  using PixelType = typename TInputImage::PixelType;
109  using OutputPixelType = typename TOutputImage::PixelType;
110 
112  using InputImagePointer = typename TInputImage::Pointer;
113  using InputImageConstPointer = typename TInputImage::ConstPointer;
116 
118 
121 
123  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
124  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
125  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
126 
133  //using RealImageType = typename Image<InternalRealType,
134  // itkGetStaticConstMacro(ImageDimension) >;
135 
136  // set all of the scales the same
137  void SetScale(ScalarRealType scale);
138 
139  itkSetMacro(Scale, RadiusType);
140  itkGetConstReferenceMacro(Scale, RadiusType);
141 
143  NOCHOICE = 0, // decices based on scale - experimental
144  CONTACTPOINT = 1, // sometimes faster at low scale
145  INTERSECTION = 2 // default
146  };
153  itkSetMacro(ParabolicAlgorithm, int);
154  itkGetConstReferenceMacro(ParabolicAlgorithm, int);
155 
160  itkSetMacro(UseImageSpacing, bool);
161  itkGetConstReferenceMacro(UseImageSpacing, bool);
162  itkBooleanMacro(UseImageSpacing);
163 
166 #ifdef ITK_USE_CONCEPT_CHECKING
167 
168  itkConceptMacro( SameDimension,
169  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
170  itkGetStaticConstMacro(OutputImageDimension) > ) );
171 
172  itkConceptMacro( Comparable,
174 
176 #endif
177 protected:
180  void PrintSelf(std::ostream & os, Indent indent) const override;
182 
184  void GenerateData(void) override;
185 
186  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
187  OutputImageRegionType & splitRegion) override;
188 
189  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
190 
191  void GenerateInputRequestedRegion() throw( InvalidRequestedRegionError ) override;
192 
193  // Override since the filter produces the entire dataset.
194  void EnlargeOutputRequestedRegion(DataObject *output) override;
195 
196  bool m_UseImageSpacing;
197  int m_ParabolicAlgorithm;
198 private:
199  RadiusType m_Scale;
200 
201  typename TInputImage::PixelType m_Extreme;
202 
203  int m_MagnitudeSign;
204  int m_CurrentDimension;
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkParabolicErodeDilateImageFilter.hxx"
210 #endif
211 
212 #endif
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
Parent class for morphological operations with parabolic structuring elements.
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
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
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.