Minor bug with Aperio Images with fractional objectives

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Mar 30 03:49:06 EDT 2016


On Wed, Mar 30, 2016 at 9:45 AM, Derek Magee via openslide-users
<openslide-users at lists.andrew.cmu.edu> wrote:
>
>> It's not necessarily obvious what is correct here.
> Agree
>
>>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.
>
> Agree. I suspect many existing programs will use atoi() or equivalent and thus truncate to an integer. These are files from our system (http://www.medicalimagemanager.com) and are the results of image analysis /processing. There we use atof() - the theory being non-integer lenses can exist (even if they are not that popular in pathology). MIM falls back to AppMag text for Aperio formats now as a workaround, so it can read it's own files anyway and Aperio ImageScope can read them too (just truncating objective to an integer). It's not a huge issue.

s/atof()/setlocale (LC_NUMERIC, "C");atof()/

2cts
-- 
Mathieu


More information about the openslide-users mailing list