Script to easily export multichannel IF snapshots

Hi,

This post is mainly motivated by laziness, and my current inability to write scripts in groovy…: I am looking for a way of easily export snapshots from multiplexed IF images within QuPath, including the overlay image and each single colors (without including any annotation or analysis features… simply the image). It is pretty long to do manually when taking many snapshots (especially ticking off each channel to have single colors and overlay etc.), and I feel I (and certainly others) would greatly benefit from such feature.

Here is a bit more details of what I would like to do: say I navigate through a slide/tissue, and find a region of interest. I go to the preferred magnification and ideally I would like to be able to run a script that would automatically export what is seen in the middle of the viewer:

  • for example at a defined size (e.g. a square of 1024*1024px)
  • of the overlay+single colors
  • in a directory with a structure like “filename_snap1_overlay.png” “filename_snap1_channel1.png” “filename_snap1_channel2.png” etc… (I assume exporting .tiffs would be irrealistic?)
  • ideally with the option of including the size bar information…

I know it sounds like I am looking for a sort of graal… does this sound feasible? or has anyone already written/used similar script?

Many thanks in advance for your help

It sounds like you might be able to modify Sara’s script here to do something similar.
https://groups.google.com/forum/#!msg/qupath-users/aHcikTZF9HE/dkcn0BoFBwAJ
It sounds like that one goes through channels.

I am fairly certain that it would have been written for 0.1.2/3, however, so keep that in mind!

Thank you… I had a look at it and indeed it seems like this could be a place to start, but any of my attempts did not lead anywhere close to a script that would actually work. It’s difficult as I really don’t know to write in groovy, it seems that it would require more than a few tweaks :sweat:

Sorry, I haven’t really done much with the exporting, but maybe @smcardle has another version of the script she would be willing to share that doesn’t have the Zstack functions, or maybe one that works in m3.

I have some ideas for how to do this, but it might take me a few days to get to it. Which version of QuPath are you using?

2 Likes

I am using the last version at the moment (0.2.0-m3). Thank you very much @smcardle, your help with this would be greatly appreciated!