Switch plugins to use new tool api

This commit is contained in:
blink1073
2014-07-20 19:08:14 -05:00
committed by Steven Silvester
parent 2d9d8bb94c
commit 1775e959d6
5 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -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):
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)