ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRecursiveGaussianImageFilter.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 #ifndef itkRecursiveGaussianImageFilter_h
19 #define itkRecursiveGaussianImageFilter_h
20 
22 
23 namespace itk
24 {
61 template< typename TInputImage, typename TOutputImage = TInputImage >
62 class ITK_TEMPLATE_EXPORT RecursiveGaussianImageFilter:
63  public RecursiveSeparableImageFilter< TInputImage, TOutputImage >
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(RecursiveGaussianImageFilter);
67 
73 
74  using RealType = typename Superclass::RealType;
76 
78  itkNewMacro(Self);
79 
82 
87  itkGetConstMacro(Sigma, ScalarRealType);
88  itkSetMacro(Sigma, ScalarRealType);
90 
94  typedef enum { ZeroOrder, FirstOrder, SecondOrder } OrderEnumType;
95 
97  using OutputImageType = TOutputImage;
98 
138  itkSetMacro(NormalizeAcrossScale, bool);
139  itkGetConstMacro(NormalizeAcrossScale, bool);
140 
147  itkSetMacro(Order, OrderEnumType);
148  itkGetConstMacro(Order, OrderEnumType);
150 
152  void SetZeroOrder();
153 
155  void SetFirstOrder();
156 
158  void SetSecondOrder();
159 
160 protected:
162  ~RecursiveGaussianImageFilter() override = default;
163  void PrintSelf(std::ostream & os, Indent indent) const override;
164 
169  void SetUp(ScalarRealType spacing) override;
170 
171  /* See superclass for doxygen. This method adds the additional check
172  * that sigma is greater than zero. */
173  void VerifyPreconditions() ITKv5_CONST override;
174 
175 private:
177  void ComputeNCoefficients(ScalarRealType sigmad,
180  ScalarRealType & N0, ScalarRealType & N1,
181  ScalarRealType & N2, ScalarRealType & N3,
182  ScalarRealType & SN, ScalarRealType & DN, ScalarRealType & EN);
183 
185  void ComputeDCoefficients(ScalarRealType sigmad,
187  ScalarRealType & SD, ScalarRealType & DD, ScalarRealType & ED);
188 
191  void ComputeRemainingCoefficients(bool symmetric);
192 
194  ScalarRealType m_Sigma;
195 
197  bool m_NormalizeAcrossScale;
198 
199  OrderEnumType m_Order;
200 };
201 } // end namespace itk
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "itkRecursiveGaussianImageFilter.hxx"
205 #endif
206 
207 #endif
Base class for recursive convolution with a kernel.
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
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.
typename NumericTraits< InputPixelType >::RealType RealType
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType