When I'm reading an image, the itk::ImageIOBase
, as implemented here, tels me that the image has a RGB pixel type. The format of the image is TIFF, but can be png or gif as well.
itk::ImageIOBase::Pointer imageIO =
itk::ImageIOFactory::CreateImageIO(
fileName, itk::ImageIOFactory::ReadMode);
How to know, through ITK, whether the image is actually a palette image, i.e. scalar image along with a color palette, and read the image as a scalar image + palette ? I need to retrive the index, as stored in the file as well as the color palette used in the file.
For now, my only solution is to use freeImagePlus to identify and read this type of image. I haven't found any function in the class ImageIOBase
that could relate to that.
Any help would be appreciated, I haven't found much information on this on the internet !
To answer my own question, the feature is now implemented in ITK, in the master branch, and offer the support of palette for png tif and bmp images
Here a working example, for those who are interested :