Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PIXELTYPE_H_HEADER_INCLUDED_C1EBF565
00020 #define PIXELTYPE_H_HEADER_INCLUDED_C1EBF565
00021
00022 #include "mitkCommon.h"
00023 #include <mitkIpPic.h>
00024 #include <itkImageIOBase.h>
00025
00026 namespace mitk {
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class MITK_CORE_EXPORT PixelType
00038 {
00039 public:
00040 itkTypeMacro(PixelType, None);
00041
00042 typedef itk::ImageIOBase::IOPixelType ItkIOPixelType;
00043
00044 PixelType(const std::type_info& aTypeId, int numberOfComponents = 1, ItkIOPixelType anItkIoPixelType = itk::ImageIOBase::UNKNOWNPIXELTYPE);
00045
00046 PixelType(mitkIpPicType_t type, int bpe, int numberOfComponents = 1);
00047
00048 PixelType(const mitkIpPicDescriptor* pic);
00049 PixelType(const mitk::PixelType & aPixelType);
00055 inline const std::type_info * GetTypeId() const
00056 {
00057 return m_TypeId;
00058 }
00064 inline const std::type_info * GetItkTypeId() const
00065 {
00066 return m_ItkTypeId;
00067 }
00068
00075 inline mitkIpPicType_t GetType() const
00076 {
00077 return m_Type;
00078 }
00079
00089 inline int GetBpe() const
00090 {
00091 return m_Bpe;
00092 }
00093
00098 inline int GetNumberOfComponents() const
00099 {
00100 return m_NumberOfComponents;
00101 }
00102
00106 inline int GetBitsPerComponent() const
00107 {
00108 return m_BitsPerComponent;
00109 }
00110
00116 std::string GetItkTypeAsString() const;
00117
00118 inline PixelType& operator=(const PixelType& aPixelType)
00119 {
00120 m_TypeId=aPixelType.GetTypeId();
00121 m_ItkTypeId=aPixelType.GetItkTypeId();
00122 m_Type=aPixelType.GetType();
00123 m_Bpe=aPixelType.GetBpe();
00124 m_NumberOfComponents = aPixelType.GetNumberOfComponents();
00125 m_BitsPerComponent = aPixelType.GetBitsPerComponent();
00126 return *this;
00127 }
00128
00129 bool operator==(const PixelType& rhs) const;
00130 bool operator!=(const PixelType& rhs) const;
00131
00132 bool operator==(const std::type_info& typeId) const;
00133 bool operator!=(const std::type_info& typeId) const;
00134
00135 PixelType();
00136
00137 void Initialize(const std::type_info& aTypeId, int numberOfCompontents = 1, ItkIOPixelType anItkIoPixelType = itk::ImageIOBase::UNKNOWNPIXELTYPE);
00138
00139 void Initialize(mitkIpPicType_t type, int bpe, int numberOfComponents = 1);
00140
00141 virtual ~PixelType() {}
00142
00143 private:
00149 const std::type_info* m_TypeId;
00155 const std::type_info* m_ItkTypeId;
00156
00157 mitkIpPicType_t m_Type;
00158
00159 int m_Bpe;
00160
00161 int m_NumberOfComponents;
00162
00163 int m_BitsPerComponent;
00164
00165 };
00166
00167 }
00168
00169 #endif