On May 11, 2010, at 5:02 PM, NatashaW wrote:
> Dear all,
>
> I need your help please, I spent a long time trying to solve this small
> problem!!
> I want to add my comments to the result window and save it as .xls
> I have some cells in my image and I want to count a small fluorescent
> objects inside every cell.
> I want to add a comment for every group of results, for example:
> Image1:
> Nuclei1:
> ( my analyze particles results)
> Nuclei2:
> ( my analyze particles results)
> Image2:
> .............
> I couldn't do that by using setResult("Label", nResults, "+Nuclei1") because
> it sets only the name of my row to "Nuclei1" and remove the real result
> without adding a new row or when I try to add "Image1" at first by using the
> same instruction it gives me a wrong number of results!!
> Is there any other instruction? or something I missed it?
You can't easily add rows to the Results table but you can add a comment to any row by using the
setResult("Label", rowIndex, "comment")
macro function. Here is an example that creates a Results table and adds comments to the 1st, 6th and last rows.
run("Blobs (25K)");
setAutoThreshold("Default");
run("Analyze Particles...", "display clear");
setResult("Label", 0, "Row 1 comment ");
setResult("Label", 5, "Row 6 commant");
setResult("Label", nResults-1, "Last row commant");
updateResults;
Note that the second argument of setResult() is the row index, which is one less than the row number. Also note that you have to call updateResults to display the updated table.
-wayne