Bug when saving a stack with a multipoint overlay via macro


I have a plugin that outputs a multipoint overlay on the input stack. What I do then for documenting is duplicating a few slices from the input using “Duplicate”, and it keeps the overlay on the duplicated slices. When I save this duplicated extract manually, the overlay is saved in the tif stack. However, if I do it in a macro, the “Duplicate” command keeps the overlay, but the saveAs(“Tiff”) or the simpler save() functions save the extracted stack without keeping the overlay.

I assume it’s a bug? I’m using IJ 1.51f.



Please provide a small test macro that reproduces the problem. This macro works as expected:

newImage(“Untitled”, “16-bit black”, 1024, 1024, 10);
x = newArray(338, 700, 500);
y = newArray(302, 200, 600);
makeSelection(“point”, x, y);
run(“Add Selection…”);
run(“Duplicate…”, “duplicate range=1-2”);
path = getDirectory(“home”) + “untiled.tif”;
saveAs(“Tiff”, path);