ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDiscreteGaussianDerivativeImageFunction.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 itkDiscreteGaussianDerivativeImageFunction_h
19 #define itkDiscreteGaussianDerivativeImageFunction_h
20 
23 
24 namespace itk
25 {
46 template< typename TInputImage, typename TOutput = double >
47 class ITK_TEMPLATE_EXPORT DiscreteGaussianDerivativeImageFunction:
48  public ImageFunction< TInputImage, TOutput, TOutput >
49 {
50 public:
51 
54 
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 
80  using OutputType = typename Superclass::OutputType;
81 
85 
87  Self::ImageDimension2 >;
88 
91  Self::ImageDimension2 >;
92 
95 
99  < InputImageType, TOutput >;
101 
104 
105 public:
106 
108  OutputType Evaluate(const PointType & point) const override;
109 
111  OutputType EvaluateAtIndex(const IndexType & index) const override;
112 
114  OutputType EvaluateAtContinuousIndex(
115  const ContinuousIndexType & index) const override;
116 
123  itkSetMacro(Variance, VarianceArrayType);
124  itkGetConstMacro(Variance, const VarianceArrayType);
125  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
127 
129  virtual void SetVariance(double variance)
130  {
131  m_Variance.Fill(variance);
132  this->Modified();
133  }
135 
139  void SetSigma(const double sigma)
140  {
141  SetVariance(sigma * sigma);
142  }
143 
150  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
151  itkGetConstMacro(MaximumError, double);
153 
155  itkSetMacro(Order, OrderArrayType);
156  itkGetConstMacro(Order, const OrderArrayType);
157  itkSetVectorMacro(Order, unsigned int, OrderArrayType::Length);
159 
161  virtual void SetOrder(unsigned int order)
162  {
163  m_Order.Fill(order);
164  this->Modified();
165  }
167 
171  itkSetMacro(NormalizeAcrossScale, bool);
172  itkGetConstMacro(NormalizeAcrossScale, bool);
173  itkBooleanMacro(NormalizeAcrossScale);
175 
177  itkSetMacro(UseImageSpacing, bool);
178  itkGetConstMacro(UseImageSpacing, bool);
179  itkBooleanMacro(UseImageSpacing);
181 
186  itkSetMacro(MaximumKernelWidth, unsigned int);
187  itkGetConstMacro(MaximumKernelWidth, unsigned int);
189 
191  itkSetMacro(InterpolationMode, InterpolationModeType);
192  itkGetConstMacro(InterpolationMode, InterpolationModeType);
194 
199  void SetInputImage(const InputImageType *ptr) override;
200 
204  virtual void Initialize() { RecomputeGaussianKernel(); }
205 
206 protected:
207 
210 
212 
213  void operator=(const Self &){}
214  void PrintSelf(std::ostream & os, Indent indent) const override;
215 
216  void RecomputeGaussianKernel();
217 
218 private:
219 
222 
225 
229 
233  unsigned int m_MaximumKernelWidth;
234 
237 
241 
244 
247 
250 
253 };
254 } // namespace itk
255 
256 #ifndef ITK_MANUAL_INSTANTIATION
257 #include "itkDiscreteGaussianDerivativeImageFunction.hxx"
258 #endif
259 
260 #endif
Light weight base class for most itk classes.
Compute the convolution of a neighborhood operator with the image at a specific location in space...
Compute the discrete gaussian derivatives of an 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
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
Evaluates a function of an image at specified position.