Understanding API openslide_read_region's arguments

Sriram Somanchi ssomanch at andrew.cmu.edu
Tue Nov 13 17:41:42 EST 2012


Thanks Benjamin for your answers. 

So if it computes the averages on the fly is the second call (with
coordinates (2,2) ) slower than the first one (with coordinates (0,0) )?

-Sriram

-----Original Message-----
From: openslide-users-bounces+ssomanch=andrew.cmu.edu at lists.andrew.cmu.edu
[mailto:openslide-users-bounces+ssomanch=andrew.cmu.edu at lists.andrew.cmu.edu
] On Behalf Of Benjamin Gilbert
Sent: Tuesday, November 13, 2012 5:32 PM
To: openslide-users at lists.andrew.cmu.edu
Subject: Re: Understanding API openslide_read_region's arguments

On 11/12/2012 07:57 PM, Sriram Somanchi wrote:
> Can someone explain me the API openslide_read_region's arguments x and 
> y? The documentation says that it is in reference to level0. Does it 
> mean that if I am retrieving image data from higher levels I have to 
> always map the coordinates to level0 and then make a call?

Yes.

> let's say the downsample for level1 is 4. If I make a call 
> openslide_read_region(slide, buf, 0, 0, 1, 1, 1) I know I will get an 
> approximate aggregate of 4x4 grid of level 0 starting at 0, 0. However 
> I'm not sure what will a call like openslide_read_region(slide, buf, 
> 2, 2, 1, 1, 1)?

You'll get the average of the surrounding 2x2 pixels in level 1.  We place
slide tiles at sub-pixel resolution; Cairo then renders them to real pixels.

Note that downsamples are not always integers.

--Benjamin Gilbert

_______________________________________________
openslide-users mailing list
openslide-users at lists.andrew.cmu.edu
https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users




More information about the openslide-users mailing list