diff --git a/skimage/viewer/plugins/base.py b/skimage/viewer/plugins/base.py index a92140cb..9a8c2cda 100644 --- a/skimage/viewer/plugins/base.py +++ b/skimage/viewer/plugins/base.py @@ -27,16 +27,17 @@ class Plugin(QtGui.QDialog): overlay : array Image used in measurement/manipulation. """ - def __init__(self, callback, parent=None, height=100, width=400): - self._viewer = parent - QtGui.QDialog.__init__(self, parent) + def __init__(self, image_viewer, callback=None, height=100, width=400): + self._viewer = image_viewer + QtGui.QDialog.__init__(self, image_viewer) self.setWindowTitle('Image Plugin') self.layout = QtGui.QGridLayout(self) self.resize(width, height) self.row = 0 - self.callback = callback + if callback is not None: + self.callback = callback - self.arguments = [parent.original_image] + self.arguments = [image_viewer.original_image] self.keyword_arguments= {} self.overlay = self._viewer.overlay diff --git a/skimage/viewer/plugins/canny.py b/skimage/viewer/plugins/canny.py index cf417a10..db702fc9 100644 --- a/skimage/viewer/plugins/canny.py +++ b/skimage/viewer/plugins/canny.py @@ -4,10 +4,10 @@ from skimage.filter import canny class CannyPlugin(Plugin): - def __init__(self, parent, *args, **kwargs): + def __init__(self, image_viewer, *args, **kwargs): height = kwargs.get('height', 100) width = kwargs.get('width', 400) - super(CannyPlugin, self).__init__(self.callback, parent=parent, + super(CannyPlugin, self).__init__(image_viewer, width=width, height=height) self.add_keyword_argument('sigma', 0.005, 0, self.caller) self.add_keyword_argument('low_threshold', 0.255, 0, self.caller) diff --git a/skimage/viewer/utils/core.py b/skimage/viewer/utils/core.py index efad540d..f7dc6433 100644 --- a/skimage/viewer/utils/core.py +++ b/skimage/viewer/utils/core.py @@ -63,6 +63,8 @@ class LinearColormap(LinearSegmentedColormap): class ClearColormap(LinearColormap): + """Color map that varies linearly from alpha = 0 to 1 + """ def __init__(self, name, rgb): r, g, b = rgb cg_speq = {'blue': [(0.0, b), (1.0, b)],