Hi Xiaolei,
to create a selection, you need output=[Point Selection], not [Single Points] in run("Find Maxima...", ...)
You can easily see this if you use Plugins>Macros>Record and do it manually.
Michael
________________________________________________________________
On Feb 28, 2014, at 16:52, xiaoleiwang wrote:
> 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
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html