ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGaussianOperator.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 itkGaussianOperator_h
19#define itkGaussianOperator_h
20
22#include <cmath>
23namespace itk
24{
66template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
67class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
68{
69public:
70
74
76 itkOverrideGetNameOfClassMacro(GaussianOperator);
77
79 void
80 SetVariance(const double variance)
81 {
82 m_Variance = variance;
83 }
84
89 void
90 SetMaximumError(const double max_error)
91 {
92 if (max_error >= 1 || max_error <= 0)
93 {
94 itkExceptionMacro("Maximum Error Must be in the range [ 0.0 , 1.0 ]");
95 }
96
97 m_MaximumError = max_error;
98 }
99
101 double
103 {
104 return m_Variance;
105 }
106
111 double
113 {
114 return m_MaximumError;
115 }
116
121 void
122 SetMaximumKernelWidth(unsigned int n)
123 {
125 }
126
128 unsigned int
130 {
132 }
133
134 void
135 PrintSelf(std::ostream & os, Indent indent) const override
136 {
137 Superclass::PrintSelf(os, indent);
138
139 os << indent << "Variance: " << m_Variance << std::endl;
140 os << indent << "MaximumError: " << m_MaximumError << std::endl;
141 os << indent << "MaximumKernelWidth: " << m_MaximumKernelWidth << std::endl;
142 }
143
147 bool
148 GetDebug() const
149 {
150 return m_Debug;
151 }
152
154 void
155 DebugOn() const
156 {
157 m_Debug = true;
158 }
159
161 void
162 DebugOff() const
163 {
164 m_Debug = false;
165 }
166
168 void
169 SetDebug(bool debugFlag) const
170 {
171 m_Debug = debugFlag;
172 }
173
174public:
177 double
179
182 double
184
187 double
188 ModifiedBesselI(int, double);
189
190protected:
192 using typename Superclass::CoefficientVector;
193
197
199 void
200 Fill(const CoefficientVector & coeff) override
201 {
202 this->FillCenteredDirectional(coeff);
203 }
204
205private:
207 double m_Variance{ 1 };
208
211 double m_MaximumError{ .01 };
212
216 unsigned int m_MaximumKernelWidth{ 30 };
217
219 mutable bool m_Debug{ false };
220};
221} // namespace itk
222
223#ifndef ITK_MANUAL_INSTANTIATION
224# include "itkGaussianOperator.hxx"
225#endif
226
227#endif
A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian kernel.
double ModifiedBesselI1(double)
double ModifiedBesselI0(double)
void SetMaximumError(const double max_error)
void SetMaximumKernelWidth(unsigned int n)
double ModifiedBesselI(int, double)
void Fill(const CoefficientVector &coeff) override
void SetVariance(const double variance)
void PrintSelf(std::ostream &os, Indent indent) const override
unsigned int GetMaximumKernelWidth() const
void SetDebug(bool debugFlag) const
CoefficientVector GenerateCoefficients() override
NeighborhoodOperator< TPixel, VDimension, TAllocator > Superclass
typename std::vector< PixelRealType > CoefficientVector
Control indentation during Print() invocation.
Definition itkIndent.h:50
Virtual class that defines a common interface to all neighborhood operator subtypes.
virtual void FillCenteredDirectional(const CoefficientVector &)
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....