Use macro to get maximum value and coordinate position
Posted by xiaoleiwang on Feb 28, 2014; 3:52pm
URL: http://imagej.273.s1.nabble.com/Use-macro-to-get-maximum-value-and-coordinate-position-tp5006717.html
Hi all,
Now I try use macro to get maximum values and corresponding coordinate positions of many objects in one image. But now I have one problem. The code is posted below.
nMaxima = 50;
run("Point Tool...", "mark=0 label selection=blue");
run("Clear Results");
run("Find Maxima...","noise=50 output=[Single Points]");
getSelectionCoordinates(xx, yy);
xx = Array.trim(xx, nMaxima);
yy = Array.trim(yy, nMaxima);
makeSelection("point",xx, yy);
run("Set Measurements...", " mean");
run("Measure");
I used the "Blobs" samples in ImageJ to test the code. When I run it, there is warning: Selection required in line 5, getSelectionCoordinates(xx, yy<)>;. I don't understand what that mean? Would someone please to help me about this?
Thanks,
Xiaolei