ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkDiscreteGaussianDerivativeImageFunction.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 __itkDiscreteGaussianDerivativeImageFunction_h
19 #define __itkDiscreteGaussianDerivativeImageFunction_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  itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType;
94 
97 
103 
106 public:
107 
109  virtual OutputType Evaluate(const PointType & point) const;
110 
112  virtual OutputType EvaluateAtIndex(const IndexType & index) const;
113 
115  virtual OutputType EvaluateAtContinuousIndex(
116  const ContinuousIndexType & index) const;
117 
124  itkSetMacro(Variance, VarianceArrayType);
125  itkGetConstMacro(Variance, const VarianceArrayType);
126  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
128 
130  virtual void SetVariance(double variance)
131  {
132  m_Variance.Fill(variance);
133  this->Modified();
134  }
136 
140  void SetSigma(const double sigma)
141  {
142  SetVariance(sigma * sigma);
143  }
144 
151  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
152  itkGetConstMacro(MaximumError, double);
154 
156  itkSetMacro(Order, OrderArrayType);
157  itkGetConstMacro(Order, const OrderArrayType);
158  itkSetVectorMacro(Order, unsigned int, OrderArrayType::Length);
160 
162  virtual void SetOrder(unsigned int order)
163  {
164  m_Order.Fill(order);
165  this->Modified();
166  }
168 
172  itkSetMacro(NormalizeAcrossScale, bool);
173  itkGetConstMacro(NormalizeAcrossScale, bool);
174  itkBooleanMacro(NormalizeAcrossScale);
176 
178  itkSetMacro(UseImageSpacing, bool);
179  itkGetConstMacro(UseImageSpacing, bool);
180  itkBooleanMacro(UseImageSpacing);
182 
187  itkSetMacro(MaximumKernelWidth, unsigned int);
188  itkGetConstMacro(MaximumKernelWidth, unsigned int);
190 
192  itkSetMacro(InterpolationMode, InterpolationModeType);
193  itkGetConstMacro(InterpolationMode, InterpolationModeType);
195 
200  virtual void SetInputImage(const InputImageType *ptr);
201 
205  virtual void Initialize() { RecomputeGaussianKernel(); }
206 protected:
207 
210 
212 
213  void operator=(const Self &){}
214  void PrintSelf(std::ostream & os, Indent indent) const;
215 
216  void RecomputeGaussianKernel();
217 
218 private:
219 
222 
225 
229 
233  unsigned int m_MaximumKernelWidth;
234 
237 
241 
244 
247 
250 
253 };
254 } // namespace itk
255 
256 #if ITK_TEMPLATE_TXX
257 #include "itkDiscreteGaussianDerivativeImageFunction.hxx"
258 #endif
259 
260 #endif
261