ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDiscreteGradientMagnitudeGaussianImageFunction.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 itkDiscreteGradientMagnitudeGaussianImageFunction_h
19 #define itkDiscreteGradientMagnitudeGaussianImageFunction_h
20 
23 
24 namespace itk
25 {
46 template< typename TInputImage, typename TOutput = double >
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  2 *Self::ImageDimension2 >;
92 
95 
99 
102  < InputImageType, TOutput >;
104 
107 
108 public:
109 
111  OutputType Evaluate(const PointType & point) const override;
112 
114  OutputType EvaluateAtIndex(const IndexType & index) const override;
115 
117  OutputType EvaluateAtContinuousIndex(
118  const ContinuousIndexType & index) const override;
119 
124  itkSetMacro(Variance, VarianceArrayType);
125  itkGetConstMacro(Variance, const VarianceArrayType);
126  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
128 
130  virtual void SetVariance(double variance)
131  {
132  m_Variance.Fill(variance);
133  this->Modified();
134  }
136 
139  void SetSigma(const double sigma)
140  {
141  SetVariance(sigma * sigma);
142  }
143 
149  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
150  itkGetConstMacro(MaximumError, double);
152 
156  itkSetMacro(NormalizeAcrossScale, bool);
157  itkGetConstMacro(NormalizeAcrossScale, bool);
158  itkBooleanMacro(NormalizeAcrossScale);
160 
162  itkSetMacro(UseImageSpacing, bool);
163  itkGetConstMacro(UseImageSpacing, bool);
164  itkBooleanMacro(UseImageSpacing);
166 
171  itkSetMacro(MaximumKernelWidth, unsigned int);
172  itkGetConstMacro(MaximumKernelWidth, unsigned int);
174 
176  itkSetMacro(InterpolationMode, InterpolationModeType);
177  itkGetConstMacro(InterpolationMode, InterpolationModeType);
179 
184  void SetInputImage(const InputImageType *ptr) override;
185 
188  virtual void Initialize() { RecomputeGaussianKernel(); }
189 
190 protected:
191 
194 
196 
197  void operator=(const Self &){}
198  void PrintSelf(std::ostream & os, Indent indent) const override;
199 
200  void RecomputeGaussianKernel();
201 
202  // void RecomputeContinuousGaussianKernel(
203  // const double* offset) const;
204 
205 private:
206 
209 
213 
217  unsigned int m_MaximumKernelWidth;
218 
223 
226 
229 
232 
235 
238 };
239 } // namespace itk
240 
241 #ifndef ITK_MANUAL_INSTANTIATION
242 #include "itkDiscreteGradientMagnitudeGaussianImageFunction.hxx"
243 #endif
244 
245 #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...
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel...
Compute the discrete gradient magnitude gaussian of an the image at a specific location in space...
signed long IndexValueType
Definition: itkIntTypes.h:90
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Evaluates a function of an image at specified position.