From 12268ff5553753791beacfa84006e9cffb7bd15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Thu, 11 Jul 2013 12:51:08 +0200 Subject: [PATCH] unwrap: Refactor and fix wrap around functionality. --- skimage/exposure/_unwrap_2d.pyx | 4 ++-- skimage/exposure/_unwrap_3d.pyx | 4 ++-- skimage/exposure/unwrap.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skimage/exposure/_unwrap_2d.pyx b/skimage/exposure/_unwrap_2d.pyx index dab52167..19292f02 100644 --- a/skimage/exposure/_unwrap_2d.pyx +++ b/skimage/exposure/_unwrap_2d.pyx @@ -7,12 +7,12 @@ cdef extern void unwrap2D(float* wrapped_image, def _unwrap2D(float[:,::1] array, unsigned char[:,::1] mask, float[:,::1] unwrapped_array, - wrap_around_x, wrap_around_y): + wrap_around): unwrap2D(&array[0,0], &unwrapped_array[0,0], &mask[0,0], array.shape[1], array.shape[0], - wrap_around_x, wrap_around_y, + wrap_around[1], wrap_around[0], ) diff --git a/skimage/exposure/_unwrap_3d.pyx b/skimage/exposure/_unwrap_3d.pyx index aa18b377..871bc293 100644 --- a/skimage/exposure/_unwrap_3d.pyx +++ b/skimage/exposure/_unwrap_3d.pyx @@ -7,12 +7,12 @@ cdef extern void unwrap3D(float* wrapped_volume, def _unwrap3D(float[:,:,::1] array, unsigned char[:,:,::1] mask, float[:,:,::1] unwrapped_array, - wrap_around_x, wrap_around_y, wrap_around_z): + wrap_around): unwrap3D(&array[0,0,0], &unwrapped_array[0,0,0], &mask[0,0,0], array.shape[2], array.shape[1], array.shape[0], #TODO: check!!! - wrap_around_x, wrap_around_y, wrap_around_z, + wrap_around[2], wrap_around[1], wrap_around[0], ) diff --git a/skimage/exposure/unwrap.py b/skimage/exposure/unwrap.py index c1251734..a67adc22 100644 --- a/skimage/exposure/unwrap.py +++ b/skimage/exposure/unwrap.py @@ -62,10 +62,10 @@ def unwrap(image, wrap_around=False): if image.ndim == 2: _unwrap_2d._unwrap2D(image_not_masked, mask, image_unwrapped, - wrap_around[0], wrap_around[1]) + wrap_around) elif image.ndim == 3: _unwrap_3d._unwrap3D(image_not_masked, mask, image_unwrapped, - wrap_around[0], wrap_around[1], wrap_around[2]) + wrap_around) if np.ma.isMaskedArray(image): return np.ma.array(image_unwrapped, mask=mask)