Parameterized scripting!
%classpath config resolver imagej.public https://maven.imagej.net/content/groups/public
%classpath add mvn net.imagej imagej 2.0.0-rc-71
ij = new net.imagej.ImageJ()
"ImageJ v${ij.getVersion()} is ready to go."
Added new repo: imagej.public
ImageJ v2.0.0-rc-71 is ready to go.
script = """
#@String name
#@output String greeting
greeting = "Hello, " + name + "!"
"""
task = ij.script().run("hello.groovy", script, true, ["name": "Johnny"])
// it runs asynchronously! let's wait for it to complete.
module = task.get()
// let's see what it computed
module.getOutputs()