Re: cannot save summary file in macro

Posted by Krs5 on
URL: http://imagej.273.s1.nabble.com/cannot-save-summary-file-in-macro-tp5019752p5019754.html

Dear Abhi,

To save a summary file you have to select it before you can save it.

selectWindow("Summary");
saveAs("Summary", homedir + File.separator +  "summary.csv");

(if you want to close the selected table after saving it you need run("Close");)

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility


-----Original Message-----
From: atyagiaa [mailto:[hidden email]]
Sent: 11 December 2017 18:08
To: [hidden email]
Subject: cannot save summary file in macro

Hi,

Please help in making following code work to save summary that involve cell count, the macro code as follows:

I have many images of cells, i want to count cell number for cells in different images, the problem here is 1. I can see the summary display for individual file name, but that can not save in one slice of summary file, please suggest what to do. I want to compile all to one file so that i can save them as excel file.
<http://imagej.1557.x6.nabble.com/file/t381858/first-window.png>
2. I can save results easily as summary. the following file can be saved easily.
<http://imagej.1557.x6.nabble.com/file/t381858/second-window.jpg>

The code is as follows:

run("Subtract Background...", "rolling=12 light"); setAutoThreshold("Default"); //run("Threshold..."); setOption("BlackBackground", false); run("Convert to Mask"); run("Close"); run("Fill Holes"); run("Watershed"); run("Convert to Mask"); run("Analyze Particles...", "size=200-Infinity show=Outlines display clear include summarize add"); run("Close"); selectWindow("Results"); saveAs("Results", homedir + File.separator +  "summary.csv"); close();

Please suggest the solution for this problem Thanks in advance

Abhi



--
Sent from: http://imagej.1557.x6.nabble.com/

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

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