This function should be called from PlugInFilters that modify the overlay prior to the operation. For the type 'FILTER', undo of overlays requires that the modified image also has an overlay.
(ImagePlus imp)
| 97 | /** This function should be called from PlugInFilters that modify the overlay prior to the operation. |
| 98 | * For the type 'FILTER', undo of overlays requires that the modified image also has an overlay. */ |
| 99 | public static void saveOverlay(ImagePlus imp) { |
| 100 | Overlay overlay = imp!=null?imp.getOverlay():null; |
| 101 | if (overlay!=null) { |
| 102 | overlayCopy = overlay.duplicate(); |
| 103 | overlayImageID = imp.getID(); |
| 104 | } else |
| 105 | overlayCopy = null; |
| 106 | } |
| 107 | |
| 108 | public static void reset() { |
| 109 | //if (IJ.debugMode) IJ.log("Undo.reset: "+ whatToUndo+" "+impCopy); |