ITK  5.4.0
Insight Toolkit
itkRecursiveGaussianImageFilter.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 itkRecursiveGaussianImageFilter_h
19#define itkRecursiveGaussianImageFilter_h
20
22#include "ITKSmoothingExport.h"
23
24namespace itk
25{
31{
32public:
38 enum class GaussianOrder : uint8_t
39 {
40 ZeroOrder = 0,
41 FirstOrder = 1,
42 SecondOrder = 2
43 };
44};
45// Define how to print enumeration
46extern ITKSmoothing_EXPORT std::ostream &
47 operator<<(std::ostream & out, const RecursiveGaussianImageFilterEnums::GaussianOrder value);
48
50#if !defined(ITK_LEGACY_REMOVE)
52using OrderEnumType = GaussianOrderEnum;
53using EnumGaussianOrderType = GaussianOrderEnum;
54// We need to expose the enum values at the class level
55// for backwards compatibility
56static constexpr GaussianOrderEnum ZeroOrder = GaussianOrderEnum::ZeroOrder;
57static constexpr GaussianOrderEnum FirstOrder = GaussianOrderEnum::FirstOrder;
58static constexpr GaussianOrderEnum SecondOrder = GaussianOrderEnum::SecondOrder;
59#endif
60
99template <typename TInputImage, typename TOutputImage = TInputImage>
100class ITK_TEMPLATE_EXPORT RecursiveGaussianImageFilter : public RecursiveSeparableImageFilter<TInputImage, TOutputImage>
101{
102public:
103 ITK_DISALLOW_COPY_AND_MOVE(RecursiveGaussianImageFilter);
111
112 using typename Superclass::RealType;
113 using typename Superclass::ScalarRealType;
114
116 itkNewMacro(Self);
117
119 itkOverrideGetNameOfClassMacro(RecursiveGaussianImageFilter);
120
125 itkGetConstMacro(Sigma, ScalarRealType);
126 itkSetMacro(Sigma, ScalarRealType);
130 using OutputImageType = TOutputImage;
131
132#if !defined(ITK_LEGACY_REMOVE)
134 using OrderEnumType = GaussianOrderEnum;
135 using EnumGaussianOrderType = GaussianOrderEnum;
136 // We need to expose the enum values at the class level
137 // for backwards compatibility
138 static constexpr GaussianOrderEnum ZeroOrder = GaussianOrderEnum::ZeroOrder;
139 static constexpr GaussianOrderEnum FirstOrder = GaussianOrderEnum::FirstOrder;
140 static constexpr GaussianOrderEnum SecondOrder = GaussianOrderEnum::SecondOrder;
141#endif
142
182 itkSetMacro(NormalizeAcrossScale, bool);
183 itkGetConstMacro(NormalizeAcrossScale, bool);
184 itkBooleanMacro(NormalizeAcrossScale);
185
192 itkSetMacro(Order, GaussianOrderEnum);
193 itkGetConstMacro(Order, GaussianOrderEnum);
197 void
199
201 void
203
205 void
207
208protected:
210 ~RecursiveGaussianImageFilter() override = default;
211 void
212 PrintSelf(std::ostream & os, Indent indent) const override;
213
218 void
219 SetUp(ScalarRealType spacing) override;
220
221 /* See superclass for doxygen. This method adds the additional check
222 * that sigma is greater than zero. */
223 void
224 VerifyPreconditions() ITKv5_CONST override;
225
226private:
228 void
229 ComputeNCoefficients(ScalarRealType sigmad,
238 ScalarRealType & N0,
239 ScalarRealType & N1,
240 ScalarRealType & N2,
241 ScalarRealType & N3,
242 ScalarRealType & SN,
243 ScalarRealType & DN,
244 ScalarRealType & EN);
245
247 void
248 ComputeDCoefficients(ScalarRealType sigmad,
253 ScalarRealType & SD,
254 ScalarRealType & DD,
255 ScalarRealType & ED);
256
259 void
260 ComputeRemainingCoefficients(bool symmetric);
261
263 ScalarRealType m_Sigma{};
264
266 bool m_NormalizeAcrossScale{};
267
269};
270} // end namespace itk
271
272#ifndef ITK_MANUAL_INSTANTIATION
273# include "itkRecursiveGaussianImageFilter.hxx"
274#endif
275
276#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Contains all enum classes used by RecursiveGaussianImageFilter class.
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
void VerifyPreconditions() ITKv5_CONST override
Verifies that the process object has been configured correctly, that all required inputs are set,...
void SetUp(ScalarRealType spacing) override
~RecursiveGaussianImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for recursive convolution with a kernel.
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216
RecursiveGaussianImageFilterEnums::GaussianOrder GaussianOrderEnum