ImageIO for handling Mevis dcm/tiff images,
- first public version (no 4D support) developed using gdcm 2.0.10, tiff 3.8.2 and itk 3.10.0
NOTES:
- It is good to realize that ITK images have some properties like spacing and orientatin defined only for the dimensionality of the image, e.g. 2D slices does not have 3D vector sizes of origin/spacing etc., while dicom may have these defined. The other way around, 4D information are not stored in the dicom file, e.g. origin[3] will be lost when writing. When reading we use default values for origin (=0) and spacing (=1). Another important issue is the direction matrix, dicom only stores x/y vectors, and calculates the third one using outer vector product (assuming right-hand coordinate system).
- tiff image is always 2D or 3D
- IMPORTANT: tiff has been designed for max 32 bits addressable memory block, the use of 64 bits has been specified in bigtiff.org, and is supported from libtiff version 4.0 and above. Unfortunately, ML does not support bigtiff, and probably will not in the future. Therefore, this class remain as is as long ML will not upgrade, only bug fixes will be considered
- IMPORTANT: 4d information is lost in the writing of the dicom files! This severely limits the use of this format in the future. Default values for 4D spacing is set at 1.0 and for origin at 0.0 (when reading)
PROPERTIES:
- 2D/3D/4D, scalar types supported
- input/output tiff image expected to be tiled
- types supported uchar, char, ushort, short, uint, int, and float (double is not accepted by MevisLab)
- writing defaults is tiled tiff, tilesize is 128, 128, LZW compression and cm metric system
- default extension for tiff-image is ".tif" to comply with mevislab standards
- gdcm header during reading is stored as (global) metadata to fill in the gdcm header when writing. All 'image' values, eg voxelsize, dimensions etc are overwritten, except min/max value of the image and intercept/slope.
- note: when reading and writing dcm/tiff 2D files, the third dimension of spacing and origin are replaced with default values! In MevisLab these vars are contained.
- BUG in ML: the x/y spacing of the tiff file is swapped with respect to the x/y spacing in dcm file (dcm info is used btw)
todo
- implementing writing tiffimages if x,y < 16 (tilesize)
- adding gantry tilt to test data!
- replacing messages using itkExceptions
20 Feb 2009 bugfixed; always set the pixeltype of the dcm image to unsigned short when writing, otherwise the origin is not read in correctly by mevislab (for int, float, double) 30 sep 2009 bugfix: consistent handling of 2d/3d throughout code, thanks to Stefan Klein for pointing out of this bug which revealed after usage on 2d on windows and thanks for his suggestions to fix this. 11 dec 2010 added 4d support, note tiff image is always 2D or 3D 18 apr 2011 added reading dicom tags from sequences of tags, suggestion and code proposal by Reinhard Hameeteman
email: rashi.nosp@m.ndra.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Definition at line 109 of file itkMevisDicomTiffImageIO.h.