Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGaborKernelFunction_h
00018 #define __itkGaborKernelFunction_h
00019
00020 #include "itkKernelFunction.h"
00021 #include "vnl/vnl_math.h"
00022 #include <math.h>
00023
00024 namespace itk
00025 {
00026
00049 class ITK_EXPORT GaborKernelFunction : public KernelFunction
00050 {
00051 public:
00053 typedef GaborKernelFunction Self;
00054 typedef KernelFunction Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056
00058 itkNewMacro( Self );
00059
00061 itkTypeMacro( GaborKernelFunction, KernelFunction );
00062
00064 inline double Evaluate ( const double &u ) const
00065 {
00066 double parameter = vnl_math_sqr( u / this->m_Sigma );
00067 double envelope = vcl_exp( -0.5 * parameter );
00068 double phase = 2.0 * vnl_math::pi * this->m_Frequency * u
00069 + this->m_PhaseOffset;
00070 if ( this->m_CalculateImaginaryPart )
00071 {
00072 return envelope * vcl_sin( phase );
00073 }
00074 else
00075 {
00076 return envelope * vcl_cos( phase );
00077 }
00078 }
00080
00081 itkSetMacro( Sigma, double );
00082 itkGetConstMacro( Sigma, double );
00083
00084 itkSetMacro( Frequency, double );
00085 itkGetConstMacro( Frequency, double );
00086
00087 itkSetMacro( PhaseOffset, double );
00088 itkGetConstMacro( PhaseOffset, double );
00089
00090 itkSetMacro( CalculateImaginaryPart, bool );
00091 itkGetConstMacro( CalculateImaginaryPart, bool );
00092 itkBooleanMacro( CalculateImaginaryPart );
00093
00094 protected:
00095 GaborKernelFunction();
00096 ~GaborKernelFunction();
00097 void PrintSelf( std::ostream& os, Indent indent ) const;
00098
00099 private:
00100 GaborKernelFunction( const Self& );
00101 void operator=( const Self& );
00102
00104 double m_Sigma;
00105
00107 double m_Frequency;
00108
00110 double m_PhaseOffset;
00111
00113 bool m_CalculateImaginaryPart;
00114 };
00115
00116 }
00117
00118 #endif
00119