00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDefaultPixelAccessorFunctor_h
00018 #define __itkDefaultPixelAccessorFunctor_h
00019
00020 #include "itkMacro.h"
00021
00022 namespace itk
00023 {
00042 template <class TImageType >
00043 class ITK_EXPORT DefaultPixelAccessorFunctor
00044 {
00045 public:
00046 typedef TImageType ImageType;
00047 typedef typename ImageType::InternalPixelType InternalPixelType;
00048 typedef typename ImageType::PixelType ExternalPixelType;
00049 typedef typename ImageType::AccessorType PixelAccessorType;
00050 typedef unsigned int VectorLengthType;
00051
00052 static void SetVectorLength( ImageType *image, VectorLengthType length )
00053 {
00054 }
00055
00056 static VectorLengthType GetVectorLength( const ImageType * itkNotUsed(image) )
00057 {
00058 return 1;
00059 }
00060
00065 inline void SetPixelAccessor( PixelAccessorType& accessor )
00066 {
00067 m_PixelAccessor = accessor;
00068 }
00069
00073 inline void SetBegin( const InternalPixelType *itkNotUsed(begin) ) {};
00074
00076 inline void Set( InternalPixelType & output, const ExternalPixelType &input ) const
00077 {
00078 m_PixelAccessor.Set( output, input );
00079 }
00080
00082 inline ExternalPixelType Get( InternalPixelType &input ) const
00083 {
00084 return m_PixelAccessor.Get( input );
00085 }
00086
00088 inline const ExternalPixelType Get( const InternalPixelType & input ) const
00089 {
00090 return m_PixelAccessor.Get( input );
00091 }
00092
00093 private:
00094 PixelAccessorType m_PixelAccessor;
00095 };
00096
00097 }
00098
00099 #endif