From f96e458624cb4a6f2136fdbff3223d69357d41d6 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Fri, 22 Jul 2016 00:46:37 +0200 Subject: [PATCH] MC: typed input arg --- skimage/measure/_marching_cubes_lewiner_cy.pyx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/skimage/measure/_marching_cubes_lewiner_cy.pyx b/skimage/measure/_marching_cubes_lewiner_cy.pyx index 0fa0bdb3..502d29a0 100644 --- a/skimage/measure/_marching_cubes_lewiner_cy.pyx +++ b/skimage/measure/_marching_cubes_lewiner_cy.pyx @@ -926,15 +926,12 @@ cdef class LutProvider: self.SUBCONFIG13 = Lut(SUBCONFIG13) -def marching_cubes(im, double isovalue, LutProvider luts, int st=1, int classic=0): +def marching_cubes(float [:, :, :] im not None, double isovalue, LutProvider luts, int st=1, int classic=0): """ marching_cubes(im, double isovalue, LutProvider luts, int st=1, int classic=0) This is the main entry to apply marching cubes. Returns (vertices, faces, normals, values) """ - # Typdedef image - cdef float [:, :, :] im_ = im - # Get dimemsnions cdef int Nx, Ny, Nz Nx, Ny, Nz = im.shape[2], im.shape[1], im.shape[0] @@ -975,8 +972,8 @@ def marching_cubes(im, double isovalue, LutProvider luts, int st=1, int classic= # Initialize cell cell.set_cube(isovalue, x, y, z, st, - im_[z ,y, x], im_[z ,y, x_st], im_[z ,y_st, x_st], im_[z ,y_st, x], - im_[z_st,y, x], im_[z_st,y, x_st], im_[z_st,y_st, x_st], im_[z_st,y_st, x] ) + im[z ,y, x], im[z ,y, x_st], im[z ,y_st, x_st], im[z ,y_st, x], + im[z_st,y, x], im[z_st,y, x_st], im[z_st,y_st, x_st], im[z_st,y_st, x] ) # Do classic! if classic: