openslide_read_region returns no picture data
jaharkes at cs.cmu.edu
Wed Dec 8 11:13:06 EST 2010
On 12/08/2010 10:21 AM, Stefan König wrote:
> i try to read a single region out of mirax file (just tried my own and
> the sample files from openslide.org), if i use
> openslide_get_associated_image_dimensions() i can extract my image and
> save work with them but if i try to extract a image by using
> openslide_read_region my dst pointer contains nothing and there is no
> exception either :(
> *width = 256;
> *height = 256;
> uint32_t* dst = new uint32_t[(*width)*(*height)*4];
> openslide_read_region(slideObject, dst, 0, 0, 1, *width, *height);
> if i understand the documentation right, it should take my slide
> object and write a 256x256 area begining at topleft from layer to dst?
I believe that that should work. But it may be that the slideObject
handle got into an error state, you probably should check for errors by
calling 'openslide_get_error' after the call to openslide_read_region
and probably most other calls.
According to the C api documentation, when the object is in error state
openslide_read_region will clear the dst buffer instead of painting to it.
More information about the openslide-users