Color components and endianess

Adam Goode agoode at andrew.cmu.edu
Thu Jun 17 11:15:57 EDT 2010


On 06/17/2010 03:07 AM, tom nygen wrote:
> 
> Viewing the slide on display, you can see very little difference.
> However, since we perform analysis tasks on the slide based on pixel
> values, the results are not the same when using OpenSlide and native
> Windows API. The difference is small enough but we would like to see if
> we can achieve exact same result with either API. Has anyone tried
> OpenSlide with libjpeg instead of OpenJPEG yet ? I haven't looked at
> source code, but I imagine that it should be easy to switch the jpeg
> library.

Ah, now I understand.

I think you're going to run into problems like this in the future,
possibly even with newer versions of the Mirax API going forward. The
Mirax format is somewhat unique, as it requires that the reader program
do a lot of reconstruction and stitching of data every time the slide is
opened. Other vendors' formats do the stitching once before saving the
file, so slight changes in software will not have as big an effect.

We do use libjpeg for JPEG decompression in OpenSlide, OpenJPEG is
confusingly named and is only used for JPEG 2000 (which is nothing like
JPEG and not used in Mirax). I am pretty sure Mirax uses the Intel JPEG
library which is another reason you will get slightly different output
from what libjpeg does in OpenSlide.

I would advise against relying on exact and unchanging pixel values for
your analysis. Slight adjustments to the internals of OpenSlide and the
Mirax vendor library will result in changes in decompression as you have
noticed. JPEG is, after all, a lossy format. If you want to preserve
exact pixel values for all time, you'll need to recompress the slide
into a lossless format. If you use tiled LZW TIFF for this purpose, you
can even use OpenSlide to read it in the future.

Or, if you would like to experiment with OpenSlide to try to get it
closer to the output of the Mirax API, I would be happy to answer any
questions you may have while you look at the code. I would not bother
trying to do this, however.


Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20100617/7ae2bc8e/attachment.bin 


More information about the openslide-users mailing list