Hi BK,
1.
when I converted a one-channel 16 bit image using the new bio-format, it looks like one channel greyscale image from ImageJ. But when I import the converted image into OMERO, It looks like it became RGB (3ch) image.
moreover, the filesize became bigger (from 2.62MB to 3.94MB).
Is this the same file that you sent a few days ago? If so, the correct behavior is for there to be 3 channels. There are 16 bits per pixel, but 3 channels are packed into those 16 bits (5 bits per channel, with the highest bit unused).
1.1.
when I tried to look at the original image header using bio-formats,
the global meta info was (using ImageReader().getGlobalMetadata())
Global meta info: {Color planes=1, Indexed color=false, Magic identifier=BM, Y resolution=0, X resolution=0, Image height=1024, Compression type=None, File size (in bytes)=2752570, Bits per pixel=16, Image width=1344}
but when I tried to use other Bioformat APIs, such as
- Code: Select all
reader.getCoreMetadata()[0].littleEndian
reader.getDimensionOrder()
reader.getPixelType()
reader.getBitsPerPixel()
reader.getSizeX()
reader.getSizeY()
reader.getSizeZ()
reader.getSizeC()
reader.getSizeT()
the results are
Endian: false
Dimension Order: XYCTZ
Pixel Type: uint8
Bit Per Pixel: 8
SizeX: 1344
SizeY: 1024
SizeC: 1
SizeZ: 3
SizeT: 1
- I was expecting the image's pixel type is something like uint16 and bitperpixel is 16, but it was uint8 and 8 bit per pixel. is this related to the problem that I'm having?
As mentioned above, if this is the same file as before then that is the correct behavior. Since only 5 of the 16 bits per pixel are used for any given channel, the pixel type is set to uint8.
- the sizeZ is 3. This image is just one channel and one slice bmp image. what does this sizeZ mean? is this related to becoming RGB image when converted?
In your example above, the method calls are in X, Y, Z, C, T order, but the labels on the output are in X, Y, C, Z, T order. Could you please just verify that this is not a problem with the labels? I would expect there to be 3 channels, and it is quite simply not possible for BMP files to have 3 Z sections.
2.
Similarly, when I converted 3 bmp images into one (3-channel) ome-tiff image, the file size becomes bigger than 3 times the each file's size. (3*2.62MB should be 7.86MB, but it became 11.8MB when converted).
In this case, that makes some sense. Each image is 1344 x 1024, and stored as 2 bytes per pixel. However, Bio-Formats must expand the 2 bytes into 3 bytes (one byte per channel), so the total size of each image becomes 4,128,768 bytes - multiplied by 3, that's roughly 11.8 MB.
2.1.
I could open the 3 channel ome-tiff image from ImageJ, but when I tried to import it into OMERO server, it gave the following error.
2011-06-27 14:30:06,506 712203 [2-thread-1] ERROR ome.formats.importer.gui.ImportHandler - Generic error while importing image.
java.lang.IllegalArgumentException: Invalid C index: -1/1
at loci.formats.FormatTools.getIndex(FormatTools.java:296)
at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:449)
at loci.formats.FormatReader.setId(FormatReader.java:1058)
at loci.formats.ImageReader.setId(ImageReader.java:650)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
at loci.formats.ChannelFiller.setId(ChannelFiller.java:244)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:238)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
at ome.formats.importer.ImportLibrary.open(ImportLibrary.java:245)
at ome.formats.importer.ImportLibrary.importImage(ImportLibrary.java:483)
at ome.formats.importer.ImportLibrary.importImage(ImportLibrary.java:433)
at ome.formats.importer.ImportLibrary.importImage(ImportLibrary.java:376)
at ome.formats.importer.gui.ImportHandler.importImages(ImportHandler.java:216)
at ome.formats.importer.gui.ImportHandler.access$100(ImportHandler.java:59)
at ome.formats.importer.gui.ImportHandler$2.run(ImportHandler.java:134)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I assume this is an older (4.1.x or 4.2.x) server? I seem to recall fixing a similar problem a while back, but it might be that the fix is only in 4.3.0. If you can send the OME-TIFF file, I can take a closer look.
Regards,
-Melissa