diff --git a/skimage/viewer/plugins/canny.py b/skimage/viewer/plugins/canny.py index 278a7931..020157a4 100644 --- a/skimage/viewer/plugins/canny.py +++ b/skimage/viewer/plugins/canny.py @@ -21,7 +21,3 @@ class CannyPlugin(OverlayPlugin): def image_filter(self, *args, **kwargs): image = canny(*args, **kwargs) self.overlay = image - - def closeEvent(self, event): - self.overlay = None - super(CannyPlugin, self).closeEvent(event) diff --git a/skimage/viewer/plugins/overlayplugin.py b/skimage/viewer/plugins/overlayplugin.py index a2b12630..b55d6587 100644 --- a/skimage/viewer/plugins/overlayplugin.py +++ b/skimage/viewer/plugins/overlayplugin.py @@ -35,3 +35,7 @@ class OverlayPlugin(Plugin): else: self._overlay_plot.set_array(image) self.image_viewer.redraw() + + def closeEvent(self, event): + self.overlay = None + super(OverlayPlugin, self).closeEvent(event)