ITK  5.1.0
Insight 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, SymmetricSecondRankTensor<TOutput, TInputImage::ImageDimension>, TOutput>
48 {
49 public:
50 
53 
55  using Superclass =
57 
61 
63  itkNewMacro(Self);
64 
67 
69  using InputImageType = typename Superclass::InputImageType;
70  using InputPixelType = typename Superclass::InputPixelType;
71  using IndexType = typename Superclass::IndexType;
73  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
74  using PointType = typename Superclass::PointType;
75 
77  static constexpr unsigned int ImageDimension2 = InputImageType::ImageDimension;
78 
81  using OutputType = typename Superclass::OutputType;
82 
84 
86 
90 
92 
95  using KernelArrayType = FixedArray<KernelType, Self::ImageDimension2 *(Self::ImageDimension2 + 1) / 2>;
96 
101 
104  {
106  LinearInterpolation
107  };
108 
109 public:
111  OutputType
112  Evaluate(const PointType & point) const override;
113 
115  OutputType
116  EvaluateAtIndex(const IndexType & index) const override;
117 
119  OutputType
120  EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override;
121 
126  itkSetMacro(Variance, VarianceArrayType);
127  itkGetConstMacro(Variance, const VarianceArrayType);
128  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
130 
132  virtual void
133  SetVariance(double variance)
134  {
135  m_Variance.Fill(variance);
136  this->Modified();
137  }
139 
142  void
143  SetSigma(const double sigma)
144  {
145  SetVariance(sigma * sigma);
146  }
147 
153  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
154  itkGetConstMacro(MaximumError, double);
156 
160  itkSetMacro(NormalizeAcrossScale, bool);
161  itkGetConstMacro(NormalizeAcrossScale, bool);
162  itkBooleanMacro(NormalizeAcrossScale);
164 
166  itkSetMacro(UseImageSpacing, bool);
167  itkGetConstMacro(UseImageSpacing, bool);
168  itkBooleanMacro(UseImageSpacing);
170 
175  itkSetMacro(MaximumKernelWidth, unsigned int);
176  itkGetConstMacro(MaximumKernelWidth, unsigned int);
178 
180  itkSetMacro(InterpolationMode, InterpolationModeType);
181  itkGetConstMacro(InterpolationMode, InterpolationModeType);
183 
188  void
189  SetInputImage(const InputImageType * ptr) override;
190 
193  virtual void
195  {
196  RecomputeGaussianKernel();
197  }
198 
199 protected:
202 
204 
205  void
206  operator=(const Self &)
207  {}
208  void
209  PrintSelf(std::ostream & os, Indent indent) const override;
210 
211  void
212  RecomputeGaussianKernel();
213 
214 private:
217 
221 
225  unsigned int m_MaximumKernelWidth;
226 
232 
237 
240 
243 
246 
249 };
250 } // namespace itk
251 
252 #ifndef ITK_MANUAL_INSTANTIATION
253 # include "itkDiscreteHessianGaussianImageFunction.hxx"
254 #endif
255 
256 #endif
itk::DiscreteHessianGaussianImageFunction::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkDiscreteHessianGaussianImageFunction.h:69
itk::DiscreteHessianGaussianImageFunction::NearestNeighbourInterpolation
Definition: itkDiscreteHessianGaussianImageFunction.h:105
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::DiscreteHessianGaussianImageFunction::DiscreteHessianGaussianImageFunction
DiscreteHessianGaussianImageFunction(const Self &)
Definition: itkDiscreteHessianGaussianImageFunction.h:201
itk::DiscreteHessianGaussianImageFunction::InterpolationModeType
InterpolationModeType
Definition: itkDiscreteHessianGaussianImageFunction.h:103
itk::Neighborhood< TOutput, Self::ImageDimension2 >
itk::DiscreteHessianGaussianImageFunction::m_MaximumKernelWidth
unsigned int m_MaximumKernelWidth
Definition: itkDiscreteHessianGaussianImageFunction.h:225
itk::DiscreteHessianGaussianImageFunction::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkDiscreteHessianGaussianImageFunction.h:245
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DiscreteHessianGaussianImageFunction::m_KernelArray
KernelArrayType m_KernelArray
Definition: itkDiscreteHessianGaussianImageFunction.h:236
itk::DiscreteHessianGaussianImageFunction::~DiscreteHessianGaussianImageFunction
~DiscreteHessianGaussianImageFunction() override
Definition: itkDiscreteHessianGaussianImageFunction.h:203
itk::DiscreteHessianGaussianImageFunction::InputPixelType
typename Superclass::InputPixelType InputPixelType
Definition: itkDiscreteHessianGaussianImageFunction.h:70
itk::SymmetricSecondRankTensor
Represent a symmetric tensor of second rank.
Definition: itkSymmetricSecondRankTensor.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::DiscreteHessianGaussianImageFunction::m_Variance
VarianceArrayType m_Variance
Definition: itkDiscreteHessianGaussianImageFunction.h:216
itk::DiscreteHessianGaussianImageFunction::Initialize
virtual void Initialize()
Definition: itkDiscreteHessianGaussianImageFunction.h:194
itk::DiscreteHessianGaussianImageFunction::OperatorImageFunctionPointer
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
Definition: itkDiscreteHessianGaussianImageFunction.h:100
itk::DiscreteHessianGaussianImageFunction::operator=
void operator=(const Self &)
Definition: itkDiscreteHessianGaussianImageFunction.h:206
itk::ImageFunction
Evaluates a function of an image at specified position.
Definition: itkImageFunction.h:54
itk::DiscreteHessianGaussianImageFunction::SetSigma
void SetSigma(const double sigma)
Definition: itkDiscreteHessianGaussianImageFunction.h:143
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DiscreteHessianGaussianImageFunction::m_OperatorArray
GaussianDerivativeOperatorArrayType m_OperatorArray
Definition: itkDiscreteHessianGaussianImageFunction.h:231
itkSymmetricSecondRankTensor.h
itkGaussianDerivativeOperator.h
itk::DiscreteHessianGaussianImageFunction::SetVariance
virtual void SetVariance(double variance)
Definition: itkDiscreteHessianGaussianImageFunction.h:133
itk::NeighborhoodOperatorImageFunction
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
Definition: itkNeighborhoodOperatorImageFunction.h:41
itk::DiscreteHessianGaussianImageFunction::IndexType
typename Superclass::IndexType IndexType
Definition: itkDiscreteHessianGaussianImageFunction.h:71
itk::FixedArray< double, Self::ImageDimension2 >
itk::DiscreteHessianGaussianImageFunction::m_MaximumError
double m_MaximumError
Definition: itkDiscreteHessianGaussianImageFunction.h:220
itk::DiscreteHessianGaussianImageFunction::IndexValueType
typename Superclass::IndexValueType IndexValueType
Definition: itkDiscreteHessianGaussianImageFunction.h:72
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::DiscreteHessianGaussianImageFunction
Compute the Hessian Gaussian of an image at a specific location in space by calculating discrete seco...
Definition: itkDiscreteHessianGaussianImageFunction.h:46
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itkNeighborhoodOperatorImageFunction.h
itk::DiscreteHessianGaussianImageFunction::ContinuousIndexType
typename Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkDiscreteHessianGaussianImageFunction.h:73
itk::DiscreteHessianGaussianImageFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkDiscreteHessianGaussianImageFunction.h:81
itk::DiscreteHessianGaussianImageFunction::m_InterpolationMode
InterpolationModeType m_InterpolationMode
Definition: itkDiscreteHessianGaussianImageFunction.h:248
itk::DiscreteHessianGaussianImageFunction::m_OperatorImageFunction
OperatorImageFunctionPointer m_OperatorImageFunction
Definition: itkDiscreteHessianGaussianImageFunction.h:239
itk::DiscreteHessianGaussianImageFunction::m_NormalizeAcrossScale
bool m_NormalizeAcrossScale
Definition: itkDiscreteHessianGaussianImageFunction.h:242
itk::GaussianDerivativeOperator
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel.
Definition: itkGaussianDerivativeOperator.h:81
itk::DiscreteHessianGaussianImageFunction::PointType
typename Superclass::PointType PointType
Definition: itkDiscreteHessianGaussianImageFunction.h:74