ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkDiscreteHessianGaussianImageFunction.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 __itkDiscreteHessianGaussianImageFunction_h
19 #define __itkDiscreteHessianGaussianImageFunction_h
20 
24 
25 namespace itk
26 {
45 template< class TInputImage, class TOutput = double >
47  public ImageFunction< TInputImage,
48  SymmetricSecondRankTensor< TOutput, ::itk::GetImageDimension< TInputImage >::ImageDimension >,
49  TOutput >
50 {
51 public:
52 
55 
57  typedef ImageFunction< TInputImage,
59  TOutput > Superclass;
60 
64 
66  itkNewMacro(Self);
67 
70 
72  typedef typename Superclass::InputImageType InputImageType;
73  typedef typename Superclass::InputPixelType InputPixelType;
74  typedef typename Superclass::IndexType IndexType;
76  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
77  typedef typename Superclass::PointType PointType;
78 
80  itkStaticConstMacro(ImageDimension2, unsigned int,
81  InputImageType::ImageDimension);
82 
84  typedef SymmetricSecondRankTensor< TOutput,
86  typedef typename Superclass::OutputType OutputType;
87 
89 
90  typedef itk::GaussianDerivativeOperator< TOutput,
91  itkGetStaticConstMacro(ImageDimension2) >
93 
97  3 *itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType;
98 
100 
103  typedef FixedArray< KernelType, itkGetStaticConstMacro(ImageDimension2)
104  * ( itkGetStaticConstMacro(ImageDimension2) + 1 ) / 2 > KernelArrayType;
105 
111 
114 public:
115 
117  virtual OutputType Evaluate(const PointType & point) const;
118 
120  virtual OutputType EvaluateAtIndex(const IndexType & index) const;
121 
123  virtual OutputType EvaluateAtContinuousIndex(
124  const ContinuousIndexType & index) const;
125 
130  itkSetMacro(Variance, VarianceArrayType);
131  itkGetConstMacro(Variance, const VarianceArrayType);
132  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
134 
136  virtual void SetVariance(double variance)
137  {
138  m_Variance.Fill(variance);
139  this->Modified();
140  }
142 
145  void SetSigma(const double sigma)
146  {
147  SetVariance(sigma * sigma);
148  }
149 
155  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
156  itkGetConstMacro(MaximumError, double);
158 
162  itkSetMacro(NormalizeAcrossScale, bool);
163  itkGetConstMacro(NormalizeAcrossScale, bool);
164  itkBooleanMacro(NormalizeAcrossScale);
166 
168  itkSetMacro(UseImageSpacing, bool);
169  itkGetConstMacro(UseImageSpacing, bool);
170  itkBooleanMacro(UseImageSpacing);
172 
177  itkSetMacro(MaximumKernelWidth, unsigned int);
178  itkGetConstMacro(MaximumKernelWidth, unsigned int);
180 
182  itkSetMacro(InterpolationMode, InterpolationModeType);
183  itkGetConstMacro(InterpolationMode, InterpolationModeType);
185 
190  virtual void SetInputImage(const InputImageType *ptr);
191 
194  virtual void Initialize() { RecomputeGaussianKernel(); }
195 protected:
196 
199 
201 
202  void operator=(const Self &){}
203  void PrintSelf(std::ostream & os, Indent indent) const;
204 
205  void RecomputeGaussianKernel();
206 
207 private:
208 
211 
215 
219  unsigned int m_MaximumKernelWidth;
220 
226 
231 
234 
237 
240 
243 };
244 } // namespace itk
245 
246 #if ITK_TEMPLATE_TXX
247 #include "itkDiscreteHessianGaussianImageFunction.hxx"
248 #endif
249 
250 #endif
251