mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-01 12:50:48 +08:00
API Change: Attach ImageViewer to Plugin after init.
Plugin is now added to the viewer using an inplace add on the viewer instead of on initialization of the plugin. This change means that operations requiring the viewer must be delayed until attach operation.
This commit is contained in:
@@ -16,12 +16,15 @@ class OverlayPlugin(Plugin):
|
||||
'green': (0, 1, 0),
|
||||
'cyan': (0, 1, 1)}
|
||||
|
||||
def __init__(self, image_viewer, **kwargs):
|
||||
Plugin.__init__(self, image_viewer, **kwargs)
|
||||
def __init__(self, **kwargs):
|
||||
super(OverlayPlugin, self).__init__(**kwargs)
|
||||
self._overlay_plot = None
|
||||
self._overlay = None
|
||||
self.cmap = None
|
||||
self.color_names = self.colors.keys()
|
||||
|
||||
def attach(self, image_viewer):
|
||||
super(OverlayPlugin, self).attach(image_viewer)
|
||||
#TODO: `color` doesn't update GUI widget when set manually.
|
||||
self.color = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user