Open Slide Read Region

Stephen Yip stephen.fyip1 at gmail.com
Fri Jun 9 10:02:23 EDT 2017


I apologize for the confusion. 

Since the entire level 0 image is too big to open, I defined my region of interest (roi) on the level 2 image. 

The roi is defined on level 2 and read_region read the level 0 coordinate. I thus want to map that to level 0 coordinate to get the corresponding "cropped patch". 

What is the corresponding level 0 coordinate and size of the roi that is defined on level 2?

Is there any way to accurately do the mapping or is there a smarter way to do that? 

Thanks,
Stephen 

> On Jun 9, 2017, at 8:59 AM, Jan Harkes <jaharkes at cs.cmu.edu> wrote:
> 
> 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
> _______________________________________________
> 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