Login  Register

Re: Problem with IJ.renameResults

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jun 06, 2014; 4:02am
URL: http://imagej.273.s1.nabble.com/Problem-with-IJ-renameResults-tp5008038p5008058.html

On Jun 5, 2014, at 11:33 AM, Matthew Pearson wrote:

> Hi all,
>
> I've got an issue with the IJ.renameResults(); function in a macro.  I  
> run an analysis on an image then i run rename results to change the  
> results window to append the images name for future reference.  One of  
> the columns in my results table has been added on to the original  
> table using setResult in a loop.  When i rename the table, the column  
> that was added later is missing from the results table.  If i rename  
> the table outside of the macro using File>Rename, the column remains.
>
> I updated ImageJ today to 1.49b.
>
> Has anyone else experienced this?  I wonder if its a coincidence that  
> its knocking off just the column thats appended later..

The IJ.renameResults() macro function works as expected for me (see example below). The updateResults() call is key. Without it, the added column("Area*Mean") is missing in the renamed table.

-wayne

  run("T1 Head (2.4M, 16-bits)");
  for (i=1; i<=nSlices; i++) {
     setSlice(i);
     run("Measure");  
  }
  for (i=0; i<nResults; i++) {
     area = getResult("Area", i);
     mean = getResult("Mean", i);
     setResult("Area*Mean", i, area*mean);
  }
  updateResults();
  IJ.renameResults("Renamed Results");

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html