Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 51 of file mitkPixelType.h.

Member Typedef Documentation

◆ ItkIOComponentType

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

Definition at line 55 of file mitkPixelType.h.

◆ ItkIOPixelType

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

Definition at line 54 of file mitkPixelType.h.

Constructor & Destructor Documentation

◆ PixelType()

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

Definition at line 16 of file mitkPixelType.cpp.

References PixelType().

Referenced by PixelType(), and ~PixelType().

◆ ~PixelType()

mitk::PixelType::~PixelType ( )

Definition at line 83 of file mitkPixelType.cpp.

References PixelType().

Member Function Documentation

◆ GetBitsPerComponent()

vcl_size_t mitk::PixelType::GetBitsPerComponent ( ) const

Get the number of bits per components.

See also
GetBitsPerComponent

Definition at line 78 of file mitkPixelType.cpp.

Referenced by mitk_GetMemoryViewFromImage(), mitk_SetImageFromArray(), and mitk::Image::PrintSelf().

◆ GetBpe()

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 68 of file mitkPixelType.cpp.

References GetSize().

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

◆ GetComponentType()

◆ GetComponentTypeAsString()

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

Returns a string containing the name of the component.

Definition at line 53 of file mitkPixelType.cpp.

Referenced by mitk::ConcentrationCurveGenerator::ConvertSignalToConcentrationCurve(), and mitk::Image::PrintSelf().

◆ GetNumberOfComponents()

◆ GetPixelType()

◆ GetPixelTypeAsString()

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

Returns a string containing the ITK pixel type name.

Definition at line 48 of file mitkPixelType.cpp.

Referenced by mitk::ImageDescriptor::AddNewChannel(), mitk::Image::PrintSelf(), and mitk::DoseImageVtkMapper2D::SetDefaultProperties().

◆ GetSize()

vcl_size_t mitk::PixelType::GetSize ( ) const

◆ GetTypeAsString()

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

Returns a string representing the pixel type and pixel components.

Definition at line 58 of file mitkPixelType.cpp.

Referenced by mitk::Equal().

◆ operator!=()

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

Definition at line 121 of file mitkPixelType.cpp.

References operator==().

◆ operator=()

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

Definition at line 26 of file mitkPixelType.cpp.

◆ operator==()

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

Definition at line 102 of file mitkPixelType.cpp.

References MITK_DEBUG.

Referenced by operator!=().

Friends And Related Function Documentation

◆ MakePixelType [1/4]

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

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

Definition at line 277 of file mitkPixelType.h.

◆ MakePixelType [2/4]

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 171 of file mitkPixelType.h.

◆ MakePixelType [3/4]

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 187 of file mitkPixelType.h.

◆ MakePixelType [4/4]

template<typename ItkImageType >
PixelType MakePixelType ( vcl_size_t  )
friend

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