17 #ifndef mitkPixelType_h
18 #define mitkPixelType_h
28 #include <itkImageIOBase.h>
29 #include <vtkImageData.h>
36 return itk::ImageIOBase::GetComponentTypeAsString(itk::ImageIOBase::MapPixelType<T>::CType);
39 template <
typename PixelT>
76 std::string GetPixelTypeAsString()
const;
81 std::string GetComponentTypeAsString()
const;
86 std::string GetTypeAsString()
const;
93 size_t GetSize()
const;
105 size_t GetBpe()
const;
112 size_t GetNumberOfComponents()
const;
118 size_t GetBitsPerComponent()
const;
128 template <
typename ComponentT,
typename PixelT>
131 template <
typename ItkImageType>
134 template <
typename ItkImageType>
138 const ItkIOPixelType pixelType,
139 std::size_t bytesPerComponent,
140 std::size_t numberOfComponents,
141 const std::string &componentTypeName,
142 const std::string &pixelTypeName);
152 ItkIOPixelType m_PixelType;
154 std::string m_ComponentTypeName;
156 std::string m_PixelTypeName;
158 std::size_t m_NumberOfComponents;
160 std::size_t m_BytesPerComponent;
174 template <
typename ComponentT,
typename PixelT>
181 PixelComponentTypeToString<ComponentT>(),
182 PixelTypeToString<PixelT>());
190 template <
typename ComponentT,
typename PixelT, std::
size_t numOfComponents>
193 return MakePixelType<ComponentT, PixelT>(numOfComponents);
202 template <
typename ItkImageType>
210 template <
typename TPixelType,
unsigned int VImageDimension>
217 template <typename ItkImageType>
236 PixelComponentTypeToString<ComponentT>(),
237 PixelTypeToString<PixelT>());
245 template <
typename TPixelType,
unsigned int VImageDimension>
249 return MakePixelType<ItkImageType>(numOfComponents);
259 template <
typename ItkImageType>
264 mitkThrow() <<
" Variable pixel type given but the length is not specified. Use the parametric MakePixelType( "
265 "size_t ) method instead.";
270 typedef typename ItkImageType::InternalPixelType PixelT;
275 return MakePixelType<ItkImageType>(numComp);
284 imageIO->GetPixelType(),
285 imageIO->GetComponentSize(),
286 imageIO->GetNumberOfComponents(),
287 imageIO->GetComponentTypeAsString(imageIO->GetComponentType()),
288 imageIO->GetPixelTypeAsString(imageIO->GetPixelType()));
295 template <
typename T>
298 return MakePixelType<T, T, 1>();
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
itk::Image< unsigned char, 3 > ImageType
PixelTypeTrait< isPrimitiveType< T >::value, T >::ValueType ComponentType
PixelType MakeScalarPixelType()
An interface to the MakePixelType method for creating scalar pixel types.
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
itk::ImageIOBase::IOPixelType ItkIOPixelType
Object for compile-time resolving of the number of components for given type.
MITKCORE_EXPORT mitk::PixelType MakePixelType(vtkImageData *vtkimagedata)
deduct the PixelType for a given vtk image
Image class for storing images.
itk::ImageIOBase::IOComponentType ItkIOComponentType
std::string PixelTypeToString()
This is an implementation of a type trait to provide a compile-time check for PixelType used in the i...
A helper template for compile-time checking of supported ITK image types.
Compile time resolving of the type of a component.
Object for compile-time translation of a pixel type into an itk::ImageIOBase::IOPixelType information...
std::string PixelComponentTypeToString()
Class for defining the data type of pixels.