From a68be842ab346aa55d1610aa2c568813c25acb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 15 Feb 2013 15:10:08 +0100 Subject: [PATCH] Fix index type errors in draw module --- skimage/draw/_draw.pyx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index 5bba8c32..4b7fb094 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -97,10 +97,10 @@ def polygon(y, x, shape=None): """ cdef Py_ssize_t nr_verts = x.shape[0] - cdef Py_ssize_t minr = max(0, y.min()) - cdef Py_ssize_t maxr = math.ceil(y.max()) - cdef Py_ssize_t minc = max(0, x.min()) - cdef Py_ssize_t maxc = math.ceil(x.max()) + cdef Py_ssize_t minr = int(max(0, y.min())) + cdef Py_ssize_t maxr = int(math.ceil(y.max())) + cdef Py_ssize_t minc = int(max(0, x.min())) + cdef Py_ssize_t maxc = int(math.ceil(x.max())) # make sure output coordinates do not exceed image size if shape is not None: @@ -148,10 +148,10 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None): """ - cdef Py_ssize_t minr = max(0, cy - yradius) - cdef Py_ssize_t maxr = math.ceil(cy + yradius) - cdef Py_ssize_t minc = max(0, cx - xradius) - cdef Py_ssize_t maxc = math.ceil(cx + xradius) + cdef Py_ssize_t minr = int(max(0, cy - yradius)) + cdef Py_ssize_t maxr = int(math.ceil(cy + yradius)) + cdef Py_ssize_t minc = int(max(0, cx - xradius)) + cdef Py_ssize_t maxc = int(math.ceil(cx + xradius)) # make sure output coordinates do not exceed image size if shape is not None: