ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkParabolicOpenCloseImageFilter.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 itkParabolicOpenCloseImageFilter_h
19 #define itkParabolicOpenCloseImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkProgressReporter.h"
24 
25 namespace itk
26 {
52 template< typename TInputImage,
53  bool doOpen,
54  typename TOutputImage = TInputImage >
56  public ImageToImageFilter< TInputImage, TOutputImage >
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_ASSIGN(ParabolicOpenCloseImageFilter);
60 
66 
68  itkNewMacro(Self);
69 
72 
74  using InputImageType = TInputImage;
75  using OutputImageType = TOutputImage;
76  using PixelType = typename TInputImage::PixelType;
79  using OutputPixelType = typename TOutputImage::PixelType;
83 
85  using InputImagePointer = typename TInputImage::Pointer;
86  using InputImageConstPointer = typename TInputImage::ConstPointer;
87 
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 
103  //using RealImageType = typename Image<InternalRealType,
104  // itkGetStaticConstMacro(ImageDimension) >;
105 
106  // set all of the scales the same
107  void SetScale(ScalarRealType scale);
108 
109  itkSetMacro(Scale, RadiusType);
110  itkGetConstReferenceMacro(Scale, RadiusType);
115  itkSetMacro(UseImageSpacing, bool);
116  itkGetConstReferenceMacro(UseImageSpacing, bool);
117  itkBooleanMacro(UseImageSpacing);
119 
121  NOCHOICE = 0, // decices based on scale - experimental
122  CONTACTPOINT = 1, // sometimes faster at low scale
123  INTERSECTION = 2 // default
124  };
131  itkSetMacro(ParabolicAlgorithm, int);
132  itkGetConstReferenceMacro(ParabolicAlgorithm, int);
133 
134 #ifdef ITK_USE_CONCEPT_CHECKING
135 
136  itkConceptMacro( SameDimension,
137  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
138  itkGetStaticConstMacro(OutputImageDimension) > ) );
139 
140  itkConceptMacro( Comparable,
142 
144 #endif
145 protected:
148  void PrintSelf(std::ostream & os, Indent indent) const override;
150 
152  void GenerateData(void) override;
153 
154  unsigned int SplitRequestedRegion(unsigned int i, unsigned int num,
155  OutputImageRegionType & splitRegion) override;
156 
157  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
158 
159  void GenerateInputRequestedRegion() throw( InvalidRequestedRegionError ) override;
160 
161  // Override since the filter produces the entire dataset.
162  void EnlargeOutputRequestedRegion(DataObject *output) override;
163 
164  int m_ParabolicAlgorithm;
165 private:
166  RadiusType m_Scale;
167 
168  typename TInputImage::PixelType m_Extreme;
169  typename TInputImage::PixelType m_Extreme1;
170  typename TInputImage::PixelType m_Extreme2;
171 
172  int m_MagnitudeSign;
173  int m_MagnitudeSign1;
174  int m_MagnitudeSign2;
175  int m_CurrentDimension;
176  int m_Stage;
177  bool m_UseImageSpacing;
178 };
179 } // end namespace itk
180 
181 #ifndef ITK_MANUAL_INSTANTIATION
182 #include "itkParabolicOpenCloseImageFilter.hxx"
183 #endif
184 
185 #endif
typename OutputImageType::IndexType OutputIndexType
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 TOutputImage::SizeType OutputSizeType
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
typename InputImageType::Pointer InputImagePointer
typename NumericTraits< PixelType >::FloatType InternalRealType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename TOutputImage::PixelType OutputPixelType
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< PixelType >::RealType RealType
#define itkConceptMacro(name, concept)
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
typename InputImageType::ConstPointer InputImageConstPointer
Parent class for morphological opening and closing operations with parabolic structuring elements...
Base class for all data objects in ITK.