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

itkDefaultConvertPixelTraits.h File Reference

Go to the source code of this file.

Namespaces

namespace  itk

Classes

class  itk::DefaultConvertPixelTraits< PixelType >
 Traits class used to by ConvertPixels to convert blocks of pixels. More...

Defines

#define ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE(componenttype)
#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(type, componenttype, dimension)
#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_MACRO(ArrayType, Type)
#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO(ArrayType)
#define ITK_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL(type)
#define ITK_DEFAULTCONVERTTRAITS_OFFSET_TYPE(dimension)

Functions

 itk::ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE (unsigned int)
 itk::ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE (signed int)
 itk::ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE (double)
 itk::ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE (float)
 itk::ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO (FixedArray)
 itk::ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO (Point)
 itk::ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO (CovariantVector)
 itk::ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO (Vector)


Define Documentation

#define ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE ( componenttype   ) 

Value:

template<>                                                               \
class DefaultConvertPixelTraits< ::std::complex< componenttype > >       \
{                                                                        \
public:                                                                  \
  typedef ::std::complex< componenttype>  TargetType;                    \
  typedef componenttype                     ComponentType;               \
  static unsigned int GetNumberOfComponents()                            \
    {                                                                    \
    return 2;                                                  \
    }                                                                    \
  static void SetNthComponent(int i, TargetType & pixel, const ComponentType& v)   \
    {                                                                    \
    if( i == 0 )                                                            \
      {                                                                  \
      pixel = TargetType( v, pixel.imag() );                           \
      }                                                                  \
    else                                                                 \
      {                                                                  \
      pixel = TargetType( pixel.real(), v );                           \
      }                                                                  \
    }                                                                    \
  static ComponentType GetScalarValue(const TargetType& pixel)           \
    {                                                                    \
    return std::norm(pixel);                                             \
    }                                                                    \
};                                                                       \

Definition at line 211 of file itkDefaultConvertPixelTraits.h.

#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE ( type,
componenttype,
dimension   ) 

Value:

template<>                                                               \
class DefaultConvertPixelTraits< type< componenttype, dimension> >       \
{                                                                        \
public:                                                                  \
  typedef type< componenttype, dimension >  TargetType;                  \
  typedef componenttype                     ComponentType;               \
  static unsigned int GetNumberOfComponents()                            \
    {                                                                    \
      return dimension;                                                  \
    }                                                                    \
  static void SetNthComponent(int i, TargetType & pixel, const ComponentType& v)   \
    {                                                                    \
      pixel[i] = v;                                                      \
    }                                                                    \
  static ComponentType GetScalarValue(const TargetType& pixel)           \
    {                                                                    \
      return pixel[0];                                                   \
    }                                                                    \
};                                                                       \

Definition at line 142 of file itkDefaultConvertPixelTraits.h.

#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_MACRO ( ArrayType,
Type   ) 

Value:

Definition at line 173 of file itkDefaultConvertPixelTraits.h.

#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO ( ArrayType   ) 

Value:

Definition at line 181 of file itkDefaultConvertPixelTraits.h.

#define ITK_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL ( type   ) 

Value:

template<>                                                               \
class DefaultConvertPixelTraits<type>                                    \
{                                                                        \
public:                                                                  \
  typedef type ComponentType;                                            \
  static unsigned int GetNumberOfComponents()                            \
    {                                                                    \
      return 1;                                                          \
    }                                                                    \
  static void SetNthComponent(int , type& pixel, const ComponentType& v) \
    {                                                                    \
      pixel = v;                                                         \
    }                                                                    \
  static type GetScalarValue(const type& pixel)                          \
    {                                                                    \
      return pixel;                                                      \
    }                                                                    \
};

Definition at line 63 of file itkDefaultConvertPixelTraits.h.

#define ITK_DEFAULTCONVERTTRAITS_OFFSET_TYPE ( dimension   ) 

Value:

template<>                                                               \
class DefaultConvertPixelTraits< Offset<dimension> >                     \
{                                                                        \
public:                                                                  \
  typedef Offset<dimension>  TargetType;                                 \
  typedef TargetType::OffsetValueType  ComponentType;                    \
  static unsigned int GetNumberOfComponents()                            \
    {                                                                    \
      return dimension;                                                  \
    }                                                                    \
  static void SetNthComponent(int i, TargetType & pixel, const ComponentType& v)   \
    {                                                                    \
      pixel[i] = v;                                                      \
    }                                                                    \
  static ComponentType GetScalarValue(const TargetType& pixel)           \
    {                                                                    \
      return pixel[0];                                                   \
    }                                                                    \
};                                                                       \

Definition at line 106 of file itkDefaultConvertPixelTraits.h.


Generated at Mon Mar 12 03:34:37 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000