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

itkGaborKernelFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGaborKernelFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-10-05 12:53:50 $
00007   Version:   $Revision: 1.2 $
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 __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& ); //purposely not implemented
00101   void operator=( const Self& ); //purposely not implemented
00102 
00104   double m_Sigma;
00105 
00107   double m_Frequency;
00108 
00110   double m_PhaseOffset;
00111 
00113   bool m_CalculateImaginaryPart;
00114 };
00115 
00116 } // end namespace itk
00117 
00118 #endif
00119 

Generated at Mon Jul 12 2010 18:23:33 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000