Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkGaussianOperator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGaussianOperator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/08/06 02:18:36 $
00007   Version:   $Revision: 1.23 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkGaussianOperator_h
00018 #define __itkGaussianOperator_h
00019 
00020 #include "itkNeighborhoodOperator.h"
00021 #include <math.h>
00022 namespace itk {
00023 
00059 template<class TPixel,unsigned int VDimension=2,
00060   class TAllocator = NeighborhoodAllocator<TPixel> >
00061 class ITK_EXPORT GaussianOperator
00062   : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
00063 {
00064 public:
00066   typedef GaussianOperator Self;
00067   typedef NeighborhoodOperator<TPixel, VDimension, TAllocator>  Superclass;
00068   
00070   GaussianOperator() : m_Variance(1), m_MaximumError(.01), m_MaximumKernelWidth(30) { }
00071 
00073   GaussianOperator(const Self &other)
00074     : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00075   {
00076     m_Variance = other.m_Variance;
00077     m_MaximumError = other.m_MaximumError;
00078     m_MaximumKernelWidth = other.m_MaximumKernelWidth;
00079   }
00080 
00082   Self &operator=(const Self &other)
00083   {
00084     Superclass::operator=(other);
00085     m_Variance = other.m_Variance;
00086     m_MaximumError = other.m_MaximumError;
00087     m_MaximumKernelWidth = other.m_MaximumKernelWidth;
00088     return *this;
00089   }
00090   
00092   void SetVariance(const double &variance)
00093   {  m_Variance = variance;  }
00094 
00099   void SetMaximumError(const double &max_error)
00100   {
00101     if (max_error >= 1 || max_error <= 0)
00102       {
00103         throw ExceptionObject(__FILE__, __LINE__);
00104       }
00105     
00106     m_MaximumError = max_error;
00107   }
00108   
00110   double GetVariance()
00111     {  return m_Variance;  }
00112 
00117   double GetMaximumError()
00118     {    return m_MaximumError;  }
00119 
00124   void SetMaximumKernelWidth( unsigned int n )
00125     {    m_MaximumKernelWidth = n; }
00126 
00128   unsigned int GetMaximumKernelWidth() const
00129     {   return m_MaximumKernelWidth; }
00130   
00132   virtual void PrintSelf(std::ostream &os, Indent i) const
00133   {
00134     os << i << "GaussianOperator { this=" << this
00135        << ", m_Variance = " << m_Variance
00136        << ", m_MaximumError = " << m_MaximumError
00137        << "} "  << std::endl;
00138     Superclass::PrintSelf(os, i.GetNextIndent());
00139   }
00140   
00141 protected:
00142   typedef typename Superclass::CoefficientVector CoefficientVector;
00143 
00145   double ModifiedBesselI0(double);
00146 
00149   double ModifiedBesselI1(double);
00150 
00153   double ModifiedBesselI(int, double);
00154 
00156   CoefficientVector GenerateCoefficients();
00157 
00159   void Fill(const CoefficientVector& coeff)
00160   {    this->FillCenteredDirectional(coeff);  }
00161 
00162 private:
00164   double m_Variance;
00165   
00168   double m_MaximumError;
00169 
00173   unsigned int m_MaximumKernelWidth;
00174 
00176   const char *GetNameOfClass()
00177     { return "itkGaussianOperator"; }
00178   
00179 };
00180 
00181 } // namespace itk
00182 
00183 
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "itkGaussianOperator.txx"
00186 #endif
00187 
00188 #endif

Generated at Wed May 24 23:11:22 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000