Difference between revisions of "ITK/File Formats"

From KitwarePublic
< ITK
Jump to navigationJump to search
m (ITK_DICOM was deleted)
Line 67: Line 67:
  double
  double
  vector<>
  vector<>
Also supports reading and writing
  - itk's SpatialObjects (i.e., scenes containing ellipses, images, vessels, dti fiber tracks, etc)
  - Patient Meta Data (orientation, scan date, comments, modality, etc. - user extensible)
  - data stored in multiple files (e.g., a metaImage file could be a text file pointing to a series of
      2D images that are stacked to form the 3D metaImage).
* Nrrd
* Nrrd
  char
  char

Revision as of 03:58, 28 February 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:

  • Analyze
char
unsigned char
short
unsigned short
int
unsigned int
float
double
RGB<unsigned char>
  • BMP (2D only)
unsigned char
RGB<unsigned char>
  • DICOM
float
char
unsigned char
short
unsigned short
RGB<char>
RGB<short>
  • GDCM
unsigned char
char
unsigned short
short
unsigned int
int
double
  • GE
???
  • GIPL
binary
char
unsigned char
short
unsigned short
unsigned int
int
float
double
short
surface
polygon
  • IPL
???
  • JPEG (2D only)
unsigned char
  • MetaImage (mhd): raw, compressed
char
unsigned char
short
unsigned short
long
ulong
int
unsigned int
float
double
vector<>
Also supports reading and writing 
  - itk's SpatialObjects (i.e., scenes containing ellipses, images, vessels, dti fiber tracks, etc)
  - Patient Meta Data (orientation, scan date, comments, modality, etc. - user extensible)
  - data stored in multiple files (e.g., a metaImage file could be a text file pointing to a series of
     2D images that are stacked to form the 3D metaImage).
  • Nrrd
char
unsigned char
short
unsigned short
int
unsigned int
float
double
  • PNG (2D)
unsigned char
unsigned short
RGB
RGBA
  • SiemensVision
???
  • Stimulate
char
short
int
float
double
  • TIFF (2D only)
unsigned char
unsigned short
RGB
  • VTK
float
double
unsigned char
char
unsigned short
short
unsigned int
int
unsigned long
long
RGB