Here is an example to show this problem on macro “Java”,
imp = IJ.openImage("C:/Users/user/Desktop/biofilm_stack_02.tif"); Prefs.blackBackground = true; IJ.run(imp, "Convert to Mask", ""); IJ.run(imp, "Analyze Particles...", "display clear add");
The count would be 1093 now with inverting the LUT of the segmented image,
IJ.run(imp, "Invert LUT", ""); IJ.run(imp, "Analyze Particles...", "display clear add");
the count is 18.
The problem would be solvable by checking if the image is inverted or not. If inverted then I would invert it back and run the ParticleAnalyzer.
if(!segmentedImage.isInvertedLut()) IJ.run(segmentedImage, "Invert LUT","");
but the problem that I found is that the Jar file needs the inverse of what the IDE needs, also the IDE on one computer is the inverse than the IDE on another computer. I really can’t know the image Processing reason behind this. Here is the image that I used for testing,
If there is any source that I can read about that could be a start for knowing more would be appreciated.