Error message when running the StarDist-Script for a second time


whenever I run my stardist-script for on a second annotation in one picture, there is the Error message: “revert to last saved version? All changes will be lost” printed out. This is independent of when I saved for the last time and is also prompted out when I move to another image. Even if I click okay, he won’t let me run the script again.

Is this supposed to be like this? What can I do to continue?

It looks like you’re using the Cmd + R shortcut. This does different things depending upon whether the main QuPath window or script editor is in focus.

(A recent updates is that you can now also run by right-clicking in the script editor & selecting the option, rather than going to the Run menu at the top of the script.)

1 Like

aren’t you the one to propagate memorising shortcuts in all your tutorials? :wink: Thanks, it works now.

Just as I have you here: Is there a way to run the Stardist-Script over a project, without manually selecting the annotations, but instead just measuring all of them (as it now only gives back the “select a parent-object” - I thought that the getSelectedObjects()-command would do that?)? Just as it is possible with the built in cell detection to just run it for the whole project…

Thanks - you guys are true geniuses and making my doctoral thesis so much more fun for me!

1 Like

Ok I’ll revise that to mostly just Cmd + L, and the one-letter shortcuts for tools and showing/hiding :slight_smile: But none of them will help here, since they only refer to the main GUI…

Sure, using

def pathObjects = getAnnotationObjects()

rather than

def pathObjects = getSelectedObjects()

should do it (assuming you’re using the script I think you’re using). Or throwing in selectAnnotations() somewhere as an alternative (but generally it’s best to avoid relying on selections if you don’t need them, since they can make scripts a bit slower and more confusing).

PS. When half-remembering a scripting command you can start to type it and press Ctrl + Space repeatedly to cycle through auto-completions… another script-editor-only shortcut to memorise…

1 Like

I have seen you mention this a few times (I think prior to 0.2.0 release even), but whenever I try it, nothing happens. Is there some setting I may have disabled, or might it not work QuPath is built through Git (vs installer)? I have tried both left and right CTRL+Shifts, and at different points in the scripting process or command (Win7/10, multiple versions up through current). Are there particular types of commands it works for?

Well, it didn’t help that I typed Shift but meant Space

This is how it should look (just typing the start of something valid, then Ctrl + space):


Oops. Yes, that did it.

1 Like

Off topic, but what did you use to make the GIF? That looks super handy. on Ubuntu (after checking my email to find the link from the person I had asked the same question).

1 Like