Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKIMAGEDESCRIPTOR_H
18 #define MITKIMAGEDESCRIPTOR_H
19 
20 #include <itkObjectFactory.h>
21 
22 #include <string>
23 #include <vector>
24 
25 #include "mitkChannelDescriptor.h"
26 #include "mitkCommon.h"
27 
29 #define MAX_IMAGE_DIMENSIONS 8
30 
31 namespace mitk
32 {
41  class MITKCORE_EXPORT ImageDescriptor : public itk::Object
42  {
43  public:
45 
46  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
47 
53  void AddNewChannel(mitk::PixelType ptype, const char *name = nullptr);
54 
56  void Initialize(const unsigned int *dims, const unsigned int dim);
57 
59  void Initialize(const ImageDescriptor::Pointer refDescriptor, unsigned int channel = 0);
60 
65  const unsigned int *GetDimensions() const { return m_Dimensions; }
70  unsigned int GetNumberOfDimensions() const { return m_NumberOfDimensions; }
77  const std::string GetChannelName(unsigned int id) const;
78 
83  PixelType GetChannelTypeByName(const char *name) const;
84 
89  PixelType GetChannelTypeById(unsigned int id) const;
90 
92  ChannelDescriptor GetChannelDescriptor(unsigned int id = 0) const;
93 
95  unsigned int GetNumberOfChannels() const { return m_NumberOfChannels; }
96  protected:
99 
102 
103  private:
105  std::vector<ChannelDescriptor> m_ChannelDesc;
106 
108  std::vector<std::string> m_ChannelNames;
109 
111  typedef std::vector<std::string>::const_iterator ConstChannelNamesIter;
112 
114  typedef std::vector<ChannelDescriptor>::const_iterator ConstChannelsIter;
115 
116  unsigned int m_NumberOfChannels;
117 
118  unsigned int m_NumberOfDimensions;
119 
120  unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
121  };
122 
123 } // end namespace
124 #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 GetNumberOfDimensions() const
Get the number dimensions used (e.g. non-zero size)
#define MAX_IMAGE_DIMENSIONS
Defines the maximum of 8 dimensions per image channel taken from ipPicDescriptor. ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
An object to hold all essential information about an Image object.
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55
unsigned int GetNumberOfChannels() const
Get the count of channels used.