Macro Question: Measurements from Multiple Images into Consecutive Columns in Results Table rather than a Single Column?
Posted by
Patrick Krysan on
Apr 20, 2015; 4:58pm
URL: http://imagej.273.s1.nabble.com/Macro-Question-Measurements-from-Multiple-Images-into-Consecutive-Columns-in-Results-Table-rather-th-tp5012537.html
How can I direct the Output of my Macro that performs Batch Measurement of Multiple Images into consecutive columns in the Results Table rather than one single column?
I put together the macro shown below that uses Batch Mode to measure the mean gray values for multiple regions of interest on a set of images. The ROIs are saved to each image as an overlay prior to running the Macro. The problem is that all the measurements end up sequentially in a single column in the Results Table. I would like the measurements for each image to appear in separate columns. For example, if I have ten images with five ROIs on each image, I would like the output to be ten columns, with 5 rows of data for each column.
I am a beginner to Macro Programming, so any help would be greatly appreciated. It is not critical that the output goes to the Results
Thank you for any help you are able to provide.
//This Macro measures mean gray value as desired, but the outp I would like the data for each image to be in its own new column. The input for this Macro is a set of images with multiple ROIs saved to the Overlay for each image.
macro "Batch Measure" {
dir = getDirectory("Choose a Directory ");
list = getFileList(dir);
setBatchMode(true);
for (i=0; i<list.length; i++) {
path = dir+list[i];
open(path);
run("Set Measurements...", "mean display redirect=None decimal=2");
run("To ROI Manager");
roiManager("Measure");
close();
}
}
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html