How to create a python script that returns various characteristics

Im a new user and I am having a hard time finding the methods for trying to write a script (preferably in python, but I could learn groovy if needed). Ideally the script would be able to return the following:

  1. the mean epithelial to stromal area ratio
  2. mean epithelial thickness
  3. mean gland lumen roundness
    After looking into multiple softwares, I felt QuPath was the best for achieving this. However, if there are any other softwares you guy would recommend that could better automate this I am open to suggestions.

Thanks in advance!

Hard to say too much without some example of what you are trying to accomplish, but the forums are rife with scripts, and I accumulated a few of them here.
Pete has his own set as well.

Even more information regarding scripting in his blog, as well.

1 Like

And depending on how into it you want to get, you can definitely run a QuPath script on an image via Python, write out the results, then move the file somewhere else after processing.
More info on the old forum.

It’s not clear to me if you have any image analysis method to identify the things you mention yet. Since the measurements you want to make aren’t trivial, that would be the first thing to establish before worrying about the scripting.

I’m assuming you have whole slide scans of H&E tissue sections but I’m guessing that - if you post more information and example images/screenshots others may be able to help more.

Apart from that, QuPath doesn’t support Jython in the way Fiji does*; with QuPath, it’s best to stick with Groovy (which I’d say is much more powerful and performant anyhow… and since Jython doesn’t work with Numpy etc. then I don’t see many advantages in it).

*-There is some (slightly hidden and incomplete) support for multiple scripting languages in QuPath, but there’s a strong chance this will be removed in the future in favor of supporting one scripting language better.