Qupath export region (saturation image only)

Hi there,

I would like to export the saturation image of a *.scn function (thereby collapsing three colour channels into one) to a tiff file. In other words, the “Export Region” function in qupath, but only retaining the saturation information. Is there any way to do this through the user scripts, or imagej plugins?

Thanks for your time!

Regards

Andrew

I’m not totally sure what you mean by ‘saturation image’, and don’t know if you have a whole slide image or something smaller.

But my guess is that if the size is ok, it will be easiest to do what you want by sending the image to ImageJ: https://github.com/qupath/qupath/wiki/Working-with-ImageJ

The saturation image is one of the options that is available when you use the Colors module to view the image using different colormaps. I believe the saturation (the “S” in HSV) is calculated as max(R,G,B)-min(R,G,B)/max(R,G,B). I am trying to convert a whole slide image.

Thank you for the advice - I will look into this functionality and see if I can manipulate the image after it has been sent to imageJ.

Ah, ok. You can apply the color transform before sending it to ImageJ through the GUI. However, ImageJ will not be able to handle/write a whole slide image at full resolution.

I’m not sure what the eventual goal is and where you will use the resulting whole slide image. I’d really try to avoid needing to write a whole slide; the RGB -> Saturation transform should be quick to apply dynamically, but writing an entire whole slide image is slow, complex and requires a lot of storage (especially without lossy compression).

Hi Pete,

Where would I apply the color transform through the GUI? If I am able to do the color transform and then export it to a tiff file directly from Qupath, then that meets my goals. FYI I am on revision 0.2.0-m2.

I am trying to relate a MRI image of the same tissue to the area fraction occupied by the stain… further processing will require me to programatically specify ROIs on the whole slide image, with each ROI corresponding to one MRI pixel. That’s why I need the entire slide image.

You apply the transform just by clicking the checkbox in the Brightness/Contrast window: https://github.com/qupath/qupath/wiki/Changing-colors
Although this is just calculated dynamically for visualization, if you do it before sending the region to ImageJ then the transformed values should be sent.