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

Holds all essential metadata about an Image object. More...

#include <mitkImageDescriptor.h>

Inheritance diagram for mitk::ImageDescriptor:
Collaboration diagram for mitk::ImageDescriptor:

Public Member Functions

 mitkClassMacroItkParent (ImageDescriptor, itk::Object)
 
Pointer Clone () const
 
void AddNewChannel (mitk::PixelType ptype, const char *name=nullptr)
 Add a new channel to this image descriptor. More...
 
void Initialize (const unsigned int *dims, const unsigned int dim)
 Initialize the image descriptor with dimension sizes. More...
 
void Initialize (const ImageDescriptor::Pointer refDescriptor, unsigned int channel=0)
 Initialize this descriptor from an existing ImageDescriptor. More...
 
const unsigned int * GetDimensions () const
 Get the array of dimension sizes. More...
 
unsigned int GetNumberOfDimensions () const
 Get the number of active dimensions. More...
 
const std::string GetChannelName (unsigned int id) const
 Get the name of a channel by its index. More...
 
PixelType GetChannelTypeByName (const char *name) const
 Get the pixel type of a channel identified by name. More...
 
PixelType GetChannelTypeById (unsigned int id) const
 Get the pixel type of a channel identified by index. More...
 
ChannelDescriptor GetChannelDescriptor (unsigned int id=0) const
 Get the ChannelDescriptor for a specific channel. More...
 
unsigned int GetNumberOfChannels () const
 Get the total number of channels. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ImageDescriptor ()
 
 ~ImageDescriptor () override
 

Detailed Description

Holds all essential metadata about an Image object.

The ImageDescriptor stores a vector of ChannelDescriptor objects together with the image's dimension sizes. The general assumption is that every channel of an image shares the same geometry; only the pixel type may differ between channels.

See also
Image, ChannelDescriptor, PixelType

Definition at line 40 of file mitkImageDescriptor.h.

Constructor & Destructor Documentation

◆ ImageDescriptor()

mitk::ImageDescriptor::ImageDescriptor ( )
protected

Protected constructor

◆ ~ImageDescriptor()

mitk::ImageDescriptor::~ImageDescriptor ( )
inlineoverrideprotected

Protected destructor

Definition at line 146 of file mitkImageDescriptor.h.

Member Function Documentation

◆ AddNewChannel()

void mitk::ImageDescriptor::AddNewChannel ( mitk::PixelType  ptype,
const char *  name = nullptr 
)

Add a new channel to this image descriptor.

The channel's element count is computed from the current dimension sizes. If no name is given, a default name "Unnamed [PixelTypeName]" is assigned.

Parameters
[in]ptypeThe pixel type of the new channel.
[in]nameOptional human-readable name for the channel.

◆ Clone()

Pointer mitk::ImageDescriptor::Clone ( ) const

◆ GetChannelDescriptor()

ChannelDescriptor mitk::ImageDescriptor::GetChannelDescriptor ( unsigned int  id = 0) const

Get the ChannelDescriptor for a specific channel.

Parameters
[in]idZero-based channel index (default: 0).
Returns
A copy of the ChannelDescriptor.
Exceptions
std::invalid_argumentIf id exceeds the number of active channels.

◆ GetChannelName()

const std::string mitk::ImageDescriptor::GetChannelName ( unsigned int  id) const

Get the name of a channel by its index.

If the channel name was not explicitly set, the returned string is "Unnamed [PixelTypeName]". Returns "Out-of-range-access" if id exceeds the channel count.

Parameters
[in]idZero-based channel index.
Returns
The channel name string.
See also
PixelType, ChannelDescriptor

◆ GetChannelTypeById()

PixelType mitk::ImageDescriptor::GetChannelTypeById ( unsigned int  id) const

Get the pixel type of a channel identified by index.

Parameters
[in]idZero-based channel index.
Returns
The PixelType of the specified channel.
Exceptions
std::invalid_argumentIf id exceeds the number of active channels.

◆ GetChannelTypeByName()

PixelType mitk::ImageDescriptor::GetChannelTypeByName ( const char *  name) const

Get the pixel type of a channel identified by name.

Parameters
[in]nameThe channel name to search for.
Returns
The PixelType of the matching channel.
Exceptions
std::invalid_argumentIf no channel with the given name is found.

◆ GetDimensions()

const unsigned int* mitk::ImageDescriptor::GetDimensions ( ) const
inline

Get the array of dimension sizes.

The returned C-array always has MAX_IMAGE_DIMENSIONS elements. Unused dimensions are set to 1.

Returns
Pointer to the internal dimension size array.

Definition at line 85 of file mitkImageDescriptor.h.

◆ GetNumberOfChannels()

unsigned int mitk::ImageDescriptor::GetNumberOfChannels ( ) const
inline

Get the total number of channels.

Returns
The channel count.

Definition at line 140 of file mitkImageDescriptor.h.

◆ GetNumberOfDimensions()

unsigned int mitk::ImageDescriptor::GetNumberOfDimensions ( ) const
inline

Get the number of active dimensions.

The return value does not exceed MAX_IMAGE_DIMENSIONS.

Returns
The number of dimensions with meaningful size.

Definition at line 94 of file mitkImageDescriptor.h.

◆ Initialize() [1/2]

void mitk::ImageDescriptor::Initialize ( const ImageDescriptor::Pointer  refDescriptor,
unsigned int  channel = 0 
)

Initialize this descriptor from an existing ImageDescriptor.

Copies dimension information and one channel descriptor from the reference.

Parameters
[in]refDescriptorThe source descriptor to copy from.
[in]channelIndex of the channel to copy (default: 0).

◆ Initialize() [2/2]

void mitk::ImageDescriptor::Initialize ( const unsigned int *  dims,
const unsigned int  dim 
)

Initialize the image descriptor with dimension sizes.

Parameters
[in]dimsArray of dimension sizes (must have at least dim elements).
[in]dimNumber of dimensions to use (must not exceed MAX_IMAGE_DIMENSIONS).

◆ mitkClassMacroItkParent()

mitk::ImageDescriptor::mitkClassMacroItkParent ( ImageDescriptor  ,
itk::Object   
)

◆ New()

static Pointer mitk::ImageDescriptor::New ( )
static

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