ITK  4.3.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, 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,
85  TInputImage::ImageDimension >
87  typedef typename Superclass::OutputType OutputType;
88 
90 
91  typedef itk::GaussianDerivativeOperator< TOutput,
92  itkGetStaticConstMacro(ImageDimension2) >
94 
98  3 *itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType;
99 
101 
104  typedef FixedArray< KernelType, itkGetStaticConstMacro(ImageDimension2)
105  * ( itkGetStaticConstMacro(ImageDimension2) + 1 ) / 2 > KernelArrayType;
106 
112 
115 
116 public:
117 
119  virtual OutputType Evaluate(const PointType & point) const;
120 
122  virtual OutputType EvaluateAtIndex(const IndexType & index) const;
123 
125  virtual OutputType EvaluateAtContinuousIndex(
126  const ContinuousIndexType & index) const;
127 
132  itkSetMacro(Variance, VarianceArrayType);
133  itkGetConstMacro(Variance, const VarianceArrayType);
134  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
136 
138  virtual void SetVariance(double variance)
139  {
140  m_Variance.Fill(variance);
141  this->Modified();
142  }
144 
147  void SetSigma(const double sigma)
148  {
149  SetVariance(sigma * sigma);
150  }
151 
157  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
158  itkGetConstMacro(MaximumError, double);
160 
164  itkSetMacro(NormalizeAcrossScale, bool);
165  itkGetConstMacro(NormalizeAcrossScale, bool);
166  itkBooleanMacro(NormalizeAcrossScale);
168 
170  itkSetMacro(UseImageSpacing, bool);
171  itkGetConstMacro(UseImageSpacing, bool);
172  itkBooleanMacro(UseImageSpacing);
174 
179  itkSetMacro(MaximumKernelWidth, unsigned int);
180  itkGetConstMacro(MaximumKernelWidth, unsigned int);
182 
184  itkSetMacro(InterpolationMode, InterpolationModeType);
185  itkGetConstMacro(InterpolationMode, InterpolationModeType);
187 
192  virtual void SetInputImage(const InputImageType *ptr);
193 
196  virtual void Initialize() { RecomputeGaussianKernel(); }
197 
198 protected:
199 
202 
204 
205  void operator=(const Self &){}
206  void PrintSelf(std::ostream & os, Indent indent) const;
207 
208  void RecomputeGaussianKernel();
209 
210 private:
211 
214 
218 
222  unsigned int m_MaximumKernelWidth;
223 
229 
234 
237 
240 
243 
246 };
247 } // namespace itk
248 
249 #ifndef ITK_MANUAL_INSTANTIATION
250 #include "itkDiscreteHessianGaussianImageFunction.hxx"
251 #endif
252 
253 #endif
254