%classpath config resolver scijava.public https://maven.scijava.org/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." 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()