ParticleAnalyzer class option to show bare outlines

Hello,

I am writing a java program using the ImageJ framework for image analysis.
In this program I would like to run the analyze particle command through the
ParticleAnalyzer.java class on an image but I am having issues setting the
correct options to meet my outputs:

Here are the options I would like:

  • Show: Bare Outlines
  • Include Holes
  • Size: 0-Infinity
  • Circulation: 0-1

Here is my code so far:

ParticleAnalyzer(ParticleAnalyzer.INCLUDE_HOLES+ParticleAnalyzer.SHOW_OUTLINES, 0, null, 0, Double.MAX_VALUE, 0, 1); 
    pa.analyze(img); 
    pa.getOutputImage().show(); 

img is a 8-bit binary image created through the
ImageProcessor.setThreshold().

The issue I have run into is there seems to be no way to get bare outlines
through the options constructor. When I analyzed the
ij.plugin.filter.ParticleAnalyzer source code, it seems that the flag exists
but is not implemented for some reason. What is the best option for me to
proceed?

I have found that the process/binary/fill holes and process/binary/outline
functions produce a similar result but I have had minimal success with
automating this as well.

Generate the needed code by running the particle analyzer with the Recorder (Plugins>Macros>Record) open. Here is a JavaScript example:

 img = IJ.openImage("http://wsr.imagej.net/images/blobs.gif");
 IJ.setAutoThreshold(img, "Default");
 IJ.run(img, "Analyze Particles...", "  show=[Bare Outlines] include in_situ");
 img.show();

The code uses the “In situ” option to avoid having a second window opened. Note that the latest daily build (1.52p37) fixes a bug that caused the recorder to not work with the particle analyzer if the “In situ” option was used.