http://imagej.273.s1.nabble.com/setting-results-table-column-headings-tp3693953p3693956.html
returns the correct heading string if I've used the menu 'measure' command, e.g.
But returns a blank string if I've set the headings in the results window using my plugin with:
...even though the results window is open and has column headers set correctly.
Tony J. Collins, Ph.D.
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
> Justin McGrath
> Sent: Wednesday, January 21, 2009 11:33 AM
> To:
[hidden email]
> Subject: Re: Setting results table column headings - repost
>
> No one has replied, so I'll take a shot at it.
>
> I believe that your currHeaders solution should actually work. Once
> the
> Results window is closed, the data and headers are lost. The string is
> blank because there are no headers. Therefore, if you check that
> currHeaders == desiredHeaders, it will be false, and you need to set
> the
> headers.
>
> Justin
>
>
>
>
>
> On Tue, Jan 20, 2009 at 7:43 AM, Tony Collins
> <
[hidden email]>wrote:
>
> > Hi Folks,
> >
> > I'm just reposting this in case it was missed over the vacation - or
> I
> > wasn't very clear about the problem.
> >
> > Any suggestions or clarifications? Or is there no solution!
> >
> > Thanks,
> >
> > Tony
> >
> >
> >
> > > 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
> >