Login  Register

Re: saving complete content of "results window"

Posted by Rasband, Wayne (NIH/NIMH) [E] on May 02, 2010; 3:13am
URL: http://imagej.273.s1.nabble.com/saving-complete-content-of-results-window-tp3688433p3688436.html

On Apr 30, 2010, at 2:32 PM, dwshaw61 wrote:

> On a related note.  I'm trying to read the results of "Summarize" which
> appear at the bottom of the Results Window using getResult("Column", row),
> but get an error message "Row (257) out of range" when trying to read the
> rows corresponding to the output from "Summarize".  Is there a way to do
> this?

You can read the rows created by the "Summarize" command using the getInfo() and split() macro functions. Here is an example:

  selectWindow("Results");
  table = getInfo();
  rows = split(table, "\n");
  for (row=0; row<rows.length; row++) {
     values = split(rows[row]);
     for (col=0; col<values.length; col++)
         print("row="+row+", col="+col+", value="+values[col]);
  }

-wayne