mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 21:08:24 +08:00
Switch plugins to use new tool api
This commit is contained in:
committed by
Steven Silvester
parent
2d9d8bb94c
commit
1775e959d6
@@ -21,7 +21,8 @@ class ColorHistogram(PlotPlugin):
|
||||
def attach(self, image_viewer):
|
||||
super(ColorHistogram, self).attach(image_viewer)
|
||||
|
||||
self.rect_tool = RectangleTool(self.ax, on_release=self.ab_selected)
|
||||
self.rect_tool = RectangleTool(image_viewer,
|
||||
on_release=self.ab_selected)
|
||||
self._on_new_image(image_viewer.image)
|
||||
|
||||
def _on_new_image(self, image):
|
||||
|
||||
@@ -18,7 +18,7 @@ class Crop(Plugin):
|
||||
def attach(self, image_viewer):
|
||||
super(Crop, self).attach(image_viewer)
|
||||
|
||||
self.rect_tool = RectangleTool(self.image_viewer.ax,
|
||||
self.rect_tool = RectangleTool(image_viewer,
|
||||
maxdist=self.maxdist,
|
||||
on_enter=self.crop)
|
||||
self.artists.append(self.rect_tool)
|
||||
|
||||
@@ -37,7 +37,7 @@ class LabelPainter(Plugin):
|
||||
super(LabelPainter, self).attach(image_viewer)
|
||||
|
||||
image = image_viewer.original_image
|
||||
self.paint_tool = PaintTool(self.image_viewer.ax, image.shape,
|
||||
self.paint_tool = PaintTool(image_viewer, image.shape,
|
||||
on_enter=self.on_enter)
|
||||
self.paint_tool.radius = self.radius
|
||||
self.paint_tool.label = self._label_widget.index = 1
|
||||
|
||||
@@ -59,7 +59,7 @@ class LineProfile(PlotPlugin):
|
||||
x = [w / 3, 2 * w / 3]
|
||||
y = [h / 2] * 2
|
||||
|
||||
self.line_tool = ThickLineTool(self.image_viewer.ax,
|
||||
self.line_tool = ThickLineTool(self.image_viewer,
|
||||
maxdist=self.maxdist,
|
||||
on_move=self.line_changed,
|
||||
on_change=self.line_changed)
|
||||
|
||||
@@ -32,7 +32,7 @@ class Measure(Plugin):
|
||||
|
||||
image = image_viewer.original_image
|
||||
h, w = image.shape
|
||||
self.line_tool = LineTool(self.image_viewer.ax,
|
||||
self.line_tool = LineTool(self.image_viewer,
|
||||
maxdist=self.maxdist,
|
||||
on_move=self.line_changed)
|
||||
self.artists.append(self.line_tool)
|
||||
|
||||
Reference in New Issue
Block a user