[ImageJ-devel] Scripts calling scripts with @Parameters
Jan Eglinger
jan.eglinger at gmail.com
Wed Aug 26 09:46:57 CDT 2015
Hi all,
how can I call a script using @Parameters (e.g. @ij.ImagePlus) from
another script? Is this possible already?
I tried the following Javascript:
// @ij.ImagePlus imp
// @String name
// @OUTPUT String result
result = "Hello, " + name + ", the title is " + imp.getTitle();
and saved it into ./plugins/Print_Title.js
When I run it, the macro recorder records something like:
IJ.run(imp, "Print Title", "imp=[img[blobs.gif (256x254x1x1x1)]]
name=Jan");
When I now run this (Beanshell) script (with blobs.gif still open):
import ij.IJ;
imp = IJ.getImage();
IJ.run(imp, "Print Title", "imp=[img[blobs.gif (256x254x1x1x1)]]
name=Jan");
the String is initialized correctly, but `imp` seems to be `null`.
(Leaving away the imp=.. yields an error "'imp' is required but unset.")
Is there a way to configure an ImagePlus (or Dataset or File) in this case?
Thx,
Jan
More information about the ImageJ-devel
mailing list