From 53ac34a8d000bec2fc24c9c7b5c5dd8ab31a094b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Scho=CC=88nberger?= Date: Mon, 23 Apr 2012 17:07:27 +0200 Subject: [PATCH] renamed function bresenham to line --- skimage/draw/_draw.pyx | 2 +- skimage/draw/draw.py | 2 +- skimage/draw/tests/test_draw.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index 38e8f941..ac4b078c 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -12,7 +12,7 @@ cdef extern from "../morphology/_pnpoly.h": @cython.boundscheck(False) @cython.wraparound(False) -def bresenham(int y, int x, int y2, int x2): +def line(int y, int x, int y2, int x2): """Generate line pixel coordinates. Parameters diff --git a/skimage/draw/draw.py b/skimage/draw/draw.py index a18cdeb6..b7bb5b88 100644 --- a/skimage/draw/draw.py +++ b/skimage/draw/draw.py @@ -3,4 +3,4 @@ Methods to draw on arrays. """ -from ._draw import bresenham, polygon, ellipse, circle +from ._draw import line, polygon, ellipse, circle diff --git a/skimage/draw/tests/test_draw.py b/skimage/draw/tests/test_draw.py index ed309cf6..42bbafc9 100644 --- a/skimage/draw/tests/test_draw.py +++ b/skimage/draw/tests/test_draw.py @@ -1,13 +1,13 @@ from numpy.testing import assert_array_equal import numpy as np -from skimage.draw import bresenham, polygon, circle, ellipse +from skimage.draw import line, polygon, circle, ellipse -def test_bresenham_horizontal(): +def test_line_horizontal(): img = np.zeros((10, 10)) - rr, cc = bresenham(0, 0, 0, 9) + rr, cc = line(0, 0, 0, 9) img[rr, cc] = 1 img_ = np.zeros((10, 10)) @@ -15,10 +15,10 @@ def test_bresenham_horizontal(): assert_array_equal(img, img_) -def test_bresenham_vertical(): +def test_line_vertical(): img = np.zeros((10, 10)) - rr, cc = bresenham(0, 0, 9, 0) + rr, cc = line(0, 0, 9, 0) img[rr, cc] = 1 img_ = np.zeros((10, 10)) @@ -26,10 +26,10 @@ def test_bresenham_vertical(): assert_array_equal(img, img_) -def test_bresenham_reverse(): +def test_line_reverse(): img = np.zeros((10, 10)) - rr, cc = bresenham(0, 9, 0, 0) + rr, cc = line(0, 9, 0, 0) img[rr, cc] = 1 img_ = np.zeros((10, 10)) @@ -37,10 +37,10 @@ def test_bresenham_reverse(): assert_array_equal(img, img_) -def test_bresenham_diag(): +def test_line_diag(): img = np.zeros((5, 5)) - rr, cc = bresenham(0, 0, 4, 4) + rr, cc = line(0, 0, 4, 4) img[rr, cc] = 1 img_ = np.eye(5)