Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 {
28  {
29  public:
30  ChannelDescriptor(mitk::PixelType type, size_t numOfElements, bool allocate = false);
31 
33 
35  PixelType GetPixelType() const { return m_PixelType; }
37  size_t GetSize() const { return m_Size; }
43  unsigned char *GetData() const { return m_Data; }
44  protected:
45  friend class Image;
46  friend class ImageAccessorBase;
47 
48  void SetData(void *dataPtr)
49  {
50  if (dataPtr == nullptr)
51  {
52  m_Data = (unsigned char *)dataPtr;
53  }
54  }
55 
57  std::string m_Name;
58 
63 
65  size_t m_Size;
66 
72  unsigned char *m_Data;
73  };
74 
75 } // end namespace mitk
76 #endif
mitk::ChannelDescriptor
An object which holds all essential information about a single channel of an Image.
Definition: mitkChannelDescriptor.h:27
mitk::ImageAccessorBase
Definition: mitkImageAccessorBase.h:48
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::ChannelDescriptor::m_Name
std::string m_Name
Definition: mitkChannelDescriptor.h:57
mitk::ChannelDescriptor::m_PixelType
PixelType m_PixelType
Definition: mitkChannelDescriptor.h:62
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ChannelDescriptor::SetData
void SetData(void *dataPtr)
Definition: mitkChannelDescriptor.h:48
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitk::ChannelDescriptor::GetPixelType
PixelType GetPixelType() const
Get the type of channel's elements.
Definition: mitkChannelDescriptor.h:35
mitkPixelType.h
mitk::ChannelDescriptor::m_Data
unsigned char * m_Data
Definition: mitkChannelDescriptor.h:72
mitk::ChannelDescriptor::GetSize
size_t GetSize() const
Get the size in bytes of the channel.
Definition: mitkChannelDescriptor.h:37
mitk::ChannelDescriptor::GetData
unsigned char * GetData() const
Get the pointer to the actual data of the channel.
Definition: mitkChannelDescriptor.h:43
mitk::ChannelDescriptor::m_Size
size_t m_Size
Definition: mitkChannelDescriptor.h:65
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15