Commit 19abbab5316692e7e884924525d8ef5300b4bf5a

Authored by Thiago Franco de Moraes
1 parent 92127932

FIX: To compile cython codes in windows

invesalius/data/interpolation.pxd
1 1 from .cy_my_types cimport image_t
2 2  
3   -cdef inline double interpolate(image_t[:, :, :], double, double, double) nogil
4   -cdef inline double tricub_interpolate(image_t[:, :, :], double, double, double) nogil
5   -cdef inline double tricubicInterpolate (image_t[:, :, :], double, double, double) nogil
  3 +cdef double interpolate(image_t[:, :, :], double, double, double) nogil
  4 +cdef double tricub_interpolate(image_t[:, :, :], double, double, double) nogil
  5 +cdef double tricubicInterpolate (image_t[:, :, :], double, double, double) nogil
... ...
invesalius/data/interpolation.pyx
... ... @@ -77,7 +77,7 @@ cdef double[64][64] temp = [
77 77 @cython.boundscheck(False) # turn of bounds-checking for entire function
78 78 @cython.cdivision(True)
79 79 @cython.wraparound(False)
80   -cdef inline double interpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
  80 +cdef double interpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
81 81 cdef double xd, yd, zd
82 82 cdef double c00, c10, c01, c11
83 83 cdef double c0, c1
... ... @@ -123,7 +123,7 @@ cdef inline double interpolate(image_t[:, :, :] V, double x, double y, double z)
123 123 @cython.boundscheck(False) # turn of bounds-checking for entire function
124 124 @cython.cdivision(True)
125 125 @cython.wraparound(False)
126   -cdef inline image_t _G(image_t[:, :, :] V, int x, int y, int z) nogil:
  126 +cdef image_t _G(image_t[:, :, :] V, int x, int y, int z) nogil:
127 127 cdef int dz, dy, dx
128 128 dz = V.shape[0] - 1
129 129 dy = V.shape[1] - 1
... ... @@ -236,7 +236,7 @@ cdef void calc_coef_tricub(image_t[:, :, :] V, double x, double y, double z, dou
236 236 @cython.boundscheck(False) # turn of bounds-checking for entire function
237 237 @cython.cdivision(True)
238 238 @cython.wraparound(False)
239   -cdef inline double tricub_interpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
  239 +cdef double tricub_interpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
240 240 # From: Tricubic interpolation in three dimensions. Lekien and Marsden
241 241 cdef double[64] coef
242 242 cdef double result = 0.0
... ... @@ -261,14 +261,14 @@ cdef inline double tricub_interpolate(image_t[:, :, :] V, double x, double y, do
261 261 @cython.boundscheck(False) # turn of bounds-checking for entire function
262 262 @cython.cdivision(True)
263 263 @cython.wraparound(False)
264   -cdef inline double cubicInterpolate(double p[4], double x) nogil:
  264 +cdef double cubicInterpolate(double p[4], double x) nogil:
265 265 return p[1] + 0.5 * x*(p[2] - p[0] + x*(2.0*p[0] - 5.0*p[1] + 4.0*p[2] - p[3] + x*(3.0*(p[1] - p[2]) + p[3] - p[0])))
266 266  
267 267  
268 268 @cython.boundscheck(False) # turn of bounds-checking for entire function
269 269 @cython.cdivision(True)
270 270 @cython.wraparound(False)
271   -cdef inline double bicubicInterpolate (double p[4][4], double x, double y) nogil:
  271 +cdef double bicubicInterpolate (double p[4][4], double x, double y) nogil:
272 272 cdef double arr[4]
273 273 arr[0] = cubicInterpolate(p[0], y)
274 274 arr[1] = cubicInterpolate(p[1], y)
... ... @@ -280,7 +280,7 @@ cdef inline double bicubicInterpolate (double p[4][4], double x, double y) nogil
280 280 @cython.boundscheck(False) # turn of bounds-checking for entire function
281 281 @cython.cdivision(True)
282 282 @cython.wraparound(False)
283   -cdef inline double tricubicInterpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
  283 +cdef double tricubicInterpolate(image_t[:, :, :] V, double x, double y, double z) nogil:
284 284 # From http://www.paulinternet.nl/?page=bicubic
285 285 cdef double p[4][4][4]
286 286  
... ...
invesalius/data/transforms.pyx
... ... @@ -12,7 +12,7 @@ from cython.parallel import prange
12 12 @cython.boundscheck(False) # turn of bounds-checking for entire function
13 13 @cython.cdivision(True)
14 14 @cython.wraparound(False)
15   -cdef inline void mul_mat4_vec4(double[:, :] M,
  15 +cdef void mul_mat4_vec4(double[:, :] M,
16 16 double* coord,
17 17 double* out) nogil:
18 18  
... ... @@ -77,7 +77,7 @@ def apply_view_matrix_transform(image_t[:, :, :] volume,
77 77 image_t cval,
78 78 image_t[:, :, :] out):
79 79  
80   - cdef unsigned int dz, dy, dx
  80 + cdef int dz, dy, dx
81 81 cdef int z, y, x
82 82 dz = volume.shape[0]
83 83 dy = volume.shape[1]
... ...