From ad96b911abb69965629ab5f4531c5d14278cbd02 Mon Sep 17 00:00:00 2001 From: salvatore Date: Mon, 22 Dec 2014 20:49:44 +0100 Subject: [PATCH] ... added in indented code --- skimage/viewer/canvastools/recttool.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index 93400ceb..da6accf2 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -53,18 +53,18 @@ class RectangleTool(CanvasToolBase, RectangleSelector): >>> ax.imshow(im) >>> def print_the_rect(extents): - global im,ax - coord = np.int64(extents) - [rr1, cc1] = line(coord[2],coord[0],coord[2],coord[1]) - [rr2, cc2] = line(coord[2],coord[1],coord[3],coord[1]) - [rr3, cc3] = line(coord[3],coord[1],coord[3],coord[0]) - [rr4, cc4] = line(coord[3],coord[0],coord[2],coord[0]) - set_color(im, (rr1, cc1), [255, 255, 0]) - set_color(im, (rr2, cc2), [0, 255, 255]) - set_color(im, (rr3, cc3), [255, 0, 255]) - set_color(im, (rr4, cc4), [0, 0, 0]) - ax.imshow(im) - plt.show() + ... global im, ax + ... coord = np.int64(extents) + ... [rr1, cc1] = line(coord[2],coord[0],coord[2],coord[1]) + ... [rr2, cc2] = line(coord[2],coord[1],coord[3],coord[1]) + ... [rr3, cc3] = line(coord[3],coord[1],coord[3],coord[0]) + ... [rr4, cc4] = line(coord[3],coord[0],coord[2],coord[0]) + ... set_color(im, (rr1, cc1), [255, 255, 0]) + ... set_color(im, (rr2, cc2), [0, 255, 255]) + ... set_color(im, (rr3, cc3), [255, 0, 255]) + ... set_color(im, (rr4, cc4), [0, 0, 0]) + ... ax.imshow(im) + ... plt.show() >>> rect_tool = RectangleTool(ax, on_enter=print_the_rect) >>> plt.show()