Minor bug with Aperio Images with fractional objectives
Benjamin Gilbert
bgilbert at cs.cmu.edu
Tue Mar 29 19:30:27 EDT 2016
On Wed, Mar 23, 2016 at 05:36:18AM +0000, Derek Magee via openslide-users wrote:
> At the end of the day a) it's not a huge issue for me personally, b) Does
> it hurt to parse non-integer objectives correctly?
It's not necessarily obvious what is correct here.
The difference between aperio.AppMag and openslide.objective-power is that
the latter is validated and canonicalized. There are three options for how
we can handle the non-integer case:
- Decide that non-integer AppMags are invalid, and decline to expose them
through openslide.objective-power. This is what we do now.
- Expose non-integer AppMags through objective-power but round off to
integer. In this case we would be actively corrupting the data read from
the file. OpenSlide tries not to do that.
- Expose non-integer AppMags as floating-point openslide.objective-power.
Existing programs parsing that property with atoi() or strtol() will,
respectively, corrupt the value, or fail.
If there's a commonly-used tool, or a lens, that produces files with
non-integer AppMag, I'm willing to revisit the issue (by implementing the
third option, probably for every slide format). However, if the vendor's
software is truncating non-integer AppMags to integer, that implies that a
non-integer AppMag is actually invalid: the vendor's software is probably
parsing it with atoi() or equivalent.
--Benjamin Gilbert
More information about the openslide-users
mailing list