Search code examples
javaimagej

ImageJ as library: names of options


I'm trying to use ImageJ as a library in my Java Application. I already found out that I can use the following code to open an image, process it and display it on the screen:

ImagePlus image = new Opener().openImage("image.jpg");
IJ.run(image, "Find Maxima...", "noise=150");
image.show();

This code also sets the noise parameter (in the GUI it's called "Noise Tolerance") to 150. (After some time I was able to find out that the parameter names are the first word of the GUI names. At least it works for the tests I did yet.)

BUT now: How can I specify the "Output type" option of the GUI? In the GUI it's a choice box with elements like "Single Points" or "Maxima Within Tolerance" and so on. But if I try the following:

ImagePlus image = new Opener().openImage("image.jpg");
IJ.run(image, "Find Maxima...", "noise=150 output=Single Points");
image.show();

It says "Single" is no correct parameter. But it also does not work with things like "single", "singlepoints", "single_points", "Single_Points", .... (I tried a lot of these combinations.)

I also tried to specify numbers as the index of the element in the choice box, but that also didn't work.

Can anyone help me and give me a hint where I can find a documentation or something like that of how to specify the options.

Thank you very much!


Solution

  • I've never used ImageJ myself, just a guess, based on the following link: http://imagej.1557.n6.nabble.com/Counting-spots-within-nuclei-td3683546.html

    I'd give a try to this:

    ImagePlus image = new Opener().openImage("image.jpg");
    IJ.run(image, "Find Maxima...", "noise=150 output=[Single Points]");
    image.show();