Re: strings in the Results Table
Posted by Gabriel Landini on Nov 25, 2007; 10:31am
URL: http://imagej.273.s1.nabble.com/no-subject-tp3697939p3697940.html
On Sunday 25 November 2007, Adam Hacking, Dr. wrote:
> I am working on a macro and I am wondering if there is anyway to display a
> string in the result table. I am using setResult() and getting a "NaN"
> value.
I know this one, because I asked the same thing the other day.
Displaying in the Results *Window* is not the same as putting into the Results
*Table*.
If you just want to display it you can use:
write(string);
Outputs a string to the Results *Window*, but this way you cannot retrieve it
back (or maybe you can but it is not documented). To be able to get it back
reading from the Results *Table* you put it there as a "Label":
Call the function setResult("Label", row, string) to set the row label.
and get it back with:
getResultLabel(row)
So strings can go only in 1 column of the table called "Label".
BTW, It would be very useful to be able to have more than one Results Table
(Wayne: hint!, hint! :-) ) so one can have the results of several analyses at
the same time.
Regards,
Gabriel