Open Slide Read Region

Stephen Yip stephen.fyip1 at gmail.com
Sun Jun 11 11:07:16 EDT 2017


Thank you so much for the help!

I have highlighted how my problem is resolved.

1) I used skimage.transform.resize rather than cv2.resize to downsample my
image

2) openslide_read_region(osr, d*x, d*y, 0, d * w, d * h) ; where d is the
number of times the image gets downsample from level_0
(yes, x and y need to be multiplied by d !)

3) Works perfectly!

4) Lesson learned: cv2.resize shifts pixels in some strange manner.

Thanks again!
Stephen




On Fri, Jun 9, 2017 at 12:33 PM, Benjamin Gilbert <bgilbert at cs.cmu.edu>
wrote:

> On Fri, Jun 09, 2017 at 10:02:23AM -0400, Stephen Yip wrote:
> > 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?
>
> If openslide_get_level_downsample(osr, l) == d,
> openslide_read_region(osr, x, y, l, w, h) maps to
> openslide_read_region(osr, x, y, 0, d * w, d * h).
>
> --Benjamin Gilbert
> _______________________________________________
> openslide-users mailing list
> openslide-users at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20170611/26871a1c/attachment.html>


More information about the openslide-users mailing list