ITK  4.3.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 
110 public:
111 
113  virtual OutputType Evaluate(const PointType & point) const;
114 
116  virtual OutputType EvaluateAtIndex(const IndexType & index) const;
117 
119  virtual OutputType EvaluateAtContinuousIndex(
120  const ContinuousIndexType & index) const;
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);
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;
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
248