Closed LuisOlivaresJ closed 9 months ago
That's a good question. I never realized Pillow was truncating to 8-bit, so I never investigated on the what the impact was. It might be worth the shot to see if we can switch from Pillow to tifffile. I think I used Pillow as it was used in pylinac, but I had a few problems with it and was not a big fan. Don't know if switching to tifffile would be easier.
I'm going to work on this.
Examining the code https://github.com/jfcabana/omg_dosimetry/blob/4f1851566cb79edce2b3a77591232305e89ef3d7/src/omg_dosimetry/imageRGB.py#L940-L943 I realiced OMG uses pillow only to read tagged information from a tif file. Instead pillow, imageio is used to load the array (using tiffile as backend). I apologize for my mistake, think I was confused with pylinac.image module.
An update to imageio import would be enough. I'll make a pull request. #25
Hi Jean,
If it is possible, could you share what is your experience working with 8-bit pixel resolution? OMG uses Pillow to load tiff files. As can be seen in Pillows documentation, 16-bit multichannel TIFF data is truncated to 8-bit precision (0-256 integer values). Therefore the range of pixel values and the resolution are reduced.
As an example, working with a dose range of 0 - 10 Gy, and 100 useful bins (see the histogram below), the resolution is about 10 Gy / 100 = 0.1 Gy (or 1 %). Additionally, overall dose uncertainty is also affected.
Do you think that this is a real issue so we need to use other module to load tif files? for example I use tifffile.