Skip to content

Instantly share code, notes, and snippets.

@jni
Created May 17, 2013 14:23
Show Gist options
  • Save jni/5599357 to your computer and use it in GitHub Desktop.
Save jni/5599357 to your computer and use it in GitHub Desktop.
~/projects/skimage (3d-slic)$ python setup.py install
non-existing path in 'skimage/_shared': 'tests'
cython -o /Volumes/Projects/skimage/skimage/segmentation/_slic.c /Volumes/Projects/skimage/skimage/segmentation/_slic.pyx
Error compiling Cython file:
------------------------------------------------------------
...
float ratio, int max_iter, int n_segments):
"""Helper function for SLIC segmentation."""
# initialize on grid:
cdef Py_ssize_t depth, height, width
shape = image_zyx.shape
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:25:21: Cannot convert 'Py_ssize_t [8]' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
n_means = means.shape[0]
cdef Py_ssize_t i, k, x, y, z, x_min, x_max, y_min, y_max, z_min, z_max, \
changes
cdef double dist_mean
cdef cnp.float_t* image_p = <cnp.float_t*> image_zyx.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:40:32: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
n_means = means.shape[0]
cdef Py_ssize_t i, k, x, y, z, x_min, x_max, y_min, y_max, z_min, z_max, \
changes
cdef double dist_mean
cdef cnp.float_t* image_p = <cnp.float_t*> image_zyx.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:40:32: Python objects cannot be cast to pointers of primitive types
Error compiling Cython file:
------------------------------------------------------------
...
cdef Py_ssize_t i, k, x, y, z, x_min, x_max, y_min, y_max, z_min, z_max, \
changes
cdef double dist_mean
cdef cnp.float_t* image_p = <cnp.float_t*> image_zyx.data
cdef cnp.float_t* distance_p = <cnp.float_t*> distance.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:41:35: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
cdef Py_ssize_t i, k, x, y, z, x_min, x_max, y_min, y_max, z_min, z_max, \
changes
cdef double dist_mean
cdef cnp.float_t* image_p = <cnp.float_t*> image_zyx.data
cdef cnp.float_t* distance_p = <cnp.float_t*> distance.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:41:35: Python objects cannot be cast to pointers of primitive types
Error compiling Cython file:
------------------------------------------------------------
...
cdef cnp.float_t* current_pixel
cdef double tmp
for i in range(max_iter):
distance.fill(np.inf)
changes = 0
current_mean = <cnp.float_t*> means.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:48:23: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
cdef cnp.float_t* current_pixel
cdef double tmp
for i in range(max_iter):
distance.fill(np.inf)
changes = 0
current_mean = <cnp.float_t*> means.data
^
------------------------------------------------------------
skimage/segmentation/_slic.pyx:48:23: Python objects cannot be cast to pointers of primitive types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment