mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-15 11:25:53 +08:00
API change: switch order of image viewer and callback arguments.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)],
|
||||
|
||||
Reference in New Issue
Block a user