[ome-users] Bug with czi files / loci.formats.gui.Index16ColorModel

Ramakrishnan Chandrasekhar chandrasekhar.ramakrishnan at bsse.ethz.ch
Wed Apr 3 10:19:52 BST 2013


Hello,

I have some czi files I need to read and process. I'm reading these with BioFormats (4.4.6), but I am finding some odd behavior. I need to extract the intensity values for each channel — red, green, and blue — from the image. For some czi files, this works fine, but for others I get bizarre results. Calls to image.getRGB(x, y) return 0 for the red, green, and blue channels. However, when I open the files using ImageJ/BioFormats, I see something: so the images are not all black.

The problem seems to be connected to the color model. Images that use color models from the java.awt.image package work correctly; images that use the loci.formats.gui.Index16ColorModel do not. In fact, if I dig into the image's raster object, I find non-zero values at certain coordinates, but when I ask the color model for the red or blue at this coordinate, I get zero, and when I ask the color model for green, e.g., colorModel.getGreen(image.getRaster().getDataElements(x, y, null)), I get the raster value at that coordinate, but byte swapped. I can construct an image using the values from the raster at each coordinate and I see the same thing I see when I open the file with ImageJ.

I've put together a zip containing two example images, one that behaves correctly with my code and one that does not, along with a small example program that extracts the information from the image to demonstrate the problem.

http://www.illposed.com/czi-bug-report.zip

I would appreciate it if you could take a look. Let me know if you need any additional information or example files.

Thanks,

Sekhar

--
Chandrasekhar Ramakrishnan
chandrasekhar.ramakrishnan at bsse.ethz.ch<mailto:chandrasekhar.ramakrishnan at bsse.ethz.ch>




More information about the ome-users mailing list