openslide_read_region filling buffer with 0's for Mirax

Terry Wilson twilson7755 at
Thu Apr 9 17:21:13 EDT 2020

I am using the C interface to the windows version of OpenSlide.  I have
successfully used it to for a number of different formats, however, the
same code does not appear to be working for Mirax slides.  I am able to
open the slide and see the various properties, however, anytime I try
calling openslide_read_region, it always just fills in the buffer with
0's.  According to the documentation that is an indication of some error,
however, calling openslide_get_error immediately after just returns a null
error object.

I saw an older post from someone on this mailing list who seemed to have
the exact same problem I am having with Mirax slides ... unfortunately they
seemed to eventually get it working but had no idea what they changed to
get it to work.  So I am looking for some suggestions on what to try.  I
have tried retrieving all the data for the entire level 0 using a tile size
of 512x512 and they all seem to come back with 0's.  I tried getting an
entire higher level (level 6) with one call but same result.  I have also
tried various different Mirax slides (including some of the demo ones from
the OpenSlide site) The code is pretty simple:

// Try reading a single tile
// x, y values start at 0,0 and increase based on the tile size
int size = 512;

uint32_t *data = new uint32_t[size * size];

openslide_read_region(openslide, data, x, y, 0, size, size);
const char* err = openslide_get_error(openslide);
if (err != NULL)
    printf("error detected");

I used openslide_get_property_names / openslide_get_property_value to dump
out all the various metadata values for the slides ... is there some value
in this metadata that I need to be accounting for (I assumed that the
OpenSlide library was already doing that)? Any suggestions on how to
trouble shoot this problem would be greatly appreciated.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the openslide-users mailing list