12.7. Data Types for DICOM and TIFF

The DICOM standard does not support pixel data types other than signed and unsigned integer, and the maximum bit depth is 16. This is the reason why in MeVisLab, the data is saved as float and (u)int32 data in DCM/TIFF format. This data type is correctly encoded in the TIFF format, and the DICOM file is written as if it was an (u)int16 image.

The data is saved as follows:

In MeVisLab, the libraries libtiff and dcmtk (by DICOM@offis) are used to read these files. The following applies:

The MeVisLab binding (for example as used in ImageSave and ImageLoad) does not support the double image data type for TIFF.

As consequence, images with data of the type double cannot be saved as TIFF by ImageSave. As a workaround, you can either convert the data type to float or use MLImageFormatSave and MLImageFormatLoad.

However, the images can be saved as RAW images with double data type.

[Tip]Tip

For loading several TIFF files, use the module ImageLoadMulti. This should not be confused with loading a multi-page TIFF file (in which several images are saved); that format is not supported by MeVisLab.

[Tip]Tip

The page size delivered by the ImageLoad module is actually not determined by the pageSizeHint field, but by the file format module reading the image data. Only if the file format allows reading the image data in different (or even arbitrary) pages, the pageSizeHint is used. (That is why it is called page size hint and not page size.) For the TIFF format, the page size is fixed by the size of the tiles in the TIFF file holding the image data. To change the page size for successive modules, ImagePropertyConvert needs to be used. For RAW images, the page size hint can be set.