From 8524203f138b0644a6f32ecfe8a7ffe708fdbec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 19 Aug 2013 18:42:08 +0200 Subject: [PATCH] Use typed memoryviews in measure package --- skimage/measure/_find_contours.pyx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/skimage/measure/_find_contours.pyx b/skimage/measure/_find_contours.pyx index d05d9aa7..e2f5a49b 100644 --- a/skimage/measure/_find_contours.pyx +++ b/skimage/measure/_find_contours.pyx @@ -4,8 +4,6 @@ #cython: wraparound=False import numpy as np -cimport numpy as cnp - cdef inline double _get_fraction(double from_value, double to_value, double level): @@ -14,7 +12,7 @@ cdef inline double _get_fraction(double from_value, double to_value, return ((level - from_value) / (to_value - from_value)) -def iterate_and_store(cnp.ndarray[double, ndim=2] array, +def iterate_and_store(double[:, :] array, double level, Py_ssize_t vertex_connect_high): """Iterate across the given array in a marching-squares fashion, looking for segments that cross 'level'. If such a segment is @@ -46,7 +44,7 @@ def iterate_and_store(cnp.ndarray[double, ndim=2] array, # Calculate the number of iterations we'll need cdef Py_ssize_t num_square_steps = (array.shape[0] - 1) \ - * (array.shape[1] - 1) + * (array.shape[1] - 1) cdef unsigned char square_case = 0 cdef tuple top, bottom, left, right