Login  Register

Saving multiple result windows into the same excel file

Posted by Fruits on Apr 21, 2016; 8:06am
URL: http://imagej.273.s1.nabble.com/Saving-multiple-result-windows-into-the-same-excel-file-tp5016205.html

Hi everyone,

I've been using a simple macro I wrote in order to analyze particles from .tif files. The problem is that I would like to have the results be exported automatically to the same excel file, with each different result windows being indicated there (so as to tell which results are from which image).

This is the macro I have for now, any help would me much appreciated

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 show=Nothing display clear include");
        close();
        name=getTitle;
        IJ.renameResults(name);
        close();
        }
}




Cheers