ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSmoothingRecursiveGaussianImageFilter.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 
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 
51 template< typename TInputImage,
52  typename TOutputImage = TInputImage >
53 class ITK_TEMPLATE_EXPORT SmoothingRecursiveGaussianImageFilter:
54  public InPlaceImageFilter< TInputImage, TOutputImage >
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveGaussianImageFilter);
58 
64 
66  using InputImageType = TInputImage;
67  using OutputImageType = TOutputImage;
68  using PixelType = typename TInputImage::PixelType;
71 
75 
77  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
78 
81  Self::ImageDimension >;
82 
87  using RealImageType = typename InputImageType::template Rebind<InternalRealType>::Type;
88 
91 
94 
97 
100 
103 
106 
108  using OutputImagePointer = typename OutputImageType::Pointer;
109 
111  itkNewMacro(Self);
112 
117  void SetSigmaArray(const SigmaArrayType & sigmas);
118  void SetSigma(ScalarRealType sigma);
120 
122  SigmaArrayType GetSigmaArray() const;
123 
126  ScalarRealType GetSigma() const;
127 
132  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);
133  itkGetConstMacro(NormalizeAcrossScale, bool);
134  itkBooleanMacro( NormalizeAcrossScale );
136 
137  void SetNumberOfWorkUnits(ThreadIdType nb) override;
138 
139  bool CanRunInPlace() const override;
140 
141 #ifdef ITK_USE_CONCEPT_CHECKING
142  // Begin concept checking
143  // This concept does not work with variable length vector images
144  //itkConceptMacro( InputHasNumericTraitsCheck,
145  //( Concept::HasNumericTraits< PixelType > ) );
146  // End concept checking
147 #endif
148 
149 protected:
151  ~SmoothingRecursiveGaussianImageFilter() override = default;
152  void PrintSelf(std::ostream & os, Indent indent) const override;
153 
154  void GenerateData() override;
155 
162  void GenerateInputRequestedRegion() override;
163 
164  // Override since the filter produces the entire dataset
165  void EnlargeOutputRequestedRegion(DataObject *output) override;
166 
167 private:
168  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
171 
172  bool m_NormalizeAcrossScale{ false };
173 
175 };
176 } // end namespace itk
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
179 #include "itkSmoothingRecursiveGaussianImageFilter.hxx"
180 #endif
181 
182 #endif
typename OutputImageType::Pointer OutputImagePointer
typename InternalGaussianFilterType::Pointer InternalGaussianFilterPointer
Define numeric traits for std::vector.
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
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.
TOutputImage OutputImageType
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
typename NumericTraits< PixelType >::RealType RealType
typename FirstGaussianFilterType::Pointer FirstGaussianFilterPointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
typename NumericTraits< PixelType >::FloatType InternalRealType
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
Base class for filters that take an image as input and overwrite that image as the output...
Base class for all data objects in ITK.
typename InputImageType::template Rebind< InternalRealType >::Type RealImageType
Casts input pixels to output pixel type.