Login  Register

Re: Results Table I/O

Posted by Wayne Rasband on Dec 04, 2009; 5:55pm
URL: http://imagej.273.s1.nabble.com/Re-Results-Table-I-O-tp3690223.html

 > I would like to be able to write programs that would input
 > results tables and output new results tables. I can do this
 > now as long as the table I input is an open system results
 > table. But, the new table doesn't seem to be "inputable" by
 > a subsequent Plugin  unless I first export it then import it
 > back into ImageJ. This is clumsy. Is there anyway to
 > directly input an open results table into a plugin if it is
 > not the system table?

You can do this with the Image 1.43m daily build, which adds open() and
saveAs() methods to the ResultsTable class. Here is a JavaScript
example that demonstrates how to use these new methods:

    if (IJ.getVersion()<"1.43m")
       IJ.error("Requires v1.43m or later");
    if (Analyzer.getCounter()==0)
       IJ.error("Results table is empty");
    rt = Analyzer.getResultsTable();
    rt.saveAs("");
    rt = ResultsTable.open("");
    rt.show("My Results Table");

-wayne