[ome-devel] bfconvert 5 produces 16-bit tiff files that cannot be read by freeimage
Tjelvar Olsson (JIC)
Tjelvar.Olsson at jic.ac.uk
Mon Jul 25 15:33:47 BST 2016
Dear OME,
I have for some time now been finding myself switching back to bfconvert version 4 when dealing with 16-bit microscopy images.
The reason for this is that bfconvert version 5 produces tiff images that cannot be parsed by the freeimage library.
Today I thought I'd spend a little bit of time trying to work out what is going on and send a query to your mailing list.
The error that I get from freeimage is:
FreeImage error: Unable to handle this format: bitspersample = 16, samplesperpixel = 1, photometric = 3
I suspect that this has to do with the photmetric flag, which I don't really know anything about.
However, looking through the freeimage source code I think it can be traced to the
"IsValidBitsPerSample" function on line 1079
https://github.com/imazen/freeimage/blob/master/Source/FreeImage/PluginTIFF.cpp#L1097
In particular the check for the whether or not the "photometric" is a "PHOTOMETRIC_PALETTE" on line 1111.
https://github.com/imazen/freeimage/blob/master/Source/FreeImage/PluginTIFF.cpp#L1111
Inspecting the content of the TIFF files generated using bfconvert it seems that one difference between version 4 and 5 is that the former has a photometric interpretation "BlackIsZero" and the latter "RGB Palette".
Was this change in going from version 4 to 5 intentional?
What was the rationale?
I would love to be able to use newer versions of bfconvert on 16-bit micoscopy files and parse the files using freeimage.
Do you think this will be possible in the future?
Versions used here:
Version: 4.4.2
VCS revision: c2322fc
Build date: 25 August 2012
Version: 5.0.6
VCS revision: 33b1150
Build date: 10 November 2014
Kind regards,
Tjelvar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20160725/2129eba9/attachment.html>
More information about the ome-devel
mailing list