openslide_read_region returns no picture data

Hauke Heibel hauke.heibel at
Tue Dec 14 07:32:59 EST 2010

Hi Stefan,

did you already try one of the lower layers? Even now it might be happening
that by chance you are requesting a region which does not contain image
information - though considering your dimensions, the chances are quite low.

Maybe something like this works

int32_t max_layers = openslide_get_layer_count(slideObject);
int32_t layer = max_layers - 3;

int64_t w,h;
openslide_get_layer_dimensions(slideObject, layer, &w, &h);

std::vector<uint32_t> dst(w*h);
openslide_read_region(slideObject, &dst[0], 0, 0, layer, w, h);

Thus it were at least ensured that the retrieved image information fits into
memory and covers the whole image.

Over here, this is working with the CMU datasets and I have no idea what
else could be wrong.

Regarding openslide_read_associated_image I am not sure what this is doing.
If it is just reading one of the JPEGs in which the virtual slide is stored
on disk, it does not make much sense for MIRAX files since to my best
knowledge every JPEG file consists of multiple tiles which need to be
properly blended/stitched. Also, as opposed to openslide_read_region all
associated images do contain image information, i.e. none of the images from
disk contains only blank data.


2010/12/14 Stefan König <blogdde at>

> i tried it now with this call:
>       openslide_read_region(slideObject, dst, 27500, 27500, 0,
> *width, *height);
> even if i set dimensions to 10000x1000 i get only (big) plane black
> pictures, i tried some different mirax files right now, allways the
> same thing.
> this produces a black image too
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the openslide-users mailing list