How to use Analyze Particles feature in my own application?

I am developing my own image processing java application in NetBeans. So far I’ve been using the old version of ImageJ and to use its API, I simply added the ij.jar file found next to the ImageJ.exe file to my project. Now I have decided that I want to use ImageJ2 API. In my application, I need to run “Analyze Particles” for a binary image, and get the list of the found segments and number of them from the ROI Manager, and draw them as Overlay on another image. All of this should be done only in my code without ImageJ or Fiji being visible. I’ve downloaded Fiji and I know that Fiji is using ImageJ2 API. So my question specifically is:

  1. What jar file should I add to my project in NetBeans so that I can use Analyze Particles functionality?
  2. Which classes/functions should I use for the purpose I described?

Please note, I am not developing a plugin. I am developing my own stand-alone application.

1 Like

The “Analyze Particles” feature has not yet been ported to ImageJ2. So to use it, you will need to continue depending on the net.imagej:ij component (i.e., ImageJ1). It should be possible (I say without having explicitly tested it…) to use that functionality without displaying the ImageJ1 user interface.

In any case, I highly recommend using Maven to manage and build your project. Then you can develop it in NetBeans, and benefit from the dependency management features to easily add dependencies to libraries you need. See also the Architecture page for details on how ImageJ2 and SciJava projects are structured.

See also the resources mentioned by @bnorthan.

1 Like