ITK  5.2.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  * 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 itkGaussianBlurImageFunction_h
19 #define itkGaussianBlurImageFunction_h
20 
22 #include "itkGaussianOperator.h"
24 
25 namespace itk
26 {
41 template <typename TInputImage, typename TOutput = double>
42 class ITK_TEMPLATE_EXPORT GaussianBlurImageFunction : public ImageFunction<TInputImage, TOutput>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(GaussianBlurImageFunction);
46 
49 
52 
56 
58  itkNewMacro(Self);
59 
62 
64  using InputImageType = TInputImage;
65  using InputPixelType = typename InputImageType::PixelType;
66  using IndexType = typename Superclass::IndexType;
67  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
68 
70  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
71 
75 
81 
84 
87 
91 
93  using PointType = typename Superclass::PointType;
94 
96  TOutput
97  Evaluate(const PointType & point) const override;
98 
100  TOutput
101  EvaluateAtIndex(const IndexType & index) const override;
102 
104  TOutput
105  EvaluateAtContinuousIndex(const ContinuousIndexType & cindex) const override;
106 
113  void
114  SetSigma(const double * sigma);
115 
116  void
117  SetSigma(const float * sigma);
118 
119  void
120  SetSigma(const double sigma);
121 
122  itkSetMacro(Sigma, SigmaArrayType);
123  itkGetConstReferenceMacro(Sigma, SigmaArrayType);
124 
129  void
130  SetInputImage(const InputImageType * ptr) override;
131 
135  itkSetMacro(Extent, ExtentArrayType);
136  itkGetConstReferenceMacro(Extent, ExtentArrayType);
137  void
138  SetExtent(const double * extent);
140 
141  void
142  SetExtent(const double extent);
143 
147  itkSetMacro(MaximumError, ErrorArrayType);
148  itkGetConstReferenceMacro(MaximumError, ErrorArrayType);
150 
155  itkSetMacro(MaximumKernelWidth, int);
156  itkGetConstMacro(MaximumKernelWidth, int);
158 
164  itkSetMacro(UseImageSpacing, bool);
165  itkGetConstMacro(UseImageSpacing, bool);
166  itkBooleanMacro(UseImageSpacing);
168 
169 protected:
171  ~GaussianBlurImageFunction() override = default;
172 
173  void
174  PrintSelf(std::ostream & os, Indent indent) const override;
175 
176  void
177  RecomputeGaussianKernel();
178 
179  void
180  RecomputeContinuousGaussianKernel(const double * offset) const;
181 
182 private:
183  virtual TOutput
184  EvaluateAtIndex(const IndexType & index, const OperatorArrayType & operatorArray) const;
185 
192 
198 
202 
205 
208 
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 # include "itkGaussianBlurImageFunction.hxx"
216 #endif
217 
218 #endif
itk::GaussianBlurImageFunction::ContinuousIndexType
typename Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkGaussianBlurImageFunction.h:67
itk::GaussianBlurImageFunction::InternalImagePointer
typename InternalImageType::Pointer InternalImagePointer
Definition: itkGaussianBlurImageFunction.h:80
itk::GaussianBlurImageFunction::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkGaussianBlurImageFunction.h:207
itk::GaussianBlurImageFunction::m_OperatorImageFunction
OperatorImageFunctionPointer m_OperatorImageFunction
Definition: itkGaussianBlurImageFunction.h:187
itk::GaussianBlurImageFunction::m_GaussianFunction
GaussianFunctionPointer m_GaussianFunction
Definition: itkGaussianBlurImageFunction.h:210
itk::GaussianBlurImageFunction::IndexType
typename Superclass::IndexType IndexType
Definition: itkGaussianBlurImageFunction.h:66
itk::GaussianBlurImageFunction::GaussianFunctionPointer
typename GaussianFunctionType::Pointer GaussianFunctionPointer
Definition: itkGaussianBlurImageFunction.h:77
itk::GaussianBlurImageFunction::m_ContinuousOperatorArray
OperatorArrayType m_ContinuousOperatorArray
Definition: itkGaussianBlurImageFunction.h:190
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Neighborhood< TOutput, Self::ImageDimension >
itk::GaussianBlurImageFunction::m_Extent
ExtentArrayType m_Extent
Definition: itkGaussianBlurImageFunction.h:197
itk::GaussianBlurImageFunction::m_MaximumError
ErrorArrayType m_MaximumError
Definition: itkGaussianBlurImageFunction.h:196
itk::GaussianBlurImageFunction::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkGaussianBlurImageFunction.h:65
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GaussianBlurImageFunction::InputImageType
TInputImage InputImageType
Definition: itkGaussianBlurImageFunction.h:64
itk::GaussianBlurImageFunction::m_Sigma
SigmaArrayType m_Sigma
Definition: itkGaussianBlurImageFunction.h:186
itk::GaussianSpatialFunction
N-dimensional Gaussian spatial function class.
Definition: itkGaussianSpatialFunction.h:44
itk::GaussianBlurImageFunction::InputPixelRealType
typename NumericTraits< InputPixelType >::RealType InputPixelRealType
Definition: itkGaussianBlurImageFunction.h:78
itkGaussianSpatialFunction.h
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::GaussianBlurImageFunction
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
Definition: itkGaussianBlurImageFunction.h:42
itk::ImageFunction
Evaluates a function of an image at specified position.
Definition: itkImageFunction.h:55
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::NeighborhoodOperatorImageFunction
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
Definition: itkNeighborhoodOperatorImageFunction.h:41
itk::GaussianOperator
A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian kernel.
Definition: itkGaussianOperator.h:69
itk::GaussianBlurImageFunction::PointType
typename Superclass::PointType PointType
Definition: itkGaussianBlurImageFunction.h:93
itk::GaussianBlurImageFunction::m_OperatorArray
OperatorArrayType m_OperatorArray
Definition: itkGaussianBlurImageFunction.h:189
itk::FixedArray< NeighborhoodType, Self::ImageDimension >
itk::GaussianBlurImageFunction::m_FilterDimensionality
unsigned int m_FilterDimensionality
Definition: itkGaussianBlurImageFunction.h:204
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::GaussianBlurImageFunction::OperatorImageFunctionPointer
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
Definition: itkGaussianBlurImageFunction.h:83
itk::GaussianBlurImageFunction::m_InternalImage
InternalImagePointer m_InternalImage
Definition: itkGaussianBlurImageFunction.h:191
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkNeighborhoodOperatorImageFunction.h
itk::GaussianBlurImageFunction::m_OperatorInternalImageFunction
OperatorInternalImageFunctionPointer m_OperatorInternalImageFunction
Definition: itkGaussianBlurImageFunction.h:188
itk::GaussianBlurImageFunction::m_MaximumKernelWidth
int m_MaximumKernelWidth
Definition: itkGaussianBlurImageFunction.h:201
itk::GaussianBlurImageFunction::OperatorInternalImageFunctionPointer
typename OperatorInternalImageFunctionType::Pointer OperatorInternalImageFunctionPointer
Definition: itkGaussianBlurImageFunction.h:86
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itkGaussianOperator.h