mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-02 13:03:48 +08:00
BUX: in _slic.pyx slice can has steps=None
int(None) fails, and slice.steps == None is valid. It is equivalent to 1.
This commit is contained in:
committed by
Juan Nunez-Iglesias
parent
6f016c9087
commit
12c173908f
@@ -76,7 +76,8 @@ def _slic_cython(double[:, :, :, ::1] image_zyx,
|
||||
# approximate grid size for desired n_segments
|
||||
cdef Py_ssize_t step_z, step_y, step_x
|
||||
slices = regular_grid((depth, height, width), n_segments)
|
||||
step_z, step_y, step_x = [int(s.step) for s in slices]
|
||||
step_z, step_y, step_x = [int(s.step if s.step is not None else 1)
|
||||
for s in slices]
|
||||
|
||||
cdef Py_ssize_t[:, :, ::1] nearest_segments \
|
||||
= np.empty((depth, height, width), dtype=np.intp)
|
||||
|
||||
Reference in New Issue
Block a user