Run qupath pixel classification using a script

hi qupathers,
is it possible to run a pixel classification protocol using a script?
i’d like to be able to change the parameters in a script as you would with positive cell detection for example.

Near duplicate of: Editing thresholder

Essentially, you could edit the values in the text file directly, save, and then run the standard pixel classifier scripts from the Workflow as shown in the documents, but I do not think there is any other way currently. It would be nice to load the settings from a classifier into the classifier interface.

ok thanks, sorry for duplication!

1 Like

A workaround might be to save thresholders with different parameters and trigger them using a script. In this example I have pixel classifier saved with the file name 1. Is it possible to input into the addPixelClassifierMeasurements?

int t = 1
addPixelClassifierMeasurements(' + t + ',' + t + ')
//ERROR: InvalidPathException at line 2: Trailing char < > at index 6:  + t + 
//ERROR: IllegalArgumentException at line 3: Unable to find object classifier t

I think you should be able to add a string, but not an int.
Something like, though I have not tested

String t = "1"


String t = "1"

Great, thanks again, this works:

String t = '1'