Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkChannelDescriptor.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkChannelDescriptor_h
14 #define mitkChannelDescriptor_h
15 
16 #include <mitkPixelType.h>
17 #include <string>
18 
19 namespace mitk
20 {
32  {
33  public:
40  ChannelDescriptor(mitk::PixelType type, size_t numOfElements, bool allocate = false);
41 
44 
49  PixelType GetPixelType() const { return m_PixelType; }
50 
55  size_t GetSize() const { return m_Size; }
56 
67  unsigned char *GetData() const { return m_Data; }
68  protected:
69  friend class Image;
70  friend class ImageAccessorBase;
71 
72  void SetData(void *dataPtr)
73  {
74  if (dataPtr == nullptr)
75  {
76  m_Data = (unsigned char *)dataPtr;
77  }
78  }
79 
81  std::string m_Name;
82 
87 
89  size_t m_Size;
90 
96  unsigned char *m_Data;
97  };
98 
99 } // end namespace mitk
100 #endif
#define MITKCORE_EXPORT
Holds essential information about a single channel of an Image.
PixelType GetPixelType() const
Get the pixel type of this channel's elements.
size_t GetSize() const
Get the number of elements stored in this channel.
void SetData(void *dataPtr)
ChannelDescriptor(mitk::PixelType type, size_t numOfElements, bool allocate=false)
Construct a ChannelDescriptor with a given pixel type and element count.
unsigned char * GetData() const
Get a raw pointer to the channel's data buffer.
~ChannelDescriptor()
Destructor.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Describes the data type of image pixels.
Definition: mitkPixelType.h:75
Find image slices visible on a given plane.