ITK  4.13.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  typedef typename Superclass::InputImageType InputImageType;
70  typedef typename Superclass::InputPixelType InputPixelType;
71  typedef typename Superclass::IndexType IndexType;
73  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
74  typedef typename Superclass::PointType PointType;
75 
77  itkStaticConstMacro(ImageDimension2, unsigned int,
78  InputImageType::ImageDimension);
79 
81  typedef typename Superclass::OutputType OutputType;
82 
87 
88  typedef itk::GaussianDerivativeOperator< TOutput,
89  itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorType;
90 
93  2 *itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType;
94 
97 
101 
106 
109 
110 public:
111 
113  virtual OutputType Evaluate(const PointType & point) const ITK_OVERRIDE;
114 
116  virtual OutputType EvaluateAtIndex(const IndexType & index) const ITK_OVERRIDE;
117 
119  virtual OutputType EvaluateAtContinuousIndex(
120  const ContinuousIndexType & index) const ITK_OVERRIDE;
121 
126  itkSetMacro(Variance, VarianceArrayType);
127  itkGetConstMacro(Variance, const VarianceArrayType);
128  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
130 
132  virtual void SetVariance(double variance)
133  {
134  m_Variance.Fill(variance);
135  this->Modified();
136  }
138 
141  void SetSigma(const double sigma)
142  {
143  SetVariance(sigma * sigma);
144  }
145 
151  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
152  itkGetConstMacro(MaximumError, double);
154 
158  itkSetMacro(NormalizeAcrossScale, bool);
159  itkGetConstMacro(NormalizeAcrossScale, bool);
160  itkBooleanMacro(NormalizeAcrossScale);
162 
164  itkSetMacro(UseImageSpacing, bool);
165  itkGetConstMacro(UseImageSpacing, bool);
166  itkBooleanMacro(UseImageSpacing);
168 
173  itkSetMacro(MaximumKernelWidth, unsigned int);
174  itkGetConstMacro(MaximumKernelWidth, unsigned int);
176 
178  itkSetMacro(InterpolationMode, InterpolationModeType);
179  itkGetConstMacro(InterpolationMode, InterpolationModeType);
181 
186  virtual void SetInputImage(const InputImageType *ptr) ITK_OVERRIDE;
187 
190  virtual void Initialize() { RecomputeGaussianKernel(); }
191 
192 protected:
193 
196 
198 
199  void operator=(const Self &){}
200  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
201 
202  void RecomputeGaussianKernel();
203 
204  // void RecomputeContinuousGaussianKernel(
205  // const double* offset) const;
206 
207 private:
208 
211 
215 
219  unsigned int m_MaximumKernelWidth;
220 
225 
228 
231 
234 
237 
240 };
241 } // namespace itk
242 
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkDiscreteGradientMagnitudeGaussianImageFunction.hxx"
245 #endif
246 
247 #endif
Light weight base class for most itk classes.
FixedArray< KernelType, itkGetStaticConstMacro(ImageDimension2) > KernelArrayType
signed long IndexValueType
Definition: itkIntTypes.h:150
FixedArray< double, itkGetStaticConstMacro(ImageDimension2) > VarianceArrayType
Compute the convolution of a neighborhood operator with the image at a specific location in space...
FixedArray< GaussianDerivativeOperatorType, 2 *itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType
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...
FixedArray< unsigned int, itkGetStaticConstMacro(ImageDimension2) > OrderArrayType
Neighborhood< TOutput, itkGetStaticConstMacro(ImageDimension2) > KernelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GaussianDerivativeOperator< TOutput, itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorType
Evaluates a function of an image at specified position.
NeighborhoodOperatorImageFunction< InputImageType, TOutput > OperatorImageFunctionType