ITK  5.2.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  * 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 
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 
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 
102  using OutputImagePointer = typename OutputImageType::Pointer;
103 
105  itkNewMacro(Self);
106 
111  void
112  SetSigmaArray(const SigmaArrayType & sigmas);
113  void
114  SetSigma(ScalarRealType sigma);
116 
119  GetSigmaArray() const;
120 
124  GetSigma() const;
125 
130  void
131  SetNormalizeAcrossScale(bool normalizeInScaleSpace);
132  itkGetConstMacro(NormalizeAcrossScale, bool);
133  itkBooleanMacro(NormalizeAcrossScale);
135 
136  void
137  SetNumberOfWorkUnits(ThreadIdType nb) override;
138 
139  bool
140  CanRunInPlace() const override;
141 
142 #ifdef ITK_USE_CONCEPT_CHECKING
143  // Begin concept checking
144  // This concept does not work with variable length vector images
145  // itkConceptMacro( InputHasNumericTraitsCheck,
146  //( Concept::HasNumericTraits< PixelType > ) );
147  // End concept checking
148 #endif
149 
150 protected:
152  ~SmoothingRecursiveGaussianImageFilter() override = default;
153  void
154  PrintSelf(std::ostream & os, Indent indent) const override;
155 
156  void
157  GenerateData() override;
158 
165  void
166  GenerateInputRequestedRegion() override;
167 
168  // Override since the filter produces the entire dataset
169  void
170  EnlargeOutputRequestedRegion(DataObject * output) override;
171 
172 private:
173  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
176 
177  bool m_NormalizeAcrossScale{ false };
178 
180 };
181 } // end namespace itk
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 # include "itkSmoothingRecursiveGaussianImageFilter.hxx"
185 #endif
186 
187 #endif
itk::SmoothingRecursiveGaussianImageFilter::ScalarRealType
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:66
itk::CastImageFilter
Casts input pixels to output pixel type.
Definition: itkCastImageFilter.h:104
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:99
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::SmoothingRecursiveGaussianImageFilter::m_FirstSmoothingFilter
FirstGaussianFilterPointer m_FirstSmoothingFilter
Definition: itkSmoothingRecursiveGaussianImageFilter.h:174
itk::SmoothingRecursiveGaussianImageFilter::m_CastingFilter
CastingFilterPointer m_CastingFilter
Definition: itkSmoothingRecursiveGaussianImageFilter.h:175
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:58
itk::SmoothingRecursiveGaussianImageFilter::InternalRealType
typename NumericTraits< PixelType >::FloatType InternalRealType
Definition: itkSmoothingRecursiveGaussianImageFilter.h:80
itk::SmoothingRecursiveGaussianImageFilter::m_Sigma
SigmaArrayType m_Sigma
Definition: itkSmoothingRecursiveGaussianImageFilter.h:179
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:138
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