[ome-devel] Some trouble with RGB image export and import

Alexander Görtz ome at nyloc.de
Mon Sep 21 15:34:59 BST 2015


> On 16/09/15 12:00, Alexander Görtz wrote:
> > My motivation for the following scenario was that I'm currently concerned
> > with the task of analyzing microscopy images with the OpenCV library for
> > integration into a bigger C++ based software. In my current use case I
> > only have non RGB channels which made the conversion from the bioformats
> > PixelBuffer to a OpenCV Mat quiet easy, but I wanted to test how RGB data
> > is handled in the C++ library. So I tried to create a RGB OME TIFF image
> > from a simple RGB jpg I downloaded from the net
> > (http://nyloc.de/public/test.jpg).
> > For that I used ImageJ and the command line bfconvert function to create a
> > .ome.tif image (http://nyloc.de/public/test.ome.tif).
> > With the c++ library I can read the metadata and the results look ok
> > (http:// paste.pound-python.org/show/KjrtdMefBfzgqAr3ZH5M/) and don't
> > differ from the results given by showinf
> > (http://paste.pound-python.org/show/
> > LmzoDQ7j4vryhmtTs5VM/)
> > But ImageJ shows different meta data if I import the RGB OME TIFF image
> > (https://dpaste.de/ROip)
> > The image opened by ImageJ shows 3 channels but each channel seems to
> > contain the entire RGB image not only a single color as the isRGB false
> > would suggest.
> > 
> > And if I try to open the image data with the OMETIFFReader::openBytes
> > function it crashes with
> > terminate called after throwing an instance of
> > 'ome::bioformats::tiff::Exception'
> > 
> >    what():  TIFFReadEncodedStrip: 2720: Strip out of range, max 2160
> 
> This was due to a bad calculation of strip index with planar samples, I
> think.  My suggested fix is here for testing and review:
> 
> https://github.com/openmicroscopy/bioformats/pull/1986
> 
> This works for me with your test image.  If you'd like to test this and
> see if it works for you as well, that would be most welcome.


I merged the proposed fix and rebuild the package and for me the patch works. 
I tested it with some randomly converted JPG and PNG files with non square 
resolution and it always worked fine.

Alex

PS: Is top or bottom posting preferred on this list?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20150921/698f6f1f/attachment.asc>


More information about the ome-devel mailing list