I have run into a strange issue which I am not sure if anyone else is facing. I use the MaximumFinder to find maxima using jython script. When I run it using imagej GUI I detect the maxima but using the same parameters via scripting, I get maxima whose coordinates are always 0.
A code snippet to illustrate this:
#@ImagePlus imp from ij import IJ from ij import ImagePlus from ij.plugin.filter import MaximumFinder noiseLevel = 50 ip = imp.getProcessor() excludeOnEdges= True maxima = MaximumFinder().getMaxima(ip, noiseLevel, excludeOnEdges) x_coordinates = maxima.xpoints y_coordinates = maxima.ypoints print "x = ", x_coordinates print "y = ", y_coordinates
I used the Cell_Colony as well as blobs image (both inverted) to test this and the only output I get is:
#Output x = array('i', [0, 0, 0, 0]) y = array('i', [0, 0, 0, 0])
If I use Process > Find Maxima on the same images with same parameters, I get 518 and 53 Maxima in Cell_Colony and blobs images respectively. Related post: Scripting findMaxima in Jython
Any help is appreciated!