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)