Posted by
danDino on
Jun 02, 2016; 6:54pm
URL: http://imagej.273.s1.nabble.com/Multi-Plot-Via-Macro-tp5016583.html
I would like to use macro functionality to extract plot profile values from many ROI's for (several hundred) images within any given directory (running in Batch Mode). This works perfectly easily when using the "Multi Measure" command, but I can't find an appropriate solution for "Multi Plot".
Specifically I'm looking for the data not the plot profile images themselves - which is typically generated using the list button within the window "Profiles".
When running the macro I get the error dialog:
Area to Line " Composite selections cannot be converted to lines"
This
post asks the same thing, and a Java solution using the PlotWindow.getResultsTable() method is suggested. Is there a suitable method using IJ1 macros.
Any ideas for a quick fix.
Cheers
Dan
function action(input, output, filename) {
open(input + filename);
run("Duplicate...", " ");
setOption("BlackBackground", false);
run("Make Binary");
run("Fill Holes");
run("Create Selection");
selectWindow(filename);
run("Restore Selection");
// choosing ROI Manager
run("ROI Manager...");
roiManager("Add");
roiManager("Split");
roiManager("Select", 0);
roiManager("Delete");
// basic measurements work here:
//roiManager("multi-measure measure_all append");
//saveAs("Results", output + filename + exten);
//close();
// aim: extract profile Multi Plots for each ROI for each image in the directory
// ERROR generated here.....
roiManager("Multi Plot");
selectWindow("Profiles");
saveAs("Results", output + filename + filename + exten);
// this shows the Multi Plot window is being generated! It is then cropped and saved with the plot profiles on it
// to the directory of choice...
makeRectangle(10, 10, 300, 380);
run("Crop");
saveAs("Jpeg", output + filename);
close();
}
exten = ".xls";
input = "/home/images/";
output = "/home/";
setBatchMode(true);
list = getFileList(input);
for (i = 0; i < list.length; i++)
action(input, output, list[i]);
setBatchMode(false);