Openslide Usage

Benjamin Gilbert bgilbert at cs.cmu.edu
Tue Nov 18 02:20:44 EST 2014


On 11/17/2014 03:49 AM, Nikolay Kladt wrote:
> I have two main goals I want to achieve with the ROI information:

Okay, thanks for the explanation.

> The XML info seems to be located near the end of the file, however,
> reading out the tiff header and the pointer to the first IFD, I was
> (so far) not able to get the byte location of the xml info.

You might be able to reuse the TIFF-parsing code from this script:

 
https://github.com/bgilbert/anonymize-slide/blob/master/anonymize-slide.py

It is GPLv2, but further back in the Git history there is a version 
under the LGPLv2.1.

> Secondly, I wrote concept-code of a brute-force line parser to obtain
> ROI boundaries -> I am very confident that this will work very easily.

XML parsing isn't too difficult in Python.  The lxml package is useful 
for this.

> Considering your suggestions on API changes: I think that providing
> bounding box infos might be a good generic option that could also be of
> use for other formats.

For your use cases, I agree.

Concrete proposal: add four properties for each ROI:

     openslide.region[i].x
     openslide.region[i].y
     openslide.region[i].width
     openslide.region[i].height

which give the pixel coordinates and size in level 0.  Initially we'd 
support these for Leica and Ventana.  We could possibly give bounding 
boxes for MIRAX regions, but I think we wouldn't for now.

Thoughts?

> Last but not least, I talked to our technician; we will generate a few
> standard slides that can be shared openly, however this will take some
> time as we need to obtain suitable left-over tissue first
> (kidney/lung/cortex/heart - something like this).

Thank you very much!

--Benjamin Gilbert



More information about the openslide-users mailing list