On Jul 17, 2014, at 11:00 AM, AndersS wrote:
> Hello!
>
> I have a problem when I try to analyze my images in ImageJ.
> I run the line
>
> run("Analyze Particles...", " show=Outlines display clear record");
>
> and save my results
>
> saveAs("Results", imageName+".txt");
>
> But when I extract the give XStart from the results it gives me what X is
> where YStart starts.
> example image:
> <
http://imagej.1557.x6.nabble.com/file/n5008803/wat.jpg>
(XStart,YStart) are the coordinates of the first boundary point of particles found by the particle analyzer, not the coordinates of the left-most point. The following example macro finds the left-most points. If a particle has multiple left-most points, the top one is used.
The particle analyzer's "Record starts" option is obsolete. It has been replaced by the "Overlay Outlines" (used by this macro) and "Add to Manager options.
run("Blobs (25K)");
setAutoThreshold("Default");
run("Analyze Particles...", "size=100 show=[Overlay Outlines] exclude");
n = Overlay.size;
run("Clear Results");
for (i=0; i<n; i++) {
Overlay.activateSelection(i);
getSelectionCoordinates(xpoints, ypoints);
x=9999; y=9999;
for (j=0; j<xpoints.length; j++) {
if (xpoints[j]<=x) {
x = xpoints[j];
y = ypoints[j];
}
}
setResult("X", i, x);
setResult("Y", i, y);
}
updateResults;
> Is there a solution to this problem, or have I just done something wrong?
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Problem-with-getting-XStart-tp5008803.html> Sent from the ImageJ mailing list archive at Nabble.com.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html