ITK  6.0.0
Insight Toolkit
itkGaussianBlurImageFunction.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 itkGaussianBlurImageFunction_h
19#define itkGaussianBlurImageFunction_h
20
22#include "itkGaussianOperator.h"
24
25namespace itk
26{
38template <typename TInputImage, typename TOutput = double>
39class ITK_TEMPLATE_EXPORT GaussianBlurImageFunction : public ImageFunction<TInputImage, TOutput>
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(GaussianBlurImageFunction);
43
46
49
53
55 itkNewMacro(Self);
56
58 itkOverrideGetNameOfClassMacro(GaussianBlurImageFunction);
59
61 using InputImageType = TInputImage;
62 using InputPixelType = typename InputImageType::PixelType;
63 using typename Superclass::IndexType;
64 using typename Superclass::ContinuousIndexType;
65
67 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
68
72
78
81
84
88
90 using typename Superclass::PointType;
91
93 TOutput
94 Evaluate(const PointType & point) const override;
95
97 TOutput
98 EvaluateAtIndex(const IndexType & index) const override;
99
101 TOutput
102 EvaluateAtContinuousIndex(const ContinuousIndexType & cindex) const override;
103
110 void
111 SetSigma(const double * sigma);
112
113 void
114 SetSigma(const float * sigma);
115
116 void
117 SetSigma(const double sigma);
118
119 itkSetMacro(Sigma, SigmaArrayType);
120 itkGetConstReferenceMacro(Sigma, SigmaArrayType);
121
126 void
127 SetInputImage(const InputImageType * ptr) override;
128
132 itkSetMacro(Extent, ExtentArrayType);
133 itkGetConstReferenceMacro(Extent, ExtentArrayType);
134 void
135 SetExtent(const double * extent);
138 void
139 SetExtent(const double extent);
140
144 itkSetMacro(MaximumError, ErrorArrayType);
145 itkGetConstReferenceMacro(MaximumError, ErrorArrayType);
152 itkSetMacro(MaximumKernelWidth, int);
153 itkGetConstMacro(MaximumKernelWidth, int);
161 itkSetMacro(UseImageSpacing, bool);
162 itkGetConstMacro(UseImageSpacing, bool);
163 itkBooleanMacro(UseImageSpacing);
166protected:
168 ~GaussianBlurImageFunction() override = default;
169
170 void
171 PrintSelf(std::ostream & os, Indent indent) const override;
172
173 void
175
176 void
177 RecomputeContinuousGaussianKernel(const double * offset) const;
178
179private:
180 virtual TOutput
181 EvaluateAtIndex(const IndexType & index, const OperatorArrayType & operatorArray) const;
182
183 SigmaArrayType m_Sigma{};
184 OperatorImageFunctionPointer m_OperatorImageFunction{};
185 OperatorInternalImageFunctionPointer m_OperatorInternalImageFunction{};
186 mutable OperatorArrayType m_OperatorArray{};
187 mutable OperatorArrayType m_ContinuousOperatorArray{};
188 InternalImagePointer m_InternalImage{};
189
193 ErrorArrayType m_MaximumError{};
194 ExtentArrayType m_Extent{};
195
198 int m_MaximumKernelWidth{};
199
201 unsigned int m_FilterDimensionality{};
202
204 bool m_UseImageSpacing{ true };
205
207 GaussianFunctionPointer m_GaussianFunction{};
208};
209} // end namespace itk
210
211#ifndef ITK_MANUAL_INSTANTIATION
212# include "itkGaussianBlurImageFunction.hxx"
213#endif
214
215#endif
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
typename GaussianFunctionType::Pointer GaussianFunctionPointer
void SetSigma(const double *sigma)
void SetSigma(const float *sigma)
void SetSigma(const double sigma)
~GaussianBlurImageFunction() override=default
void RecomputeContinuousGaussianKernel(const double *offset) const
void SetExtent(const double *extent)
TOutput Evaluate(const PointType &point) const override
typename OperatorInternalImageFunctionType::Pointer OperatorInternalImageFunctionPointer
TOutput EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
void PrintSelf(std::ostream &os, Indent indent) const override
typename NumericTraits< InputPixelType >::RealType InputPixelRealType
typename InternalImageType::Pointer InternalImagePointer
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
virtual TOutput EvaluateAtIndex(const IndexType &index, const OperatorArrayType &operatorArray) const
typename InputImageType::PixelType InputPixelType
void SetExtent(const double extent)
TOutput EvaluateAtIndex(const IndexType &index) const override
void SetInputImage(const InputImageType *ptr) override
A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian kernel.
N-dimensional Gaussian spatial function class.
Evaluates a function of an image at specified position.
typename InputImageType::IndexType IndexType
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
Define additional traits for native types such as int or float.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents