13 #ifndef mitkPixelType_h
14 #define mitkPixelType_h
24 #include <itkImageIOBase.h>
25 #include <vtkImageData.h>
32 return itk::ImageIOBase::GetComponentTypeAsString(itk::ImageIOBase::MapPixelType<T>::CType);
35 template <
typename PixelT>
72 std::string GetPixelTypeAsString()
const;
77 std::string GetComponentTypeAsString()
const;
82 std::string GetTypeAsString()
const;
89 size_t GetSize()
const;
101 size_t GetBpe()
const;
108 size_t GetNumberOfComponents()
const;
114 size_t GetBitsPerComponent()
const;
124 template <
typename ComponentT,
typename PixelT>
127 template <
typename ItkImageType>
130 template <
typename ItkImageType>
135 std::size_t bytesPerComponent,
136 std::size_t numOfComponents,
137 const std::string &componentTypeName,
138 const std::string &pixelTypeName);
150 std::string m_ComponentTypeName;
152 std::string m_PixelTypeName;
154 std::size_t m_NumberOfComponents;
156 std::size_t m_BytesPerComponent;
170 template <
typename ComponentT,
typename PixelT>
177 PixelComponentTypeToString<ComponentT>(),
178 PixelTypeToString<PixelT>());
186 template <
typename ComponentT,
typename PixelT, std::
size_t numOfComponents>
189 return MakePixelType<ComponentT, PixelT>(numOfComponents);
198 template <
typename ItkImageType>
206 template <
typename TPixelType,
unsigned int VImageDimension>
213 template <typename ItkImageType>
219 typedef typename ItkImageType::PixelType ImportPixelType;
225 typedef typename ItkImageType::PixelType PixelT;
232 PixelComponentTypeToString<ComponentT>(),
233 PixelTypeToString<PixelT>());
241 template <
typename TPixelType,
unsigned int VImageDimension>
245 return MakePixelType<ItkImageType>(numOfComponents);
255 template <
typename ItkImageType>
260 mitkThrow() <<
" Variable pixel type given but the length is not specified. Use the parametric MakePixelType( "
261 "size_t ) method instead.";
266 typedef typename ItkImageType::InternalPixelType PixelT;
271 return MakePixelType<ItkImageType>(numComp);
280 imageIO->GetPixelType(),
281 imageIO->GetComponentSize(),
282 imageIO->GetNumberOfComponents(),
283 imageIO->GetComponentTypeAsString(imageIO->GetComponentType()),
284 imageIO->GetPixelTypeAsString(imageIO->GetPixelType()));
291 template <
typename T>
294 return MakePixelType<T, T, 1>();