Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ChannelDescriptor Class Reference

Holds essential information about a single channel of an Image. More...

#include <mitkChannelDescriptor.h>

Collaboration diagram for mitk::ChannelDescriptor:

Public Member Functions

 ChannelDescriptor (mitk::PixelType type, size_t numOfElements, bool allocate=false)
 Construct a ChannelDescriptor with a given pixel type and element count. More...
 
 ~ChannelDescriptor ()
 Destructor. More...
 
PixelType GetPixelType () const
 Get the pixel type of this channel's elements. More...
 
size_t GetSize () const
 Get the number of elements stored in this channel. More...
 
unsigned char * GetData () const
 Get a raw pointer to the channel's data buffer. More...
 

Protected Member Functions

void SetData (void *dataPtr)
 

Protected Attributes

std::string m_Name
 
PixelType m_PixelType
 
size_t m_Size
 
unsigned char * m_Data
 

Detailed Description

Holds essential information about a single channel of an Image.

Designed to be used only as part of an ImageDescriptor. The ChannelDescriptor does not hold geometry information – only the PixelType, which is the piece of metadata that can differ among channels of a multi-channel image.

See also
ImageDescriptor, PixelType, Image

Definition at line 31 of file mitkChannelDescriptor.h.

Constructor & Destructor Documentation

◆ ChannelDescriptor()

mitk::ChannelDescriptor::ChannelDescriptor ( mitk::PixelType  type,
size_t  numOfElements,
bool  allocate = false 
)

Construct a ChannelDescriptor with a given pixel type and element count.

Parameters
[in]typeThe pixel type for this channel.
[in]numOfElementsThe number of pixel elements in this channel.
[in]allocateCurrently unused; reserved for future memory management.

◆ ~ChannelDescriptor()

mitk::ChannelDescriptor::~ChannelDescriptor ( )

Destructor.

Member Function Documentation

◆ GetData()

unsigned char* mitk::ChannelDescriptor::GetData ( ) const
inline

Get a raw pointer to the channel's data buffer.

Warning
Direct access to image data is unsafe. Prefer ImageReadAccessor or ImageWriteAccessor instead.
Returns
Pointer to the raw data, or nullptr if not allocated.

Definition at line 67 of file mitkChannelDescriptor.h.

◆ GetPixelType()

PixelType mitk::ChannelDescriptor::GetPixelType ( ) const
inline

Get the pixel type of this channel's elements.

Returns
The PixelType describing the element data type.

Definition at line 49 of file mitkChannelDescriptor.h.

◆ GetSize()

size_t mitk::ChannelDescriptor::GetSize ( ) const
inline

Get the number of elements stored in this channel.

Returns
The element count (not the byte size).

Definition at line 55 of file mitkChannelDescriptor.h.

◆ SetData()

void mitk::ChannelDescriptor::SetData ( void *  dataPtr)
inlineprotected

Definition at line 72 of file mitkChannelDescriptor.h.

Member Data Documentation

◆ m_Data

unsigned char* mitk::ChannelDescriptor::m_Data
protected

Pointer to the data of the channel

Warning
Not safe

Definition at line 96 of file mitkChannelDescriptor.h.

◆ m_Name

std::string mitk::ChannelDescriptor::m_Name
protected

Name of the channel

Definition at line 81 of file mitkChannelDescriptor.h.

◆ m_PixelType

PixelType mitk::ChannelDescriptor::m_PixelType
protected

The type of each element of the channel

See also
PixelType

Definition at line 86 of file mitkChannelDescriptor.h.

◆ m_Size

size_t mitk::ChannelDescriptor::m_Size
protected

Size of the channel in bytes

Definition at line 89 of file mitkChannelDescriptor.h.


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