ResultsTable.open() Problem

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

ResultsTable.open() Problem

David Webster
All,

I have been trying to write some plugins that can import
ResultsTable's from files using the ResultsTable.open()
method. I'm finding that if I import a ResultsTable
text file that has only 1 row, then everythingh seems to
work fine. But as soon as I go to multiple rows, I get
a null ResultsTable. Oddly, when I get a null ResultsTable,
the table itself seems to be automatically displayed as if
a show() method had been used. The code fragment I a using is
shown below. I am including examples of single and double
row tables as well. Note, these are my own tables and were
not generated by "Analyze Particles". I realy need to be
able to use the ResultsTable input capability so hope
someone can tell me what I'm doing wrong.

David Webster

try
{ // Creates (?) a system ResultsTable
        ResultsTable rt = ResultsTable.getResultsTable();
        rt.reset();
        // Input from file
        rt = ResultsTable.open(od.getDirectory()+od.getFileName());
        return rt;
}
catch(Exception e)
{
        IJ.error(""+e);
}

Results1.txt
  Image Slice Strength x y r Aspect
Ratio Angle
1 Area Outline-1 1 68 166 122 25 1 0

Results2.txt
  Image Slice Strength x y r Aspect
Ratio Angle
1 Area Outline-1 1 68 166 122 25 1 0
2 Area Outline-1 2 66 163 124 25 1 0