diff --git a/invesalius/data/cy_my_types.pxd b/invesalius/data/cy_my_types.pxd index f834f26..36bd784 100644 --- a/invesalius/data/cy_my_types.pxd +++ b/invesalius/data/cy_my_types.pxd @@ -2,4 +2,11 @@ import numpy as np cimport numpy as np cimport cython -ctypedef np.int16_t image_t +# ctypedef np.uint16_t image_t + +ctypedef fused image_t: + np.float64_t + np.int16_t + np.uint8_t + +ctypedef np.uint8_t mask_t diff --git a/invesalius/data/transforms.pyx b/invesalius/data/transforms.pyx index 28a19d5..9bc8da3 100644 --- a/invesalius/data/transforms.pyx +++ b/invesalius/data/transforms.pyx @@ -12,7 +12,7 @@ from cython.parallel import prange @cython.boundscheck(False) # turn of bounds-checking for entire function @cython.cdivision(True) @cython.wraparound(False) -cdef inline void mul_mat4_vec4(np.float64_t[:, :] M, +cdef inline void mul_mat4_vec4(double[:, :] M, double* coord, double* out) nogil: @@ -25,7 +25,7 @@ cdef inline void mul_mat4_vec4(np.float64_t[:, :] M, @cython.boundscheck(False) # turn of bounds-checking for entire function @cython.cdivision(True) @cython.wraparound(False) -cdef image_t coord_transform(image_t[:, :, :] volume, np.float64_t[:, :] M, int x, int y, int z, double sx, double sy, double sz, short minterpol, image_t cval) nogil: +cdef image_t coord_transform(image_t[:, :, :] volume, double[:, :] M, int x, int y, int z, double sx, double sy, double sz, short minterpol, image_t cval) nogil: cdef double coord[4] coord[0] = z*sz @@ -71,7 +71,7 @@ cdef image_t coord_transform(image_t[:, :, :] volume, np.float64_t[:, :] M, int @cython.wraparound(False) def apply_view_matrix_transform(image_t[:, :, :] volume, spacing, - np.float64_t[:, :] M, + double[:, :] M, unsigned int n, str orientation, int minterpol, image_t cval, -- libgit2 0.21.2