[ome-devel] Some trouble with RGB image export and import
Roger Leigh
rleigh at dundee.ac.uk
Mon Sep 21 14:04:56 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.
Kind regards,
Roger
--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK Tel: (01382) 386364
The University of Dundee is a registered Scottish Charity, No: SC015096
More information about the ome-devel
mailing list