Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::PixelType Class Reference

Class for defining the data type of pixels. More...

#include <mitkPixelType.h>

Public Types

typedef itk::ImageIOBase::IOPixelType ItkIOPixelType
 
typedef itk::ImageIOBase::IOComponentType ItkIOComponentType
 

Public Member Functions

 PixelType (const mitk::PixelType &aPixelType)
 
PixelTypeoperator= (const PixelType &other)
 
itk::ImageIOBase::IOPixelType GetPixelType () const
 
int GetComponentType () const
 Get the component type (the scalar (!) type). Each element may contain m_NumberOfComponents (more than one) of these scalars. More...
 
std::string GetPixelTypeAsString () const
 Returns a string containing the ITK pixel type name. More...
 
std::string GetComponentTypeAsString () const
 Returns a string containing the name of the component. More...
 
std::string GetTypeAsString () const
 Returns a string representing the pixel type and pixel components. More...
 
vcl_size_t GetSize () const
 Get size of the PixelType in bytes. More...
 
vcl_size_t GetBpe () const
 Get the number of bits per element (of an element) More...
 
vcl_size_t GetNumberOfComponents () const
 Get the number of components of which each element consists. More...
 
vcl_size_t GetBitsPerComponent () const
 Get the number of bits per components. More...
 
bool operator== (const PixelType &rhs) const
 
bool operator!= (const PixelType &rhs) const
 
 ~PixelType ()
 

Friends

PixelType MakePixelType (const itk::ImageIOBase *imageIO)
 Create a MITK pixel type based on a itk::ImageIOBase object. More...
 
template<typename ComponentT , typename PixelT >
PixelType MakePixelType (std::vcl_size_t numberOfComponents)
 A template method for creating a pixel type. More...
 
template<typename ItkImageType >
PixelType MakePixelType ()
 A template method for creating a pixel type. More...
 
template<typename ItkImageType >
PixelType MakePixelType (vcl_size_t)
 

Detailed Description

Class for defining the data type of pixels.

To obtain additional type information not provided by this class itk::ImageIOBase can be used by passing the return value of PixelType::GetItkTypeId() to itk::ImageIOBase::SetPixelTypeInfo and using the itk::ImageIOBase methods GetComponentType, GetComponentTypeAsString, GetPixelType, GetPixelTypeAsString.

Definition at line 55 of file mitkPixelType.h.

Member Typedef Documentation

typedef itk::ImageIOBase::IOComponentType mitk::PixelType::ItkIOComponentType

Definition at line 59 of file mitkPixelType.h.

typedef itk::ImageIOBase::IOPixelType mitk::PixelType::ItkIOPixelType

Definition at line 58 of file mitkPixelType.h.

Constructor & Destructor Documentation

mitk::PixelType::PixelType ( const mitk::PixelType aPixelType)

Definition at line 20 of file mitkPixelType.cpp.

References PixelType().

Referenced by PixelType().

mitk::PixelType::~PixelType ( )

Definition at line 87 of file mitkPixelType.cpp.

Member Function Documentation

vcl_size_t mitk::PixelType::GetBitsPerComponent ( ) const

Get the number of bits per components.

See also
GetBitsPerComponent

Definition at line 82 of file mitkPixelType.cpp.

Referenced by mitkPixelTypeTest(), and mitk::Image::PrintSelf().

vcl_size_t mitk::PixelType::GetBpe ( ) const

Get the number of bits per element (of an element)

A vector of double with three components will return 8*sizeof(double)*3.

See also
GetBitsPerComponent
GetItkTypeId
GetTypeId

Definition at line 72 of file mitkPixelType.cpp.

Referenced by QmitkSlicesInterpolator::AcceptAllInterpolations(), AccessPixel(), mitk::TestDCMLoading::DumpImageInformation(), mitk::TestDICOMLoading::DumpImageInformation(), mitkPixelTypeTest(), and mitk::LevelWindow::SetAuto().

std::string mitk::PixelType::GetComponentTypeAsString ( ) const

Returns a string containing the name of the component.

Definition at line 57 of file mitkPixelType.cpp.

Referenced by mitk::Image::PrintSelf().

std::string mitk::PixelType::GetPixelTypeAsString ( ) const
vcl_size_t mitk::PixelType::GetSize ( ) const
std::string mitk::PixelType::GetTypeAsString ( ) const

Returns a string representing the pixel type and pixel components.

Definition at line 62 of file mitkPixelType.cpp.

Referenced by mitk::Equal().

bool mitk::PixelType::operator!= ( const PixelType rhs) const

Definition at line 127 of file mitkPixelType.cpp.

References mitk::operator==().

mitk::PixelType & mitk::PixelType::operator= ( const PixelType other)

Definition at line 30 of file mitkPixelType.cpp.

bool mitk::PixelType::operator== ( const PixelType rhs) const

Definition at line 106 of file mitkPixelType.cpp.

References MITK_DEBUG.

Friends And Related Function Documentation

PixelType MakePixelType ( const itk::ImageIOBase *  imageIO)
friend

Create a MITK pixel type based on a itk::ImageIOBase object.

Definition at line 281 of file mitkPixelType.h.

template<typename ComponentT , typename PixelT >
PixelType MakePixelType ( std::vcl_size_t  numberOfComponents)
friend

A template method for creating a pixel type.

A template method for creating a MITK pixel type from an ITK image pixel type and dimension.

Parameters
numOfComponentsThe number of components for the pixel type TPixelType
numOfComponentsThe number of components for the pixel type of the ITK image

Definition at line 175 of file mitkPixelType.h.

template<typename ItkImageType >
PixelType MakePixelType ( )
friend

A template method for creating a pixel type.

Deprecated:
, use version with one numOfComponents as function argument instead.

For images where the number of components of the pixel type is determined at runtime (e.g. pixel types like itk::VariableLengthVector<short>) the MakePixelType(std::size_t) function must be used.

Definition at line 191 of file mitkPixelType.h.

template<typename ItkImageType >
PixelType MakePixelType ( vcl_size_t  )
friend

The documentation for this class was generated from the following files: