MaximumFinder().getMaxima() always return 0 with Image1.52n

Within Fiji, the following jython macro returns indeed a number of maxima until ImageJ 1.52k but with the last 1.52n it always returns 0, for any images.
I could not find ImageJ 1.52l and m to test them.

#@ ImagePlus imp
from ij.plugin.filter import MaximumFinder

Tolerance = 0.1
excludeOnEdge=False

print imp.getProcessor()
Polygon = MaximumFinder().getMaxima(imp.getProcessor(), Tolerance, excludeOnEdge)
print Polygon.npoints

Can someone confirm that they have a similar behaviour ?

4 Likes

Please provide a test image.

I will be back in the office on Tuesday. But I observed it with some sample images too (Lena and blobs for instance)

1 Like

This 1.52n regression is fixed in the latest ImageJ daily build (1.52o10). Here is JavaScript code that reproduces the problem:

  imp = IJ.openImage("http://wsr.imagej.net/images/Dot_Blot.jpg");
  ip = imp.getProcessor();
  ip.invert();
  prominence = 35;
  excludeOnEdge=false;
  polygon = new MaximumFinder().getMaxima(ip, prominence, excludeOnEdge);
  print("npoints="+polygon.npoints);
5 Likes

Great, thank you Wayne for the quick fix!

1 Like

A post was split to a new topic: When will ImageJ 1.52p become part of Fiji?