// This macro demonstrates how to use the // RoiManager.setGroup(), RoiManager.selectGroup() // and RoiManager.selected macro functions. // It creates a stack with many ROIs in the ROI Manager // and then combines all the ROIs in each individual // slice into one. It requires ImageJ 1.53e. // create a stack size = 500; slices = 50; setBatchMode(true); newImage("Untitled", "8-bit black", size, size, slices); roiManager("reset"); // adds ROIs, in groups, to the ROI Manager for (i=0; i0) { roiManager("Combine"); Roi.setPosition(i); roiManager("Add"); roiManager("delete"); } } Roi.remove; run("From ROI Manager"); setBatchMode(false); run("Animation Options...", "speed=3 start");