|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Describes the data type of image pixels. More...
#include <mitkPixelType.h>
Public Types | |
| typedef itk::IOPixelEnum | ItkIOPixelType |
| ITK I/O pixel type enumeration. More... | |
| typedef itk::IOComponentEnum | ItkIOComponentType |
| ITK I/O component type enumeration. More... | |
Public Member Functions | |
| PixelType (const mitk::PixelType &aPixelType) | |
| Copy constructor. More... | |
| PixelType & | operator= (const PixelType &other) |
| Copy assignment operator. More... | |
| ItkIOPixelType | GetPixelType () const |
| Get the ITK I/O pixel type enumeration value. More... | |
| ItkIOComponentType | GetComponentType () const |
| Get the scalar component type. More... | |
| std::string | GetPixelTypeAsString () const |
| Get the ITK pixel type as a human-readable string. More... | |
| std::string | GetComponentTypeAsString () const |
| Get the scalar component type as a human-readable string. More... | |
| std::string | GetTypeAsString () const |
| Get a combined string of pixel type and component type. More... | |
| size_t | GetSize () const |
| Get the total size of one pixel in bytes. More... | |
| size_t | GetBpe () const |
| Get the total number of bits per pixel element. More... | |
| size_t | GetNumberOfComponents () const |
| Get the number of components per pixel. More... | |
| size_t | GetBitsPerComponent () const |
| Get the number of bits per single scalar component. More... | |
| bool | operator== (const PixelType &rhs) const |
| Compare two PixelType objects for equality. More... | |
| bool | operator!= (const PixelType &rhs) const |
| Compare two PixelType objects for inequality. More... | |
| ~PixelType () | |
| Destructor. More... | |
Describes the data type of image pixels.
Encapsulates all information about an image's pixel type, including the scalar component type, the composite pixel type (e.g. scalar, RGB, vector), the number of components per pixel, and the byte sizes.
To obtain additional type information not provided by this class, itk::ImageIOBase can be used by passing the return value of PixelType::GetComponentType() to itk::ImageIOBase::SetPixelTypeInfo and using the itk::ImageIOBase methods GetComponentType, GetComponentTypeAsString, GetPixelType, GetPixelTypeAsString.
Instances are created via the MakePixelType() family of factory functions rather than constructing directly.
Definition at line 74 of file mitkPixelType.h.
| typedef itk::IOComponentEnum mitk::PixelType::ItkIOComponentType |
ITK I/O component type enumeration.
Definition at line 78 of file mitkPixelType.h.
| typedef itk::IOPixelEnum mitk::PixelType::ItkIOPixelType |
ITK I/O pixel type enumeration.
Definition at line 77 of file mitkPixelType.h.
| mitk::PixelType::PixelType | ( | const mitk::PixelType & | aPixelType | ) |
Copy constructor.
| [in] | aPixelType | The PixelType to copy from. |
| mitk::PixelType::~PixelType | ( | ) |
Destructor.
| size_t mitk::PixelType::GetBitsPerComponent | ( | ) | const |
Get the number of bits per single scalar component.
Equals bytes-per-component * 8.
| size_t mitk::PixelType::GetBpe | ( | ) | const |
Get the total number of bits per pixel element.
Equals GetSize() * 8. For example, a 3-component double vector returns 8 * sizeof(double) * 3 = 192.
| ItkIOComponentType mitk::PixelType::GetComponentType | ( | ) | const |
Get the scalar component type.
Each pixel element may contain multiple components of this scalar type. For example, an RGB pixel of floats has component type FLOAT.
Referenced by mitk::ImageGenerator::GenerateRandomImage().
| std::string mitk::PixelType::GetComponentTypeAsString | ( | ) | const |
Get the scalar component type as a human-readable string.
| size_t mitk::PixelType::GetNumberOfComponents | ( | ) | const |
Get the number of components per pixel.
Each pixel can consist of multiple components (e.g. RGB has 3, RGBA has 4, a scalar has 1).
Referenced by mitk::ImagePixelAccessor< TPixel, VDimension >::CheckData(), and mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetConsecutivePixelsAsVector().
| ItkIOPixelType mitk::PixelType::GetPixelType | ( | ) | const |
Get the ITK I/O pixel type enumeration value.
Identifies the composite pixel type (e.g. SCALAR, RGB, VECTOR).
| std::string mitk::PixelType::GetPixelTypeAsString | ( | ) | const |
Get the ITK pixel type as a human-readable string.
| size_t mitk::PixelType::GetSize | ( | ) | const |
Get the total size of one pixel in bytes.
Equals GetNumberOfComponents() * bytes-per-component. For example, an RGBA float pixel returns 4 * sizeof(float) = 16.
| std::string mitk::PixelType::GetTypeAsString | ( | ) | const |
Get a combined string of pixel type and component type.
The format is "PixelTypeName (ComponentTypeName)".
| bool mitk::PixelType::operator!= | ( | const PixelType & | rhs | ) | const |
Copy assignment operator.
| [in] | other | The PixelType to assign from. |
| bool mitk::PixelType::operator== | ( | const PixelType & | rhs | ) | const |