What is the command to get image properties in Groovy?

405 views
Skip to first unread message

Murali S

unread,
Oct 3, 2017, 3:46:27 AM10/3/17
to QuPath users
Hi,

I would like to get the image properties like path, maginification, width, height and so on in groovy script. Thanks in advance!.

Thanks & Regards,
Murali S.
Screen Shot 2017-10-03 at 1.14.52 PM.png

Pete

unread,
Oct 3, 2017, 3:56:35 AM10/3/17
to QuPath users
Hi, those are accessed from the ImageServer (https://github.com/qupath/qupath/blob/v0.1.2/qupath-core/src/main/java/qupath/lib/images/servers/ImageServer.java).

You can access the ImageServer for the current image using something like the following

server = getCurrentImageData().getServer()

and then request the information from that.  The right methods should hopefully be clear enough (e.g. server.getPath(), server.getWidth(), server.getHeight().

Murali S

unread,
Oct 3, 2017, 4:24:34 AM10/3/17
to QuPath users
Thank you very much for the quick response Pete:-)
Reply all
Reply to author
Forward
0 new messages