ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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;
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);
137
138 void
139 SetExtent(const double extent);
140
144 itkSetMacro(MaximumError, ErrorArrayType);
145 itkGetConstReferenceMacro(MaximumError, ErrorArrayType);
147
152 itkSetMacro(MaximumKernelWidth, int);
153 itkGetConstMacro(MaximumKernelWidth, int);
155
161 itkSetMacro(UseImageSpacing, bool);
162 itkGetConstMacro(UseImageSpacing, bool);
163 itkBooleanMacro(UseImageSpacing);
165
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
189
195
199
202
204 bool m_UseImageSpacing{ true };
205
208};
209} // end namespace itk
210
211#ifndef ITK_MANUAL_INSTANTIATION
212# include "itkGaussianBlurImageFunction.hxx"
213#endif
214
215#endif
Simulate a standard C array with copy semantics.
itk::FixedArray< double, Self::ImageDimension > ErrorArrayType
typename GaussianFunctionType::Pointer GaussianFunctionPointer
void SetSigma(const double *sigma)
itk::FixedArray< double, Self::ImageDimension > ExtentArrayType
void SetSigma(const float *sigma)
void SetSigma(const double sigma)
~GaussianBlurImageFunction() override=default
itk::FixedArray< double, Self::ImageDimension > SigmaArrayType
GaussianOperator< TOutput, Self::ImageDimension > GaussianOperatorType
FixedArray< NeighborhoodType, Self::ImageDimension > OperatorArrayType
void RecomputeContinuousGaussianKernel(const double *offset) const
NeighborhoodOperatorImageFunction< InternalImageType, TOutput > OperatorInternalImageFunctionType
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
OperatorImageFunctionPointer m_OperatorImageFunction
Neighborhood< TOutput, Self::ImageDimension > NeighborhoodType
GaussianSpatialFunction< TOutput, 1 > GaussianFunctionType
typename InternalImageType::Pointer InternalImagePointer
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
typename InputImageType::IndexType IndexType
virtual TOutput EvaluateAtIndex(const IndexType &index, const OperatorArrayType &operatorArray) const
itk::Image< InputPixelRealType, Self::ImageDimension > InternalImageType
ImageFunction< TInputImage, TOutput > Superclass
Point< TCoordinate, Self::ImageDimension > PointType
ContinuousIndex< TCoordinate, Self::ImageDimension > ContinuousIndexType
typename InputImageType::PixelType InputPixelType
NeighborhoodOperatorImageFunction< InputImageType, TOutput > OperatorImageFunctionType
OperatorInternalImageFunctionPointer m_OperatorInternalImageFunction
static constexpr unsigned int ImageDimension
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.
typename InputImageType::IndexType IndexType
Point< TCoordinate, Self::ImageDimension > PointType
ContinuousIndex< TCoordinate, Self::ImageDimension > ContinuousIndexType
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
A light-weight container object for storing an N-dimensional neighborhood of values.
Implements transparent reference counting.
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