FW: Update Summary Table

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

FW: Update Summary Table

speters14
Hello ImageJ Users,

I've written a macro where I am able to perform some calculations and edit
my results table, among other things.  I would like to load values into my
summary table as well.   I have successfully used the setResults() function
to edit my results table, but this function does not work on the summary
table.  Is there a similar alternative?  I've tried both setResults and
setSummary but neither seem to work.

Thanks!
Sue Peters
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Update Summary Table

Rasband, Wayne (NIH/NIMH) [E]
On Feb 25, 2011, at 12:41 PM, Sue Peters wrote:

> Hello ImageJ Users,
>
> I've written a macro where I am able to perform some calculations and edit
> my results table, among other things.  I would like to load values into my
> summary table as well.   I have successfully used the setResults() function
> to edit my results table, but this function does not work on the summary
> table.  Is there a similar alternative?  I've tried both setResults and
> setSummary but neither seem to work.

What you can do is copy the contents of the Summary table to the Results table. Here is an example:

   run("Bat Cochlea Volume (19K)");
   setThreshold(1, 255);
   run("Analyze Particles...", "summarize stack");
   selectWindow("Summary of "+getTitle);
   text = getInfo("window.contents");
   lines = split(text, "\n");
   labels = split(lines[0], "\t");
   run("Clear Results");
   for (i=1; i<lines.length; i++) {
      items=split(lines[i], "\t");
      setResult("Label", i-1, items[0]);
      for (j=1; j<labels.length; j++) {
         setResult(labels[j], i-1, items[j]);
      }
   }
   updateResults();

//-wayne