ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDiscreteHessianGaussianImageFunction.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 itkDiscreteHessianGaussianImageFunction_h
19 #define itkDiscreteHessianGaussianImageFunction_h
20 
24 
25 namespace itk
26 {
45 template< typename TInputImage, typename TOutput = double >
46 class ITK_TEMPLATE_EXPORT DiscreteHessianGaussianImageFunction:
47  public ImageFunction< TInputImage,
48  SymmetricSecondRankTensor< TOutput, TInputImage::ImageDimension >,
49  TOutput >
50 {
51 public:
52 
55 
57  using Superclass = ImageFunction< TInputImage,
59  TOutput >;
60 
64 
66  itkNewMacro(Self);
67 
70 
72  using InputImageType = typename Superclass::InputImageType;
73  using InputPixelType = typename Superclass::InputPixelType;
74  using IndexType = typename Superclass::IndexType;
76  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
77  using PointType = typename Superclass::PointType;
78 
80  static constexpr unsigned int ImageDimension2 = InputImageType::ImageDimension;
81 
83  using TensorType = SymmetricSecondRankTensor< TOutput,
84  TInputImage::ImageDimension >;
85  using OutputType = typename Superclass::OutputType;
86 
88 
90  Self::ImageDimension2 >;
91 
95  3 *Self::ImageDimension2 >;
96 
98 
101  using KernelArrayType = FixedArray< KernelType, Self::ImageDimension2
102  * ( Self::ImageDimension2 + 1 ) / 2 >;
103 
107  < InputImageType, TOutput >;
109 
112 
113 public:
114 
116  OutputType Evaluate(const PointType & point) const override;
117 
119  OutputType EvaluateAtIndex(const IndexType & index) const override;
120 
122  OutputType EvaluateAtContinuousIndex(
123  const ContinuousIndexType & index) const override;
124 
129  itkSetMacro(Variance, VarianceArrayType);
130  itkGetConstMacro(Variance, const VarianceArrayType);
131  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
133 
135  virtual void SetVariance(double variance)
136  {
137  m_Variance.Fill(variance);
138  this->Modified();
139  }
141 
144  void SetSigma(const double sigma)
145  {
146  SetVariance(sigma * sigma);
147  }
148 
154  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
155  itkGetConstMacro(MaximumError, double);
157 
161  itkSetMacro(NormalizeAcrossScale, bool);
162  itkGetConstMacro(NormalizeAcrossScale, bool);
163  itkBooleanMacro(NormalizeAcrossScale);
165 
167  itkSetMacro(UseImageSpacing, bool);
168  itkGetConstMacro(UseImageSpacing, bool);
169  itkBooleanMacro(UseImageSpacing);
171 
176  itkSetMacro(MaximumKernelWidth, unsigned int);
177  itkGetConstMacro(MaximumKernelWidth, unsigned int);
179 
181  itkSetMacro(InterpolationMode, InterpolationModeType);
182  itkGetConstMacro(InterpolationMode, InterpolationModeType);
184 
189  void SetInputImage(const InputImageType *ptr) override;
190 
193  virtual void Initialize() { RecomputeGaussianKernel(); }
194 
195 protected:
196 
199 
201 
202  void operator=(const Self &){}
203  void PrintSelf(std::ostream & os, Indent indent) const override;
204 
205  void RecomputeGaussianKernel();
206 
207 private:
208 
211 
215 
219  unsigned int m_MaximumKernelWidth;
220 
226 
231 
234 
237 
240 
243 };
244 } // namespace itk
245 
246 #ifndef ITK_MANUAL_INSTANTIATION
247 #include "itkDiscreteHessianGaussianImageFunction.hxx"
248 #endif
249 
250 #endif
Light weight base class for most itk classes.
typename Superclass::ContinuousIndexType ContinuousIndexType
Represent a symmetric tensor of second rank.
Compute the convolution of a neighborhood operator with the image at a specific location in space...
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel...
signed long IndexValueType
Definition: itkIntTypes.h:90
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Compute the Hessian Gaussian of an image at a specific location in space by calculating discrete seco...
Evaluates a function of an image at specified position.