Saving image with overlay outline
Posted by mikael.f on Jul 20, 2015; 5:11pm
URL: http://imagej.273.s1.nabble.com/Saving-image-with-overlay-outline-tp5013646.html
Hello,
I have a program which detects objects in pictures taken with a confocal microscope. After using the command "Analyze particles", I wish to save the image with the "Overlay outline". I am aware that by opening the processed picture with FIJI, the outline is found. But, is it possible to save this outline so that it can appear when the picture is not opened with FIFI?
Here is my macro:
*Get the images needed (command removed)
list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
open(dir1+list[i]);
run("8-bit Color", "number=256");
run("Set Scale...", "distance=0");
run("Set Measurements...", "area mean feret's redirect=None decimal=3");
run("Auto Threshold", "method=Otsu white");
setOption("BlackBackground", false);
run("Make Binary");
run("Median...", "radius=1");
run("Analyze Particles...", "size=2000-Infinity show=[Overlay Outlines] display exclude include add");
x1 = getResult("FeretX",i);
y1 = getResult("FeretY",i);
length = getResult("Feret",i);
degrees = getResult("FeretAngle",i);
if (degrees>90)
degrees -= 180;
angle = degrees*PI/180;
x2 = x1 + (cos(angle)*length);
y2 = y1 - (sin(angle)*length);
setColor("green");
setLineWidth(3);
drawLine(x1,y1,x2,y2);
path_1 = dir1+list[i]+"_processed";
saveAs("TIFF", path_1);
}