> On Feb 14, 2025, at 3:45 PM, Kenneth R Sloan <[email protected]> wrote: > > I write Java plugins. Most are self contained, and write results to files, > but I have a few PluginFilters which process images and produce a very tiny > amount of text or numerical output. > > I’m looking for the cleanest way to make such output visible at the > macro-language level.
Hi Kenneth,
Save the text or values as image properties that can be retrieved in a macro
using the Property.get() function.
As an example, in the plugin
imp.setProp("Width", imp.getWidth());
imp.setProp("Height", imp.getHeight());
And in the macro
width = parseInt(Property.get("Width"));
height = parseInt(Property.get("Height"));
-wayne
>
> As a concrete example, I just produced a PlugInFilter which assumes a
> particular class of image and “orients” it. It computes a rectangular
> region with WIDTH, LENGTH, and ANGLE. As its last step, it rotates the
> original image so that the rectangular region is aligned with the x- and
> y-axes. It reports length, width, and angle in the log.
>
> The customer wants to use the angle to rotate other images. He may
> eventually want length and width as well. He is content to copy and paste
> from the log, but I’d like to do better.
>
> How can I best communicate these results, so the customer can use them in a
> macro?
>
> (Length, width, angle) look suspiciously like results from other commands,
> and I’d be ok with that, but… More generally, is there a mechanism to make
> visible a name-value pair which can be interrogated in the macro language?
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
smime.p7s
Description: S/MIME cryptographic signature
