Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::PixelType Class Reference

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

#include <mitkPixelType.h>

Public Types

typedef itk::IOPixelEnum ItkIOPixelType
 
typedef itk::IOComponentEnum ItkIOComponentType
 

Public Member Functions

 PixelType (const mitk::PixelType &aPixelType)
 
PixelTypeoperator= (const PixelType &other)
 
ItkIOPixelType GetPixelType () const
 
ItkIOComponentType 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...
 
size_t GetSize () const
 Get size of the PixelType in bytes. More...
 
size_t GetBpe () const
 Get the number of bits per element (of an element) More...
 
size_t GetNumberOfComponents () const
 Get the number of components of which each element consists. More...
 
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 ()
 

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::IOComponentEnum mitk::PixelType::ItkIOComponentType

Definition at line 55 of file mitkPixelType.h.

◆ ItkIOPixelType

typedef itk::IOPixelEnum mitk::PixelType::ItkIOPixelType

Definition at line 54 of file mitkPixelType.h.

Constructor & Destructor Documentation

◆ PixelType()

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

◆ ~PixelType()

mitk::PixelType::~PixelType ( )

Member Function Documentation

◆ GetBitsPerComponent()

size_t mitk::PixelType::GetBitsPerComponent ( ) const

Get the number of bits per components.

See also
GetBitsPerComponent

◆ GetBpe()

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

◆ GetComponentType()

ItkIOComponentType mitk::PixelType::GetComponentType ( ) const

Get the component type (the scalar (!) type). Each element may contain m_NumberOfComponents (more than one) of these scalars.

Referenced by mitk::ImageGenerator::GenerateRandomImage().

◆ GetComponentTypeAsString()

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

Returns a string containing the name of the component.

◆ GetNumberOfComponents()

size_t mitk::PixelType::GetNumberOfComponents ( ) const

Get the number of components of which each element consists.

Each pixel can consist of multiple components, e.g. RGB.

Referenced by mitk::ImagePixelAccessor< TPixel, 3 >::CheckData(), and mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetConsecutivePixelsAsVector().

◆ GetPixelType()

ItkIOPixelType mitk::PixelType::GetPixelType ( ) const

◆ GetPixelTypeAsString()

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

Returns a string containing the ITK pixel type name.

◆ GetSize()

size_t mitk::PixelType::GetSize ( ) const

Get size of the PixelType in bytes.

A RGBA PixelType of floats will return 4 * sizeof(float)

◆ GetTypeAsString()

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

Returns a string representing the pixel type and pixel components.

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

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