Login  Register

Re: Saving multiple result windows into the same excel file

Posted by Kenton Arkill on Apr 21, 2016; 3:12pm
URL: http://imagej.273.s1.nabble.com/Saving-multiple-result-windows-into-the-same-excel-file-tp5016205p5016210.html

If you have a folder of many results (say from different days) tables you
can import one results table at a time (in a loop) and add the data via a
getResult("Column",row) loop to a few Arrays and then print the Arrays to
a  new data table. Repeat for all the files to same table.
Nb you can not have two 'results' tables open at the same time. You need to
make a 'text' based table like the link in the last mail.
Kenton
On 21 Apr 2016 13:36, "Brandon Hurr" <[hidden email]> wrote:

> Fruits,
>
> See the example here:
>
> http://imagej.1557.x6.nabble.com/How-to-create-a-customised-results-table-and-add-data-to-it-within-a-macro-td5000701.html
>
> Create a custom results table above your image loop.
> Print results and "name" to custom results table from each image in the
> loop.
> Save out results file after all loops are done.
>
> B
>
>
> On Thu, Apr 21, 2016 at 12:39 Fruits <[hidden email]> wrote:
>
> > 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);
> >         name = getTitle;
> >         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?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://imagej.1557.x6.nabble.com/Saving-multiple-result-windows-into-the-same-excel-file-tp5016205p5016208.html
> > Sent from the ImageJ mailing list archive at Nabble.com.
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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