ITK 6.0.0
Insight Toolkit
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
itkDiscreteGradientMagnitudeGaussianImageFunction.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 itkDiscreteGradientMagnitudeGaussianImageFunction_h
19#define itkDiscreteGradientMagnitudeGaussianImageFunction_h
20
23
24namespace itk
25{
46template <typename TInputImage, typename TOutput = double>
48 : public ImageFunction<TInputImage, TOutput, TOutput>
49{
50public:
53
56
60
62 itkNewMacro(Self);
63
65 itkOverrideGetNameOfClassMacro(DiscreteGradientMagnitudeGaussianImageFunction);
66
68 using typename Superclass::InputImageType;
69 using typename Superclass::InputPixelType;
70 using typename Superclass::IndexType;
71 using typename Superclass::IndexValueType;
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
96
100
102#if !defined(ITK_LEGACY_REMOVE)
104 static constexpr InterpolationModeEnum NearestNeighbourInterpolation =
105 InterpolationModeEnum::NearestNeighbourInterpolation;
106 static constexpr InterpolationModeEnum LinearInterpolation = InterpolationModeEnum::LinearInterpolation;
107#endif
108
109public:
112 Evaluate(const PointType & point) const override;
113
116 EvaluateAtIndex(const IndexType & index) const override;
117
120 EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override;
121
127 itkSetMacro(Variance, VarianceArrayType);
128 itkGetConstMacro(Variance, const VarianceArrayType);
129 itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
131
133 virtual void
134 SetVariance(double variance)
135 {
136 m_Variance.Fill(variance);
137 this->Modified();
138 }
139
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);
157
162 itkSetMacro(NormalizeAcrossScale, bool);
163 itkGetConstMacro(NormalizeAcrossScale, bool);
164 itkBooleanMacro(NormalizeAcrossScale);
166
169 itkSetMacro(UseImageSpacing, bool);
170 itkGetConstMacro(UseImageSpacing, bool);
171 itkBooleanMacro(UseImageSpacing);
173
179 itkSetMacro(MaximumKernelWidth, unsigned int);
180 itkGetConstMacro(MaximumKernelWidth, unsigned int);
182
185 itkSetEnumMacro(InterpolationMode, InterpolationModeEnum);
186 itkGetEnumMacro(InterpolationMode, InterpolationModeEnum);
188
193 void
194 SetInputImage(const InputImageType * ptr) override;
195
198 virtual void
203
204protected:
207
209
210 void
212 {}
213 void
214 PrintSelf(std::ostream & os, Indent indent) const override;
215
216 void
218
219 // void RecomputeContinuousGaussianKernel(
220 // const double* offset) const;
221
222private:
225
228 double m_MaximumError{ 0.005 };
229
233 unsigned int m_MaximumKernelWidth{ 30 };
234
239
242
245
248
250 bool m_UseImageSpacing{ true };
251
253 InterpolationModeEnum m_InterpolationMode{ InterpolationModeEnum::NearestNeighbourInterpolation };
254};
255} // namespace itk
256
257#ifndef ITK_MANUAL_INSTANTIATION
258# include "itkDiscreteGradientMagnitudeGaussianImageFunction.hxx"
259#endif
260
261#endif
OutputType Evaluate(const PointType &point) const override
FixedArray< GaussianDerivativeOperatorType, 2 *Self::ImageDimension2 > GaussianDerivativeOperatorArrayType
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
OutputType EvaluateAtIndex(const IndexType &index) const override
void PrintSelf(std::ostream &os, Indent indent) const override
itk::GaussianDerivativeOperatorEnums::InterpolationMode InterpolationModeEnum
void SetInputImage(const InputImageType *ptr) override
virtual void SetVariance(VarianceArrayType _arg)
NeighborhoodOperatorImageFunction< InputImageType, TOutput > OperatorImageFunctionType
itk::GaussianDerivativeOperator< TOutput, Self::ImageDimension2 > GaussianDerivativeOperatorType
Simulate a standard C array with copy semantics.
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel.
typename InputImageType::PixelType InputPixelType
typename InputImageType::IndexValueType IndexValueType
Point< TOutput, Self::ImageDimension > PointType
ContinuousIndex< TOutput, Self::ImageDimension > ContinuousIndexType
Control indentation during Print() invocation.
Definition itkIndent.h:50
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.
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....