Overlay function vs. coordinates x y of the perimenters points

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Overlay function vs. coordinates x y of the perimenters points

Marcel Krzan
Dear Friends,

Few yoears ago you helped me with the extraction of the Perimeter
coordiantion points using the Record Stars and doWand tools

but now I want to leanr and try the Overlay function

in my phtos always I had 3 - maximum 5 particles.
Each particles perimentr has maximum 200 points lenght

As I said I want to use the function:

run("Analyze Particles...", "size=1000-5000 circularity=0.15-1.00
show=[Overlay Outlines] display exclude");
  n = Overlay.size;
...
Overlay.activateSelection(i);
getSelectionCoordinates(xpoints, ypoints);

after this in the result table I want to get in following columns
coordinates (x & y) of all points from the perimenter. It will be ca. 200
columns, but I really need it for further evaluation.

Have you some idea, how to cnstruct the loop and SetResults function in
the macro?

Regards
Marcel Krzan

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Overlay function vs. coordinates x y of the perimenters points

Michael Schmid
Hi Marcel,

with a few selections, but many border points, a more typical file
layout would be having several x and y columns, one for each selection.

In any case, the trick of having an arbitrary number of Results Table
columns under program control is creating the column names by
concatenation of some prefix and the loop index.

If you have one x and one y column for each particle, use, e.g.
   xLabel = "x"+i;  //i is the index of the ROI or overlayer
   yLabel = "x"+i;
   for (p=0; p<xpoints.length; p++) {
     setResult(xLabel, p, xpoints[p]);
     setResult(yLabel, p, ypoints[p]);
   }

If you want to have columns for each x and y coordinate, but only one
row per ROI, you need something like
   for (p=0; p<xpoints.length; p++) {
     setResult("x"+p, i, xpoints[p]);
     setResult("y"+p, i, ypoints[p]);
   }

This approach will give you a value of zero for the x, y values that
have not been set. You might want to get the maximum number of
coordinate pairs of all ROIs and set all unused Results Table entries
(from xpoints.length to the maximum) to NaN (not a number) or a blank
String.

If you wan the columns not named "x1", "x2", but "x001", "x002" etc, you
can use the IJ.pad(n, length) macro function, e.g. "x"+IJ.pad(p, 3).

Michael
________________________________________________________________
On 2016-09-18 21:55, Marcel Krzan wrote:

> Dear Friends,
>
> Few yoears ago you helped me with the extraction of the Perimeter
> coordiantion points using the Record Stars and doWand tools
>
> but now I want to leanr and try the Overlay function
>
> in my phtos always I had 3 - maximum 5 particles.
> Each particles perimentr has maximum 200 points lenght
>
> As I said I want to use the function:
>
> run("Analyze Particles...", "size=1000-5000 circularity=0.15-1.00
> show=[Overlay Outlines] display exclude");
>   n = Overlay.size;
> ...
> Overlay.activateSelection(i);
> getSelectionCoordinates(xpoints, ypoints);
>
> after this in the result table I want to get in following columns
> coordinates (x & y) of all points from the perimenter. It will be ca. 200
> columns, but I really need it for further evaluation.
>
> Have you some idea, how to cnstruct the loop and SetResults function in
> the macro?
>
> Regards
> Marcel Krzan
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html