freVectorToPhaseAccessor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freVectorToPhaseAccessor.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 
00023 #ifndef _freVectorToPhaseAccessor_h
00024 #define _freVectorToPhaseAccessor_h
00025 
00026 #include "itkVector.h"
00027 
00028 namespace FREE
00029 {
00030 namespace Accessor
00031 {
00032 
00043 template <class TVector>
00044 class ITK_EXPORT VectorToPhaseAccessor
00045 {
00046 public:
00048   typedef   VectorToPhaseAccessor   Self;
00049 
00052   typedef   TVector     InternalType;
00053 
00056         typedef   double        ExternalType;
00057         
00059   inline void Set( InternalType & output, const ExternalType & input ) const
00060   { 
00061     ExternalType dAngle = input;
00062                 if (!m_bOutputAsRad) dAngle = (output/360)*M_PI; //convert to radian
00063 
00064     output[0] = cos(dAngle);
00065     output[1] = sin(dAngle);
00066   }
00067 
00069   ExternalType Get( const InternalType & input ) const;
00070 
00071         inline void SetOutputAsRad(const bool& bAsRad)
00072         {
00073                 m_bOutputAsRad = bAsRad;
00074         };
00075 
00076         inline bool GetOutputAsRad() const
00077         {
00078                 return m_bOutputAsRad;
00079         };
00080 
00081         VectorToPhaseAccessor();
00082         ~VectorToPhaseAccessor();
00083 
00084 private:
00085   bool m_bOutputAsRad;
00086 };
00087 
00088 } // namespace Accessor
00089 } // namespace free
00090 
00091 #endif

Generated at Sat Oct 13 18:02:05 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000