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 namespace itk
00021 {
00040 template <class TImageType >
00041 class ITK_EXPORT DefaultPixelAccessorFunctor
00042 {
00043 public:
00044 typedef TImageType ImageType;
00045 typedef typename ImageType::InternalPixelType InternalPixelType;
00046 typedef typename ImageType::PixelType ExternalPixelType;
00047 typedef typename ImageType::AccessorType PixelAccessorType;
00048 typedef unsigned int VectorLengthType;
00049
00050 static void SetVectorLength( ImageType *, VectorLengthType )
00051 {
00052 }
00053
00054 static VectorLengthType GetVectorLength( const ImageType * )
00055 {
00056 return 1;
00057 }
00058
00063 inline void SetPixelAccessor( PixelAccessorType& accessor )
00064 {
00065 m_PixelAccessor = accessor;
00066 }
00067
00071 inline void SetBegin( const InternalPixelType *itkNotUsed(begin) ) {}
00072
00074 inline void Set( InternalPixelType & output, const ExternalPixelType &input ) const
00075 {
00076 m_PixelAccessor.Set( output, input );
00077 }
00078
00080 inline ExternalPixelType Get( InternalPixelType &input ) const
00081 {
00082 return m_PixelAccessor.Get( input );
00083 }
00084
00086 inline const ExternalPixelType Get( const InternalPixelType & input ) const
00087 {
00088 return m_PixelAccessor.Get( input );
00089 }
00090
00091 private:
00092 PixelAccessorType m_PixelAccessor;
00093 };
00094
00095 }
00096
00097 #endif
00098