Open Slide Read Region

Jan Harkes jaharkes at cs.cmu.edu
Fri Jun 9 08:59:20 EDT 2017


I am pretty sure you don't have to multiply (or divide) the x and y coordinates. Openslide always uses the level 0 coordinates and does the dividing and any necessary shifting for you when you read a region at any higher levels.

Jan

On June 9, 2017 8:20:39 AM EDT, Stephen Yip <stephen.fyip1 at gmail.com> wrote:
>Hi,
>
>Let me clarify my question. I attempted to map level 2 to level 0
>coordinate by multiplying the former 8 times, but there was a
>"significant" shift in this mapping procedure. And the amount shift
>depends on the location, which is super bizarre to me.
>
>Does anyone know how to map from level 2 or 1 to level 0 coordinate and
>vice versa? 
>
>Thanks!
>Stephen 
>
>> On Jun 9, 2017, at 2:36 AM, Benjamin Gilbert <bgilbert at cs.cmu.edu>
>wrote:
>> 
>>> On Fri, Jun 09, 2017 at 12:29:42AM -0400, Stephen Yip wrote:
>>> I am trying to crop a level_0 region out based on the level_2 region
>using
>>> the osi.OpenSlide().read_region(). The resolution of level_0 is
>*eight*
>>> times higher than level_2.
>>> 
>>> I used the read_region function for cropping.
>>> osi.OpenSlide().read_region(x1,y1,level=0,dim1,dim2)
>>> 
>>> where (x1,y1) are the coordinate of the below green rectangle (see
>figure)
>>> multiply by *eight*.
>> 
>> Hi Stephen,
>> 
>> (x1, y1) are always level 0 coordinates, regardless of the level you
>are
>> reading.
>> 
>> --Benjamin Gilbert
>> _______________________________________________
>> openslide-users mailing list
>> openslide-users at lists.andrew.cmu.edu
>> https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
>_______________________________________________
>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