ITK  4.2.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< class TInputImage, class 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 public:
110 
112  virtual OutputType Evaluate(const PointType & point) const;
113 
115  virtual OutputType EvaluateAtIndex(const IndexType & index) const;
116 
118  virtual OutputType EvaluateAtContinuousIndex(
119  const ContinuousIndexType & index) const;
120 
125  itkSetMacro(Variance, VarianceArrayType);
126  itkGetConstMacro(Variance, const VarianceArrayType);
127  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
129 
131  virtual void SetVariance(double variance)
132  {
133  m_Variance.Fill(variance);
134  this->Modified();
135  }
137 
140  void SetSigma(const double sigma)
141  {
142  SetVariance(sigma * sigma);
143  }
144 
150  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
151  itkGetConstMacro(MaximumError, double);
153 
157  itkSetMacro(NormalizeAcrossScale, bool);
158  itkGetConstMacro(NormalizeAcrossScale, bool);
159  itkBooleanMacro(NormalizeAcrossScale);
161 
163  itkSetMacro(UseImageSpacing, bool);
164  itkGetConstMacro(UseImageSpacing, bool);
165  itkBooleanMacro(UseImageSpacing);
167 
172  itkSetMacro(MaximumKernelWidth, unsigned int);
173  itkGetConstMacro(MaximumKernelWidth, unsigned int);
175 
177  itkSetMacro(InterpolationMode, InterpolationModeType);
178  itkGetConstMacro(InterpolationMode, InterpolationModeType);
180 
185  virtual void SetInputImage(const InputImageType *ptr);
186 
189  virtual void Initialize() { RecomputeGaussianKernel(); }
190 protected:
191 
194 
196 
197  void operator=(const Self &){}
198  void PrintSelf(std::ostream & os, Indent indent) const;
199 
200  void RecomputeGaussianKernel();
201 
202  // void RecomputeContinuousGaussianKernel(
203  // const double* offset) const;
204 private:
205 
208 
212 
216  unsigned int m_MaximumKernelWidth;
217 
222 
225 
228 
231 
234 
237 };
238 } // namespace itk
239 
240 #if ITK_TEMPLATE_TXX
241 #include "itkDiscreteGradientMagnitudeGaussianImageFunction.hxx"
242 #endif
243 
244 #endif
245