Re: Modify (or create) results table
Posted by Cyril Turiès on Feb 06, 2015; 4:25pm
URL: http://imagej.273.s1.nabble.com/Modify-or-create-results-table-tp5011481p5011487.html
Hi Mark,
I will try to answer but the picture of your result table is not displayed on the website.
Do you only use the summary of results per image or do you need to have the complete detail of clusters?
I don't think you can edit the "Label" heading of the column but you can modify the text content:
if (nResults != 0){
for (i=0; i<nResults; i++){
resLabel = getResultLabel(i);
if (indexOf(resLabel, ".tif") > 0) {
resLabel = substring (resLabel, 0, lastIndexOf(resLabel,".tif")); // remove the ".tif" in the text string
n = lengthOf(resLabel); // number of characters in the text string
LBL = substring (resLabel, 0, n-2); // remove the last 2 characters to get the label
section = substring (resLabel, n-1, n); // remove all text in label except last character
setResult("Label", i, LBL); // set the text string for new label
setResult("Section", i, section); // set the text string for section
}
} else {
showMessage("No Result found in result table");
}
This code block will search for ".tif" in each line of result label and truncate it. Then keep the last digit as the section and update each line with label and section.
You can use:
setResult("Label", i, "Fish"+LBL);
to display the fish information.
I hope this is what you needed.
Cyril