ITK  6.0.0
Insight Toolkit
itkHessianRecursiveGaussianImageFilter.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 itkHessianRecursiveGaussianImageFilter_h
19 #define itkHessianRecursiveGaussianImageFilter_h
20 
23 #include "itkImage.h"
25 #include "itkPixelTraits.h"
26 
27 namespace itk
28 {
42 template <typename TInputImage,
43  typename TOutputImage =
44  Image<SymmetricSecondRankTensor<typename NumericTraits<typename TInputImage::PixelType>::RealType,
45  TInputImage::ImageDimension>,
46  TInputImage::ImageDimension>>
47 class ITK_TEMPLATE_EXPORT HessianRecursiveGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(HessianRecursiveGaussianImageFilter);
51 
57 
59  using InputImageType = TInputImage;
60  using PixelType = typename TInputImage::PixelType;
62 
64  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
65 
67  static constexpr unsigned int NumberOfSmoothingFilters =
68  (TInputImage::ImageDimension > 2) ? (TInputImage::ImageDimension - 2) : (0);
69 
74  using InternalRealType = float;
76 
82 
84 
87 
90 
92 
95  using GaussianFiltersArray = std::vector<GaussianFilterPointer>;
96 
100 
103 
105  using OutputImageType = TOutputImage;
106  using OutputPixelType = typename OutputImageType::PixelType;
108 
110  itkOverrideGetNameOfClassMacro(HessianRecursiveGaussianImageFilter);
111 
113  itkNewMacro(Self);
114 
116  void
117  SetSigma(RealType sigma);
118  RealType
119  GetSigma() const;
125  void
126  SetNormalizeAcrossScale(bool normalize);
127  itkGetConstMacro(NormalizeAcrossScale, bool);
128  itkBooleanMacro(NormalizeAcrossScale);
136  void
137  GenerateInputRequestedRegion() override;
138 
139 #ifdef ITK_USE_CONCEPT_CHECKING
140  // Begin concept checking
141  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
142  itkConceptMacro(OutputHasPixelTraitsCheck, (Concept::HasPixelTraits<OutputPixelType>));
143  // End concept checking
144 #endif
145 
146 protected:
148  ~HessianRecursiveGaussianImageFilter() override = default;
149  void
150  PrintSelf(std::ostream & os, Indent indent) const override;
151 
153  void
154  GenerateData() override;
155 
156  // Override since the filter produces the entire dataset
157  void
158  EnlargeOutputRequestedRegion(DataObject * output) override;
159 
160 private:
161  GaussianFiltersArray m_SmoothingFilters{};
162  DerivativeFilterAPointer m_DerivativeFilterA{};
163  DerivativeFilterBPointer m_DerivativeFilterB{};
164  OutputImageAdaptorPointer m_ImageAdaptor{};
165 
167  bool m_NormalizeAcrossScale{};
168 };
169 } // end namespace itk
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 # include "itkHessianRecursiveGaussianImageFilter.hxx"
173 #endif
174 
175 #endif
itk::HessianRecursiveGaussianImageFilter::DerivativeFilterBPointer
typename DerivativeFilterBType::Pointer DerivativeFilterBPointer
Definition: itkHessianRecursiveGaussianImageFilter.h:99
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::NthElementImageAdaptor
Presents an image as being composed of the N-th element of its pixels.
Definition: itkNthElementImageAdaptor.h:58
itkRecursiveGaussianImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itkNthElementImageAdaptor.h
itkImage.h
itkPixelTraits.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::HessianRecursiveGaussianImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkHessianRecursiveGaussianImageFilter.h:106
itk::HessianRecursiveGaussianImageFilter::OutputComponentType
typename PixelTraits< OutputPixelType >::ValueType OutputComponentType
Definition: itkHessianRecursiveGaussianImageFilter.h:107
itk::HessianRecursiveGaussianImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkHessianRecursiveGaussianImageFilter.h:60
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::HessianRecursiveGaussianImageFilter::DerivativeFilterAPointer
typename DerivativeFilterAType::Pointer DerivativeFilterAPointer
Definition: itkHessianRecursiveGaussianImageFilter.h:98
itkSymmetricSecondRankTensor.h
itk::HessianRecursiveGaussianImageFilter::OutputImageAdaptorPointer
typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer
Definition: itkHessianRecursiveGaussianImageFilter.h:83
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::HessianRecursiveGaussianImageFilter
Computes the Hessian matrix of an image by convolution with the Second and Cross derivatives of a Gau...
Definition: itkHessianRecursiveGaussianImageFilter.h:47
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itk::PixelTraits::ValueType
typename TPixelType::ValueType ValueType
Definition: itkPixelTraits.h:52
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::HessianRecursiveGaussianImageFilter::InternalRealType
float InternalRealType
Definition: itkHessianRecursiveGaussianImageFilter.h:74
itk::HessianRecursiveGaussianImageFilter::RealType
typename NumericTraits< PixelType >::RealType RealType
Definition: itkHessianRecursiveGaussianImageFilter.h:61
itk::HessianRecursiveGaussianImageFilter::GaussianFiltersArray
std::vector< GaussianFilterPointer > GaussianFiltersArray
Definition: itkHessianRecursiveGaussianImageFilter.h:95
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Concept::HasPixelTraits
Definition: itkConceptChecking.h:753
itk::RecursiveGaussianImageFilter
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
Definition: itkRecursiveGaussianImageFilter.h:100
itk::HessianRecursiveGaussianImageFilter::GaussianFilterPointer
typename GaussianFilterType::Pointer GaussianFilterPointer
Definition: itkHessianRecursiveGaussianImageFilter.h:94
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293