Re: Saving multiple result windows into the same excel file
Posted by Fruits on Apr 21, 2016; 11:22am
URL: http://imagej.273.s1.nabble.com/Saving-multiple-result-windows-into-the-same-excel-file-tp5016205p5016208.html
Hi, thanks for the advice! But still, this does not solve my problem, I can create an excel file for each image, but I would like a single file with all data within. The macro is like this right now:
dir = getDirectory("path");
list = getFileList(dir);
for (i=0; i<list.length; i++)
{
if (endsWith(list[i], ".tif"))
{
open(dir + list[i]);
run("Duplicate...", " ");
run("8-bit");
run("Gaussian Blur...", "sigma=2");
setAutoThreshold("Default dark");
getThreshold(lower,upper);
setThreshold(41,255);
run("Convert to Mask");
run("Watershed");
run("Analyze Particles...", "size=30-Infinity display");
name=getTitle;
IJ.renameResults(name);
dotIndex = indexOf(name, ".");
name = substring(name, 0, dotIndex);
saveAs("Results", dir + name + ".csv");
close();
close();
}
}
Any other mistake I am making or any idea to make the results get compiled properly?