Problem by exporting masks on Qupath for Stardist


I am trying to export the annotations from Qupath in order to train the Stardist model but when I use the given scripts I get the correct image but an empty mask. I tried to use the following scripts:

Do you know which can be the problem? Thank you very much in advance!


Hi Julian, welcome to the forum!

Just checking, how do you know that the mask is empty? Can you post/upload one of the empty mask images here?

My first thought would be to check whether the classes of your objects are all correct (as described in the scripts) - but more information about the state of your project and the output, as @uschmidt83 mentions, would be needed for further troubleshooting.

Thank you very much for the very fast answers! I am just starting and therefore it is very probable that I am doing a very simple error…
As shown in the uploaded pictures the saved mask appears as just a black square, while in the project I annotated the both classes I need and tried to export them with the script:

The only annotations that should be used are those that are classified as described in the script. Unless you have edited the script, all of the Pt annotations should be ignored.

You need rectangular annotations that have classes "Training" and "Validation"
After you have placed these annotations, lock them and start drawing the objects inside

Also, just looking at any output is not likely tell you much since the values will be too low for you to see without adjusting the brightness and contrast. You can open the masks in FIJI or QuPath and mouse over the image to see if the pixel values reported are all 0.

Yes, it worked! Using this script:

It is no even needed to use the “training” or “validation” classes and it worked fine. By opening the masks with Qupath it was possible to see the annotations. Thank you!