export annotations in xml

442 views
Skip to first unread message

David

unread,
Aug 21, 2018, 10:02:15 AM8/21/18
to QuPath users
Hi Pete,

you once posted a script to export annotations. The written files do not have a format ending and are probably in a binary format.
Is it also possible to export annotations as xml file?

Best
David

Pete

unread,
Aug 21, 2018, 10:20:52 AM8/21/18
to QuPath users
It would be possible, but a specification would be needed for the XML.

Also, depending on what software you want to read in the annotations again, not all the annotations QuPath could potentially write might be supported (e.g. regions with separate parts, holes).

Eric Perspicace

unread,
Jan 15, 2019, 6:50:33 AM1/15/19
to QuPath users
Dear David,

I saw that your post is old and I guess you found a way to export annotations as XML file.

Indeed, I'm looking for similar things as I would like to draw annotations using QuPath and then export annotations in order to read those on proprietary softwares (eg CaseViewer and ImageScope).

I would appreciate your help.

Thanks in advance.

Best,

Enrico Perspicace

Pete

unread,
Jan 15, 2019, 7:03:09 AM1/15/19
to QuPath users
Do CaseViewer or ImageScope support importing annotations in any open format?  The problem is generally not exporting from QuPath, but rather exporting to the correct format for compatibility with other software (which means that the format needs to be somehow open and documented, rather than closed and proprietary).

One further consideration is not that no proprietary software necessarily supports the kinds of complex annotations QuPath can make (e.g. complex shapes with multiple pieces and internal holes).... in which case a fully compatible export may not be possible.  But again, that is an issue mostly on the side of the software in which you want to view the annotations.

Finally, can you say a bit more about why this is necessary?  Is it for analysis in the other software, or just for viewing?

Eric Perspicace

unread,
Jan 16, 2019, 7:36:54 AM1/16/19
to QuPath users
Dear Pete,

Thank you for your quick reply. I thought that XML files are gold standard for importing annotations in any software.

The idea is indeed to do additional work on images. In particular I would like to perform caption of small part of images (containing the annotations) in order to import in Powerpoint presentation.

As you know on whole slide image is very difficult to see where exactly particular cells are annotated.

Also, in CaseViewer, when you perform this work you can add additionnal information such as slide name, annotations, scale bar,...

Do you think it is possible with Qupath?

Thanks for your reply.

Best regards,

Enrico

Pete

unread,
Jan 16, 2019, 8:09:06 AM1/16/19
to QuPath users
Hi Enrico,

XML is certainly widely used, but the contents of XML files written by different software applications can be very different (and incompatible).  So a specification for the particular XML used for the software is also needed.

For your application, you can certainly export smaller snapshots from QuPath, e.g. https://github.com/qupath/qupath/wiki/Exporting-results#exporting-snapshots
If you manage to get everything aligned so that the scalebar that is already displayed in the bottom left is acceptable then that could be enough, although captions would need to be inserted elsewhere (maybe PowerPoint itself).  You can control the line thickness and defaul color of any annotations in the QuPath preferences if you like.

The other option in QuPath is to send an image region to ImageJ, in which case QuPath should set the pixel size information appropriately so that scalebars can be added in ImageJ if needed: https://github.com/qupath/qupath/wiki/Working-with-ImageJ
ImageJ then gives more options for how to display the scalebar or add other information, e.g. see https://imagej.net/Annotating_Images

Best wishes,

Pete

Eric Perspicace

unread,
Jan 17, 2019, 6:19:21 AM1/17/19
to QuPath users
Hi Pete,

Thanks for your reply.

I think I have all in hands to go further.

Best wishes,

Enrico
Reply all
Reply to author
Forward
0 new messages