From cd5cc84aa98301dc718f29f694d9915e08c8814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20B=C3=B8=20Fl=C3=B8ystad?= Date: Tue, 16 Jul 2013 13:10:34 +0200 Subject: [PATCH] unwrap: Change 3D wrapper code from float to double. --- skimage/exposure/_unwrap_3d.pyx | 8 ++++---- skimage/exposure/unwrap.py | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/skimage/exposure/_unwrap_3d.pyx b/skimage/exposure/_unwrap_3d.pyx index b202e8b9..370d58be 100644 --- a/skimage/exposure/_unwrap_3d.pyx +++ b/skimage/exposure/_unwrap_3d.pyx @@ -1,12 +1,12 @@ -cdef extern void unwrap3D(float* wrapped_volume, - float* unwrapped_volume, +cdef extern void unwrap3D(double* wrapped_volume, + double* unwrapped_volume, unsigned char* input_mask, int image_width, int image_height, int volume_depth, int wrap_around_x, int wrap_around_y, int wrap_around_z) -def unwrap_3d(float[:, :, ::1] image, +def unwrap_3d(double[:, :, ::1] image, unsigned char[:, :, ::1] mask, - float[:, :, ::1] unwrapped_image, + double[:, :, ::1] unwrapped_image, wrap_around): unwrap3D(&image[0, 0, 0], &unwrapped_image[0, 0, 0], diff --git a/skimage/exposure/unwrap.py b/skimage/exposure/unwrap.py index 039ae911..0f0d4ae4 100644 --- a/skimage/exposure/unwrap.py +++ b/skimage/exposure/unwrap.py @@ -97,6 +97,8 @@ def unwrap_phase(image, wrap_around=False): unwrap_2d(image_not_masked, mask, image_unwrapped, wrap_around) elif image.ndim == 3: + image_not_masked = np.asarray(image, dtype=np.float64, order='C') + image_unwrapped = np.empty_like(image, dtype=np.float64, order='C') unwrap_3d(image_not_masked, mask, image_unwrapped, wrap_around)