Parameter in script

I am currently writing a script and I have the following question. How can i use a parameter instead of a value in a runPlugin(…) ?

valueX = 160.0
runPlugin(‘qupath.imagej.detect.tissue.SimpleTissueDetection2’, ‘{“threshold”: valueX, “requestedPixelSizeMicrons”: 1.0, “minAreaMicrons”: 10000.0, “maxHoleAreaMicrons”: 1000.0, “darkBackground”: false, “smoothImage”: true, “medianCleanup”: true, “dilateBoundaries”: false, “smoothCoordinates”: false, “excludeOnBoundary”: false, “singleAnnotation”: true}’)

I always get the WARN: Unable to set parameter threshold with value valueX
It should be possible somehow?

Thx Mario

If you want to swap out some of the text for a variable, you can use something like the following.

1 Like

thx that is exactly what i was looking for.

1 Like