//Adds multi-file
capability, the #@ String is just used so that the #@ File[] creates a Widget
that lets you have drag and drop capability, instead of a file dialog box
#@ String (visibility = MESSAGE, value="Add files to be processed, you can
drag and drop files into the box below.", required=false) msg
#@ File[] files
//Comment out this next command to see the images being processed. You'll have
to comment out the "close" commands at the end too.
//setBatchMode("hide");
lumen=0;
plaque=0;
print("File,Series,Lumen,Plaque");
for (i = 0; i < files.length; i++) {
for(s = 14; s < 40; s = s +
5){
run("Bio-Formats Importer",
"open=["+files[i]+"] autoscale color_mode=Default
rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT series_"
+s);
title=getTitle();
setTool("freehand");
waitForUser("Trace the Lumen");
roiManager("Add");
do {
finished="No";
waitForUser("Trace
Plaque");
roiManager("Add");
//-- Create and show a blocking
dialog box
Dialog.createNonBlocking("Click
OK to continue");
Dialog.addCheckbox("All Plaque
Traced", false);
Dialog.show();
//-- When OK is clicked, read out
the status of the dialog
if
(Dialog.getCheckbox()){finished="Yes";}
} while (finished=="No");
run("Set Measurements...", "area mean standard integrated
limit redirect=title decimal=3");
roiManager("Select",0);
run("Measure");
lumen=lumen + getResult("Area",0);
n = roiManager('count');
for (r = 1; r < n; r++) {
roiManager('select', r);
run("Measure");
plaque = plaque +
getResult("Area",r);
}
print(title + "," + s + "," + lumen +"," +
plaque);
//setResult("Lumen",nResults-1,lumen); // sets the value in
the last line of the results table
//setResult("Plaque",nResults-1,plaque);
//updateResults(); // updates the
results table to show the new value
close("results");
roiManager("Deselect");
roiManager("Delete");
close(title);
}
}
path=getDirectory("Choose where to save the results");
selectWindow("Log");
saveAs("Text", path + "results.csv");
close("Log");
setBatchMode("exit and display");