Detailed method for modifying results table?

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

Detailed method for modifying results table?

Kevin Takaki
Dear ImageJ users,

I am attempting to streamline an ImageJ macro which will be available as a resource to other labs, but before I can do that I need to simplify the output so that it will be easy to understand.  After performing a particle analysis I get a summary table with the following five columns:  Slice, Count, Total Area, Average Size, and Area Fraction.  I am attempting to modify the results table to:

1.  Display only the “Slice” and “Total Area” columns
2.  Rename the “Slice” column to “Sample”.


From what I can gather, summary tables can be modified though the Analyze>Set Measurements dialogue, but only to a limited extent.  For anything beyond that I will have to use the setResult function to export the summary table into the results table with the desired modifications.  I have tried to figure this out from the “Calculate Convexity and Solidarity” and “Bat Cochlea Volume (19K)” macros, as well as the basic ImageJ macro tutorial (http://fiji.sc/wiki/index.php/Introduction_into_Macro_Programming), but without luck.  Can someone suggest how to modify a small script to accomplish 1 and 2,  above?


Below is the example macro for copying contents of the Summary table to the Results table that I am trying to work from:
 
   run("Bat Cochlea Volume (19K)");
   setThreshold(1, 255);
   run("Analyze Particles...", "summarize stack");
   selectWindow("Summary of "+getTitle);

   text = getInfo("window.contents");
   lines = split(text, "\n");
   labels = split(lines[0], "\t");


   run("Clear Results");

      for (i=1; i<lines.length; i++) {
      items=split(lines[i], "\t");
      setResult("Label", i-1, items[0]);
      for (j=1; j<labels.length; j++) {
         setResult(labels[j], i-1, items[j]);

      }
   }
   updateResults();