Dear all,
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. Thanks Adam ________________________________________________________________ Dr. S Adam Hacking, Post Doctoral Fellow JTN Wong Laboratories for Mineralized Tissue Research, Center for Bone and Periodontal Research, McGill University 740 Dr. Penfield Ave. Rm. 2300A Montreal, QC, Canada H3A 1A4 Ph.: 514-398-5112 Fax: 514-398-4020 |
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 |
Gabriel,
Greg JossĀ¹ Results and Text ( http://rsb.info.nih.gov/ij/plugins/results.html ) shows how to create multiple results tables by creating ResultsTable methods in your plugin. Let me know off-list if you need more details. Chris Coulon > > 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 The GAIA Group Global Automated Image Analysis http://gaiag.net [hidden email] We welcome image analysis problems in all fields. Christopher Coulon, Ph.D., Founder |
On Sunday 25 November 2007, Christopher Coulon wrote:
> Greg JossĀ¹ Results and Text ( > http://rsb.info.nih.gov/ij/plugins/results.html ) shows how to create > multiple results tables by creating ResultsTable methods in your plugin. > Let me know off-list if you need more details. Thanks Chris, my comments were about accessing the data in several tables from macros. This would need something like the getResult() function that points to a particular table (or to the Results Table by default if no other table is explicit). So far I what I have done is to create arrays of the parameters of interest in a macro and load those from the RT so I can re-use the RT for something else without losing the previous results. Just imagine running several times the Particles8_Plus plugin several times and keeping all those tables accessible. I guess that this may not be easy to add to IJ and would require changing lots of other plugins as well... Regards, Gabriel |
Free forum by Nabble | Edit this page |