Parameter in script

Hey,
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(…) ?

Blockquote
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.

https://gist.github.com/Svidro/5e4c29630e8d2ef36988184987d1028f#file-variable-into-string-commands-groovy

1 Like

thx that is exactly what i was looking for.

1 Like