ITK  6.0.0
Insight Toolkit
itkDiscreteGaussianDerivativeImageFunction.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 * https://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
24namespace itk
25{
46template <typename TInputImage, typename TOutput = double>
47class ITK_TEMPLATE_EXPORT DiscreteGaussianDerivativeImageFunction : public ImageFunction<TInputImage, TOutput, TOutput>
48{
49public:
50
53
56
60
62 itkNewMacro(Self);
63
65 itkOverrideGetNameOfClassMacro(DiscreteGaussianDerivativeImageFunction);
66
68 using typename Superclass::InputImageType;
69 using typename Superclass::InputPixelType;
70 using typename Superclass::IndexType;
71 using typename Superclass::IndexValueType;
72 using typename Superclass::ContinuousIndexType;
73 using typename Superclass::PointType;
74
76 static constexpr unsigned int ImageDimension2 = InputImageType::ImageDimension;
77
79 using typename Superclass::OutputType;
80
84
86
89
92
97
99#if !defined(ITK_LEGACY_REMOVE)
101 static constexpr InterpolationModeEnum NearestNeighbourInterpolation =
102 InterpolationModeEnum::NearestNeighbourInterpolation;
103 static constexpr InterpolationModeEnum LinearInterpolation = InterpolationModeEnum::LinearInterpolation;
104#endif
105
106public:
109 Evaluate(const PointType & point) const override;
110
113 EvaluateAtIndex(const IndexType & index) const override;
114
117 EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override;
118
125 itkSetMacro(Variance, VarianceArrayType);
126 itkGetConstMacro(Variance, const VarianceArrayType);
127 itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
131 virtual void
132 SetVariance(double variance)
133 {
134 m_Variance.Fill(variance);
135 this->Modified();
136 }
142 void
143 SetSigma(const double sigma)
144 {
145 SetVariance(sigma * sigma);
146 }
147
154 itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
155 itkGetConstMacro(MaximumError, double);
159 itkSetMacro(Order, OrderArrayType);
160 itkGetConstMacro(Order, const OrderArrayType);
161 itkSetVectorMacro(Order, unsigned int, OrderArrayType::Length);
165 virtual void
166 SetOrder(unsigned int order)
167 {
168 m_Order.Fill(order);
169 this->Modified();
170 }
176 itkSetMacro(NormalizeAcrossScale, bool);
177 itkGetConstMacro(NormalizeAcrossScale, bool);
178 itkBooleanMacro(NormalizeAcrossScale);
182 itkSetMacro(UseImageSpacing, bool);
183 itkGetConstMacro(UseImageSpacing, bool);
184 itkBooleanMacro(UseImageSpacing);
191 itkSetMacro(MaximumKernelWidth, unsigned int);
192 itkGetConstMacro(MaximumKernelWidth, unsigned int);
196 itkSetEnumMacro(InterpolationMode, InterpolationModeEnum);
197 itkGetEnumMacro(InterpolationMode, InterpolationModeEnum);
204 void
205 SetInputImage(const InputImageType * ptr) override;
206
210 virtual void
212 {
213 RecomputeGaussianKernel();
214 }
215
216protected:
219
221
222 void
224 {}
225 void
226 PrintSelf(std::ostream & os, Indent indent) const override;
227
228 void
230
231private:
233 VarianceArrayType m_Variance{};
234
236 OrderArrayType m_Order{};
237
240 double m_MaximumError{ 0.005 };
241
245 unsigned int m_MaximumKernelWidth{ 30 };
246
249
252 KernelType m_DerivativeKernel{};
253
255 OperatorImageFunctionPointer m_OperatorImageFunction{};
256
258 bool m_NormalizeAcrossScale{ true };
259
261 bool m_UseImageSpacing{ true };
262
264 InterpolationModeEnum m_InterpolationMode{ InterpolationModeEnum::NearestNeighbourInterpolation };
265};
266} // namespace itk
267
268#ifndef ITK_MANUAL_INSTANTIATION
269# include "itkDiscreteGaussianDerivativeImageFunction.hxx"
270#endif
271
272#endif
Compute the discrete gaussian derivatives of an the image at a specific location in space,...
void PrintSelf(std::ostream &os, Indent indent) const override
~DiscreteGaussianDerivativeImageFunction() override=default
typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer
OutputType Evaluate(const PointType &point) const override
void SetInputImage(const InputImageType *ptr) override
OutputType EvaluateAtIndex(const IndexType &index) const override
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel.
Evaluates a function of an image at specified position.
typename InputImageType::IndexType IndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Compute the convolution of a neighborhood operator with the image at a specific location in space,...
A light-weight container object for storing an N-dimensional neighborhood of values.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
long IndexValueType
Definition: itkIntTypes.h:93