diff --git a/scikits/image/graph/_mcp.pyx b/scikits/image/graph/_mcp.pyx index d56fee64..c1a6429e 100644 --- a/scikits/image/graph/_mcp.pyx +++ b/scikits/image/graph/_mcp.pyx @@ -184,6 +184,7 @@ def _normalize_indices(indices, shape): return None new_index = [] for i, s in zip(index, shape): + i = int(i) if i < 0: i = s+i if not (0 <= i < s): diff --git a/scikits/image/graph/heap.pyx b/scikits/image/graph/heap.pyx index a0dffd95..272fa15b 100644 --- a/scikits/image/graph/heap.pyx +++ b/scikits/image/graph/heap.pyx @@ -246,7 +246,7 @@ cdef class BinaryHeap: i0 = (1 << level) - 1 #2**level-1 = LevelStart n = i0 + 1 #2**level for i in range(i0,i0+n,2): - ii = (int)(i-1)/2 # CalcPrevAbs + ii = (i-1)//2 # CalcPrevAbs if values[i] < values[i+1]: values[ii] = values[i] else: @@ -266,7 +266,8 @@ cdef class BinaryHeap: # track tree cdef int ii, level for level in range(self.levels,1,-1): - ii = (int)(i-1)/2 # CalcPrevAbs + ii = (i-1)//2 # CalcPrevAbs + # test if values[i] < values[i+1]: values[ii] = values[i]