Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
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 // MITKIMAGEDESCRIPTOR_H
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
An object which holds all essential information about a single channel of an Image.
unsigned int GetNumberOfChannels() const
Get the count of channels used.
#define MAX_IMAGE_DIMENSIONS
Defines the maximum of 8 dimensions per image channel taken from ipPicDescriptor. ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
unsigned int GetNumberOfDimensions() const
Get the number dimensions used (e.g. non-zero size)
An object to hold all essential information about an Image object.
const unsigned int * GetDimensions() const
Get the C-array of unsigned int holding the size for each dimension of the image. ...
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51