ITK  5.4.0
Insight Toolkit
itkGradientMagnitudeRecursiveGaussianImageFilter.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  * https://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 itkGradientMagnitudeRecursiveGaussianImageFilter_h
19 #define itkGradientMagnitudeRecursiveGaussianImageFilter_h
20 
22 #include "itkImage.h"
23 #include "itkPixelTraits.h"
25 #include "itkSqrtImageFilter.h"
27 
28 namespace itk
29 {
46 // NOTE that the typename macro has to be used here in lieu
47 // of "typename" because VC++ doesn't like the typename keyword
48 // on the defaults of template parameters
49 template <typename TInputImage, typename TOutputImage = TInputImage>
51  : public InPlaceImageFilter<TInputImage, TOutputImage>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_MOVE(GradientMagnitudeRecursiveGaussianImageFilter);
55 
61 
63  using InputImageType = TInputImage;
64  using PixelType = typename InputImageType::PixelType;
65 
67  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
68 
70 
75  using InternalRealType = float;
77 
80 
83 
86 
89 
92 
94 
97 
99  using OutputImageType = TOutputImage;
100  using OutputPixelType = typename OutputImageType::PixelType;
101 
106 
108  itkNewMacro(Self);
109 
111  itkOverrideGetNameOfClassMacro(GradientMagnitudeRecursiveGaussianImageFilter);
112 
114  void
115  SetSigma(RealType sigma);
116  RealType
117  GetSigma();
124  void
125  SetNormalizeAcrossScale(bool normalize);
126  itkGetConstMacro(NormalizeAcrossScale, bool);
127  itkBooleanMacro(NormalizeAcrossScale);
130  void
131  SetNumberOfWorkUnits(ThreadIdType nb) override;
132 
133 #ifdef ITK_USE_CONCEPT_CHECKING
134  // Begin concept checking
135  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
136  // End concept checking
137 #endif
138 
139 protected:
141  ~GradientMagnitudeRecursiveGaussianImageFilter() override = default;
142  void
143  PrintSelf(std::ostream & os, Indent indent) const override;
144 
146  void
147  GenerateData() override;
148 
155  void
156  GenerateInputRequestedRegion() override;
157 
161  void
162  EnlargeOutputRequestedRegion(DataObject * output) override;
163 
164 private:
167 
168  GaussianFilterPointer m_SmoothingFilters[ImageDimension - 1]{};
169  DerivativeFilterPointer m_DerivativeFilter{};
170  SqrSpacingFilterPointer m_SqrSpacingFilter{};
171  SqrtFilterPointer m_SqrtFilter{};
172 
174  bool m_NormalizeAcrossScale{};
175 };
176 } // end namespace itk
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
179 # include "itkGradientMagnitudeRecursiveGaussianImageFilter.hxx"
180 #endif
181 
182 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkRecursiveGaussianImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itkNthElementImageAdaptor.h
itk::InPlaceImageFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkInPlaceImageFilter.h:77
itk::GradientMagnitudeRecursiveGaussianImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:100
itk::GradientMagnitudeRecursiveGaussianImageFilter::RealType
typename NumericTraits< PixelType >::RealType RealType
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:69
itkImage.h
itk::BinaryGeneratorImageFilter
Implements pixel-wise generic operation of two images, or of an image and a constant.
Definition: itkBinaryGeneratorImageFilter.h:56
itkSqrtImageFilter.h
itkPixelTraits.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::SqrtImageFilter
Computes the square root of each pixel.
Definition: itkSqrtImageFilter.h:64
itkBinaryGeneratorImageFilter.h
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GradientMagnitudeRecursiveGaussianImageFilter::DerivativeFilterPointer
typename DerivativeFilterType::Pointer DerivativeFilterPointer
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:91
itk::GradientMagnitudeRecursiveGaussianImageFilter::SqrSpacingFilterPointer
typename SqrSpacingFilterType::Pointer SqrSpacingFilterPointer
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:166
itk::GradientMagnitudeRecursiveGaussianImageFilter
Computes the Magnitude of the Gradient of an image by convolution with the first derivative of a Gaus...
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:50
itk::GradientMagnitudeRecursiveGaussianImageFilter::SqrtFilterPointer
typename SqrtFilterType::Pointer SqrtFilterPointer
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:93
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::GradientMagnitudeRecursiveGaussianImageFilter::InternalRealType
float InternalRealType
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:75
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::GradientMagnitudeRecursiveGaussianImageFilter::PixelType
typename InputImageType::PixelType PixelType
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:64
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::GradientMagnitudeRecursiveGaussianImageFilter::GaussianFilterPointer
typename GaussianFilterType::Pointer GaussianFilterPointer
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:88
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::RecursiveGaussianImageFilter
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
Definition: itkRecursiveGaussianImageFilter.h:100
itk::GradientMagnitudeRecursiveGaussianImageFilter::CumulativeImagePointer
typename CumulativeImageType::Pointer CumulativeImagePointer
Definition: itkGradientMagnitudeRecursiveGaussianImageFilter.h:105
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293