From 1da86def59271c14aab9357a32e565d8308f426d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 16 Dec 2014 00:54:32 +0100 Subject: [PATCH] Make the initialization deterministic --- skimage/restoration/unwrap_2d_ljmu.c | 3 +++ skimage/restoration/unwrap_3d_ljmu.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/skimage/restoration/unwrap_2d_ljmu.c b/skimage/restoration/unwrap_2d_ljmu.c index 60d0839d..c2c47525 100644 --- a/skimage/restoration/unwrap_2d_ljmu.c +++ b/skimage/restoration/unwrap_2d_ljmu.c @@ -161,6 +161,9 @@ void initialisePIXELs(double *wrapped_image, unsigned char *input_mask, unsigned char *extended_mask_pointer = extended_mask; int i, j; + // Make the initialization deterministic + srand(0); + for (i = 0; i < image_height; i++) { for (j = 0; j < image_width; j++) { pixel_pointer->increment = 0; diff --git a/skimage/restoration/unwrap_3d_ljmu.c b/skimage/restoration/unwrap_3d_ljmu.c index a6c9f464..2f498f66 100644 --- a/skimage/restoration/unwrap_3d_ljmu.c +++ b/skimage/restoration/unwrap_3d_ljmu.c @@ -166,6 +166,9 @@ void initialiseVOXELs(double *WrappedVolume, unsigned char *input_mask, unsigned char *extended_mask_pointer = extended_mask; int n, i, j; + // Make the initialization deterministic + srand(0); + for (n = 0; n < volume_depth; n++) { for (i = 0; i < volume_height; i++) { for (j = 0; j < volume_width; j++) {