Nanozoomer annotation coordinate system to openslide pixels

Ahmed Bassiouni ahmedbassi at gmail.com
Wed Nov 12 23:37:34 EST 2014


Benjamin,
You are amazing!
I am attaching the results of my test.
Look at the top left point of the 2nd image (which I extracted using my
openslide python script "img.read_region()") and compare it with the black
marker point in the first image to the left of the rectangle (assigned by
the program NPD.view according the the ndpa file)
I would say they are fairly accurate!!
Ahmed
PS Am happy to contribute this code to python-openslide

[image: Inline image 1][image: Inline image 2]

On Wed, Nov 12, 2014 at 8:11 PM, Benjamin Gilbert <bgilbert at cs.cmu.edu>
wrote:

> On Mon, November 10, 2014 10:40 pm, Ahmed Bassiouni wrote:
> > In this way, we need the complete width+length of the whole slide to
> > calculate coordinates.
>
> We've been trying to do the calculation in the wrong order!  We don't
> need the slide size after all.  Here's the approach:
>
> 0. The point coordinates are in physical units, relative to the center
> of the entire slide
> 1. Add the [XY]OffsetFromSlideCentre ==> physical units, relative to the
> center of the main image
> 2. Divide by (mpp-[xy] * 1000) ==> pixel coordinates, relative to the
> center of the main image
> 3. Subtract (level-0 dimensions / 2) ==> level 0 pixel coordinates
>
> --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/20141113/050fb447/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nanozoomer_detail_openslide.jpg
Type: image/jpeg
Size: 294127 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20141113/050fb447/attachment-0001.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openslide_script_test.png
Type: image/png
Size: 1804599 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20141113/050fb447/attachment-0001.png 


More information about the openslide-users mailing list