ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGaussianBlurImageFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
42 template< typename TInputImage, typename TOutput = double >
43 class ITK_TEMPLATE_EXPORT GaussianBlurImageFunction:
44  public ImageFunction< TInputImage, TOutput >
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(GaussianBlurImageFunction);
48 
51 
54 
58 
60  itkNewMacro(Self);
61 
64 
66  using InputImageType = TInputImage;
67  using InputPixelType = typename InputImageType::PixelType;
68  using IndexType = typename Superclass::IndexType;
69  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
70 
72  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
73 
75  TOutput, Self::ImageDimension >;
78 
83  InputPixelRealType, Self::ImageDimension >;
85 
88 
91 
95 
97  using PointType = typename Superclass::PointType;
98 
100  TOutput Evaluate(const PointType & point) const override;
101 
103  TOutput EvaluateAtIndex(const IndexType & index) const override;
104 
106  TOutput EvaluateAtContinuousIndex(
107  const ContinuousIndexType & index) const override;
108 
115  void SetSigma(const double *sigma);
116 
117  void SetSigma(const float *sigma);
118 
119  void SetSigma(const double sigma);
120 
121  itkSetMacro(Sigma, SigmaArrayType);
122  itkGetConstReferenceMacro(Sigma, SigmaArrayType);
123 
128  void SetInputImage(const InputImageType *ptr) override;
129 
133  itkSetMacro(Extent, ExtentArrayType);
134  itkGetConstReferenceMacro(Extent, ExtentArrayType);
135  void SetExtent(const double *extent);
137 
138  void SetExtent(const double extent);
139 
143  itkSetMacro(MaximumError, ErrorArrayType);
144  itkGetConstReferenceMacro(MaximumError, ErrorArrayType);
146 
151  itkSetMacro(MaximumKernelWidth, int);
152  itkGetConstMacro(MaximumKernelWidth, int);
154 
160  itkSetMacro(UseImageSpacing, bool);
161  itkGetConstMacro(UseImageSpacing, bool);
162  itkBooleanMacro(UseImageSpacing);
164 
165 protected:
167  ~GaussianBlurImageFunction() override = default;
168 
169  void PrintSelf(std::ostream & os, Indent indent) const override;
170 
171  void RecomputeGaussianKernel();
172 
173  void RecomputeContinuousGaussianKernel(const double *offset) const;
174 
175 private:
176 
177  virtual TOutput EvaluateAtIndex(
178  const IndexType & index, const OperatorArrayType & operatorArray) const;
179 
186 
192 
196 
199 
202 
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkGaussianBlurImageFunction.hxx"
210 #endif
211 
212 #endif
typename Superclass::ContinuousIndexType ContinuousIndexType
typename GaussianFunctionType::Pointer GaussianFunctionPointer
A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian kernel...
Light weight base class for most itk classes.
Define numeric traits for std::vector.
typename InternalImageType::Pointer InternalImagePointer
OperatorInternalImageFunctionPointer m_OperatorInternalImageFunction
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
typename NumericTraits< InputPixelType >::RealType InputPixelRealType
Compute the convolution of a neighborhood operator with the image at a specific location in space...
Compute the convolution of a neighborhood operator with the image at a specific location in space...
typename Superclass::IndexType IndexType
N-dimensional Gaussian spatial function class.
typename OperatorInternalImageFunctionType::Pointer OperatorInternalImageFunctionPointer
typename Superclass::PointType PointType
OperatorImageFunctionPointer m_OperatorImageFunction
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Evaluates a function of an image at specified position.
Templated n-dimensional image class.
Definition: itkImage.h:75
typename InputImageType::PixelType InputPixelType