Orfeo Toolbox  3.16
itkGaussianOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkGaussianOperator.h,v $
5  Language: C++
6  Date: $Date: 2008-10-17 01:08:45 $
7  Version: $Revision: 1.26 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkGaussianOperator_h
18 #define __itkGaussianOperator_h
19 
21 #include <math.h>
22 namespace itk {
23 
59 template<class TPixel,unsigned int VDimension=2,
60  class TAllocator = NeighborhoodAllocator<TPixel> >
62  : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
63 {
64 public:
68 
70  GaussianOperator() : m_Variance(1), m_MaximumError(.01), m_MaximumKernelWidth(30) { }
71 
73  GaussianOperator(const Self &other)
74  : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
75  {
76  m_Variance = other.m_Variance;
77  m_MaximumError = other.m_MaximumError;
78  m_MaximumKernelWidth = other.m_MaximumKernelWidth;
79  }
80 
82  Self &operator=(const Self &other)
83  {
84  Superclass::operator=(other);
85  m_Variance = other.m_Variance;
86  m_MaximumError = other.m_MaximumError;
87  m_MaximumKernelWidth = other.m_MaximumKernelWidth;
88  return *this;
89  }
90 
92  void SetVariance(const double &variance)
93  {
94  m_Variance = variance;
95  }
96 
101  void SetMaximumError(const double &max_error)
102  {
103  if (max_error >= 1 || max_error <= 0)
104  {
105  itkExceptionMacro("Maximum Error Must be in the range [ 0.0 , 1.0 ]");
106  }
107 
108  m_MaximumError = max_error;
109  }
110 
112  double GetVariance()
113  { return m_Variance; }
114 
119  double GetMaximumError()
120  { return m_MaximumError; }
121 
126  void SetMaximumKernelWidth( unsigned int n )
127  { m_MaximumKernelWidth = n; }
128 
130  unsigned int GetMaximumKernelWidth() const
131  { return m_MaximumKernelWidth; }
132 
134  virtual void PrintSelf(std::ostream &os, Indent i) const
135  {
136  os << i << "GaussianOperator { this=" << this
137  << ", m_Variance = " << m_Variance
138  << ", m_MaximumError = " << m_MaximumError
139  << "} " << std::endl;
140  Superclass::PrintSelf(os, i.GetNextIndent());
141  }
142 
143 protected:
145 
147  double ModifiedBesselI0(double);
148 
151  double ModifiedBesselI1(double);
152 
155  double ModifiedBesselI(int, double);
156 
158  CoefficientVector GenerateCoefficients();
159 
161  void Fill(const CoefficientVector& coeff)
162  { this->FillCenteredDirectional(coeff); }
163 
164 private:
166  double m_Variance;
167 
171 
175  unsigned int m_MaximumKernelWidth;
176 
178  const char *GetNameOfClass()
179  { return "itkGaussianOperator"; }
180 
181 };
182 
183 } // namespace itk
184 
185 // Define instantiation macro for this template.
186 #define ITK_TEMPLATE_GaussianOperator(_, EXPORT, x, y) namespace itk { \
187  _(2(class EXPORT GaussianOperator< ITK_TEMPLATE_2 x >)) \
188  namespace Templates { typedef GaussianOperator< ITK_TEMPLATE_2 x > \
189  GaussianOperator##y; } \
190  }
191 
192 #if ITK_TEMPLATE_EXPLICIT
193 # include "Templates/itkGaussianOperator+-.h"
194 #endif
195 
196 #if ITK_TEMPLATE_TXX
197 # include "itkGaussianOperator.txx"
198 #endif
199 
200 #endif

Generated at Sat May 18 2013 23:40:04 for Orfeo Toolbox with doxygen 1.8.3.1