Extracting Whole Slide Image by Using OpenslideAPI

Benjamin Gilbert bgilbert at cs.cmu.edu
Tue Nov 22 21:47:45 EST 2011

On 11/22/2011 03:06 PM, TAE WOOK OH wrote:
> When I checked the starting coordinate (0, 12425) in the whole slide
> image by using aperio, the coordinate seems different like (0, 13017) ...
> I think that there is coordinate difference bug.
> For example, based on theory, If i want to extract point (X, Y) from
> the whole slide image, I need to extract the coordinate (X - (width/2),
> Y-(height/2)).

Hi Steve,

The x and y arguments to openslide_read_region() are the coordinates of 
the top left corner of the region in layer 0.  I just checked the output 
of openslide-write-png against Aperio ImageScope, and the coordinates 
line up within a couple of pixels.  Are you seeing this problem with 

> I called below function to extract image from whole slide image.  (.svs)
> openslide_read_region(osr, buf, startCoordinateX, endCoordinateY, 0,
> tile_w, tile_h);

That may be your problem: endCoordinateY should be startCoordinateY.

--Benjamin Gilbert

More information about the openslide-users mailing list