setting results table column headings
Posted by
Tony Collins-4 on
Dec 23, 2008; 1:55pm
URL: http://imagej.273.s1.nabble.com/setting-results-table-column-headings-tp3693953.html
Hi,
This is a problem I've had crop up a few times. I've a few plugins that output several columns to the Results window. I've been using: IJ.setColumnHeadings(headerString) to set the column headers.
However, this results in the results table being 'reset' and cleared each time the pluing is run and I lose the data from the previous analysis. To avoid this, I have used a 'static boolean headingsSet' variable and put the setColumnHeadings in an if-statement.
if(!headingsSet)
{
IJ.setColumnHeadings(headerString);
headingsSet= true;
}
This works so long as the Results window is closed. When it is closed and the plugin run again, the column headers are not reset to what I want because the headingSet Boolean is true.
A better way for me would be to compare the existing headers in the results table with the ones I want to use. I've tried:
String currHeaders = Analyzer.getResultsTable().getColumnHeadings());
..but it returns a blank string.
Any help appreciated.
Thanks,
Tony
Tony J. Collins, Ph.D.
McMaster Biophotonics Facility
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
McMaster University, Hamilton, ON, L8N 3Z5
[hidden email] www.macbiophotonics.ca