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>
134 const ItkIOPixelType pixelType,
135 std::size_t bytesPerComponent,
136 std::size_t numberOfComponents,
137 const std::string &componentTypeName,
138 const std::string &pixelTypeName);
148 ItkIOPixelType m_PixelType;
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>();
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
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
itk::Image< TPixelType, VDimension > ImageType
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.