Medical Imaging Interaction Toolkit  2023.12.99-ed252ae7
Medical Imaging Interaction Toolkit
mitkImageDescriptor.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 mitkImageDescriptor_h
14 #define mitkImageDescriptor_h
15 
16 #include <itkObjectFactory.h>
17 
18 #include <string>
19 #include <vector>
20 
21 #include "mitkChannelDescriptor.h"
22 #include "mitkCommon.h"
23 
25 #define MAX_IMAGE_DIMENSIONS 8
26 
27 namespace mitk
28 {
37  class MITKCORE_EXPORT ImageDescriptor : public itk::Object
38  {
39  public:
41 
42  itkFactorylessNewMacro(Self);
43 
44  itkCloneMacro(Self);
45 
51  void AddNewChannel(mitk::PixelType ptype, const char *name = nullptr);
52 
54  void Initialize(const unsigned int *dims, const unsigned int dim);
55 
57  void Initialize(const ImageDescriptor::Pointer refDescriptor, unsigned int channel = 0);
58 
63  const unsigned int *GetDimensions() const { return m_Dimensions; }
68  unsigned int GetNumberOfDimensions() const { return m_NumberOfDimensions; }
75  const std::string GetChannelName(unsigned int id) const;
76 
81  PixelType GetChannelTypeByName(const char *name) const;
82 
87  PixelType GetChannelTypeById(unsigned int id) const;
88 
90  ChannelDescriptor GetChannelDescriptor(unsigned int id = 0) const;
91 
93  unsigned int GetNumberOfChannels() const { return m_NumberOfChannels; }
94  protected:
97 
99  ~ImageDescriptor() override{};
100 
101  private:
103  std::vector<ChannelDescriptor> m_ChannelDesc;
104 
106  std::vector<std::string> m_ChannelNames;
107 
109  typedef std::vector<std::string>::const_iterator ConstChannelNamesIter;
110 
112  typedef std::vector<ChannelDescriptor>::const_iterator ConstChannelsIter;
113 
114  unsigned int m_NumberOfChannels;
115 
116  unsigned int m_NumberOfDimensions;
117 
118  unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
119  };
120 
121 } // end namespace
122 #endif
mitk::ChannelDescriptor
An object which holds all essential information about a single channel of an Image.
Definition: mitkChannelDescriptor.h:27
mitk::ImageDescriptor::~ImageDescriptor
~ImageDescriptor() override
Definition: mitkImageDescriptor.h:99
MAX_IMAGE_DIMENSIONS
#define MAX_IMAGE_DIMENSIONS
Defines the maximum of 8 dimensions per image channel.
Definition: mitkImageDescriptor.h:25
itk::SmartPointer< Self >
mitk::ImageDescriptor::GetDimensions
const unsigned int * GetDimensions() const
Get the C-array of unsigned int holding the size for each dimension of the image.
Definition: mitkImageDescriptor.h:63
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ImageDescriptor::GetNumberOfDimensions
unsigned int GetNumberOfDimensions() const
Get the number dimensions used (e.g. non-zero size)
Definition: mitkImageDescriptor.h:68
mitk::ImageDescriptor::GetNumberOfChannels
unsigned int GetNumberOfChannels() const
Get the count of channels used.
Definition: mitkImageDescriptor.h:93
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitkCommon.h
mitkChannelDescriptor.h
mitk::ImageDescriptor
An object to hold all essential information about an Image object.
Definition: mitkImageDescriptor.h:37
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15