Difference between revisions of "ITK/File Formats"
m (Mention vector and compressed support for MetaImage)
|Line 20:||Line 20:|
Revision as of 20:40, 13 January 2005
ITK features a powerful plugin-based IO mechanism for reading and writing images, which is covered in detail in Chapter 7 (PDF page 219) of the ITK Software Guide.
File Formats and Pixel Types
The itk::Image<> class can be templated over virtually any pixel type, however not all file formats support all data types for reading and writing. In some cases, it may be necessary to add an itk::CastImageFilter<> to convert the output to a pixel format appropriate for the target file. It is important not to truncate the data by converting to a smaller type (ie. short -> char). In this case, the itk::RescaleIntensityImageFilter<> can be used before casting.
The following table lists the built-in file format support against each data type:
char unsigned char short unsigned short int unsigned int float double RGB<unsigned char>
- BMP (2D only)
unsigned char RGB<unsigned char>
float char unsigned char short unsigned short RGB<char> RGB<short>
unsigned char char unsigned short short unsigned int int double
binary char unsigned char short unsigned short unsigned int int float double short surface polygon
- JPEG (2D only)
- MetaImage (mhd): raw, compressed
char unsigned char short unsigned short long ulong int unsigned int float double vector<>
char unsigned char short unsigned short int unsigned int float double
- PNG (2D)
unsigned char unsigned short RGB RGBA
char short int float double
- TIFF (2D only)
unsigned char unsigned short RGB
float double unsigned char char unsigned short short unsigned int int unsigned long long RGB