ITK  6.0.0
Insight Toolkit
itkSmoothingRecursiveGaussianImageFilter.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 
19 #ifndef itkSmoothingRecursiveGaussianImageFilter_h
20 #define itkSmoothingRecursiveGaussianImageFilter_h
21 
23 #include "itkCastImageFilter.h"
24 #include "itkImage.h"
25 #include "itkPixelTraits.h"
26 #include "itkCommand.h"
27 
28 namespace itk
29 {
30 
49 template <typename TInputImage, typename TOutputImage = TInputImage>
50 class ITK_TEMPLATE_EXPORT SmoothingRecursiveGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(SmoothingRecursiveGaussianImageFilter);
54 
60 
62  using InputImageType = TInputImage;
63  using OutputImageType = TOutputImage;
64  using PixelType = typename TInputImage::PixelType;
67 
69  itkOverrideGetNameOfClassMacro(SmoothingRecursiveGaussianImageFilter);
70 
72  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
73 
76 
81  using RealImageType = typename InputImageType::template Rebind<InternalRealType>::Type;
82 
85 
88 
91 
94 
97 
100 
103 
105  itkNewMacro(Self);
106 
111  void
112  SetSigmaArray(const SigmaArrayType & sigma);
113  void
114  SetSigma(ScalarRealType sigma);
119  GetSigmaArray() const;
120 
124  GetSigma() const;
125 
130  void
131  SetNormalizeAcrossScale(bool normalize);
132  itkGetConstMacro(NormalizeAcrossScale, bool);
133  itkBooleanMacro(NormalizeAcrossScale);
137  void
138  SetNumberOfWorkUnits(ThreadIdType nb) override;
139 
140  bool
141  CanRunInPlace() const override;
142 
143 #ifdef ITK_USE_CONCEPT_CHECKING
144  // Begin concept checking
145  // This concept does not work with variable length vector images
146  // itkConceptMacro( InputHasNumericTraitsCheck,
147  //( Concept::HasNumericTraits< PixelType > ) );
148  // End concept checking
149 #endif
150 
151 protected:
153  ~SmoothingRecursiveGaussianImageFilter() override = default;
154  void
155  PrintSelf(std::ostream & os, Indent indent) const override;
156 
157  void
158  GenerateData() override;
159 
166  void
167  GenerateInputRequestedRegion() override;
168 
169  // Override since the filter produces the entire dataset
170  void
171  EnlargeOutputRequestedRegion(DataObject * output) override;
172 
173 private:
174  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1]{};
175  FirstGaussianFilterPointer m_FirstSmoothingFilter{};
176  CastingFilterPointer m_CastingFilter{};
177 
178  bool m_NormalizeAcrossScale{ false };
179 
180  SigmaArrayType m_Sigma{};
181 };
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 # include "itkSmoothingRecursiveGaussianImageFilter.hxx"
186 #endif
187 
188 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::SmoothingRecursiveGaussianImageFilter::ScalarRealType
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:66
itk::CastImageFilter
Casts input pixels to output pixel type.
Definition: itkCastImageFilter.h:100
itkRecursiveGaussianImageFilter.h
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::InPlaceImageFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkInPlaceImageFilter.h:77
itk::SmoothingRecursiveGaussianImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:64
itkImage.h
itkPixelTraits.h
itk::SmartPointer< Self >
itk::SmoothingRecursiveGaussianImageFilter::RealImageType
typename InputImageType::template Rebind< InternalRealType >::Type RealImageType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:81
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkCastImageFilter.h
itk::SmoothingRecursiveGaussianImageFilter::InternalGaussianFilterPointer
typename InternalGaussianFilterType::Pointer InternalGaussianFilterPointer
Definition: itkSmoothingRecursiveGaussianImageFilter.h:93
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::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::FixedArray< ScalarRealType, Self::ImageDimension >
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itk::SmoothingRecursiveGaussianImageFilter::InternalRealType
typename NumericTraits< PixelType >::FloatType InternalRealType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:80
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::SmoothingRecursiveGaussianImageFilter::CastingFilterPointer
typename CastingFilterType::Pointer CastingFilterPointer
Definition: itkSmoothingRecursiveGaussianImageFilter.h:99
itk::SmoothingRecursiveGaussianImageFilter::RealType
typename NumericTraits< PixelType >::RealType RealType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:65
itk::RecursiveGaussianImageFilter
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
Definition: itkRecursiveGaussianImageFilter.h:100
itk::SmoothingRecursiveGaussianImageFilter::FirstGaussianFilterPointer
typename FirstGaussianFilterType::Pointer FirstGaussianFilterPointer
Definition: itkSmoothingRecursiveGaussianImageFilter.h:96
itkCommand.h
itk::SmoothingRecursiveGaussianImageFilter
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
Definition: itkSmoothingRecursiveGaussianImageFilter.h:50
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293