unwrap: Change 3D wrapper code from float to double.

This commit is contained in:
Jostein Bø Fløystad
2013-07-16 13:10:34 +02:00
parent d0ccbe71c1
commit cd5cc84aa9
2 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -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],
+2
View File
@@ -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)