freVectorTo2DProjectionAccessor.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: freVectorTo2DProjectionAccessor.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 #ifndef _freVectorTo2DProjectionAccessor_h
00023 #define _freVectorTo2DProjectionAccessor_h
00024 
00025 #include "itkVector.h"
00026 
00027 namespace FREE
00028 {
00029 namespace Accessor
00030 {
00031 
00044 template <class TVector>
00045 class ITK_EXPORT VectorTo2DProjectionAccessor
00046 {
00047 public:
00049   typedef   VectorTo2DProjectionAccessor   Self;
00050 
00053   typedef   TVector     InternalType;
00054 
00057   typedef   itk::Vector<typename InternalType::ValueType,2>     ExternalType;
00058         
00060   inline void Set( InternalType & output, const ExternalType & input ) const
00061   { 
00062                 output[m_ActiveDim1] = input[0];
00063                 output[m_ActiveDim2] = input[1];
00064   }
00065 
00067   inline ExternalType Get( const InternalType & input ) const
00068   {
00069     ExternalType projection;
00070     projection[0] = input[m_ActiveDim1];
00071     projection[1] = input[m_ActiveDim2];
00072     return projection;
00073   }
00074 
00076         inline void SetActiveDimensions(const unsigned int& index1, const unsigned int& index2)
00077         {
00078     if (index1<index2)
00079     {
00080       m_ActiveDim1 = index1; 
00081       m_ActiveDim2 = index2; 
00082     }
00083     else
00084     {
00085       m_ActiveDim1 = index2; 
00086       m_ActiveDim2 = index1; 
00087     }
00088         };
00089 
00090         VectorTo2DProjectionAccessor();
00091 
00092 private:
00094   unsigned int m_ActiveDim1;
00096   unsigned int m_ActiveDim2;
00097 };
00098 
00099 } // namespace Accessor
00100 } // namespace free
00101 
00102 #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