From 29c84a8a7bea09dae0dc4fa419ed0bd89436e127 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Fri, 17 Aug 2012 23:02:08 -0400 Subject: [PATCH] STY: Rename returned image to distinguish input from output. --- skimage/morphology/greyreconstruct.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/skimage/morphology/greyreconstruct.py b/skimage/morphology/greyreconstruct.py index 8c12a9c5..c68e6e24 100644 --- a/skimage/morphology/greyreconstruct.py +++ b/skimage/morphology/greyreconstruct.py @@ -136,15 +136,13 @@ def reconstruction(image, mask, selem=None, offset=None): # Create a rank-order value array so that the Cython inner-loop # can operate on a uniform data type - # fragile: `reconstruction_loop` needs 'uint32' conversion by `rank_order` - values, value_map = rank_order(values) + rec_img, value_map = rank_order(values) current = value_sort[0] - reconstruction_loop(values, prev, next, nb_strides, current, image_stride) + reconstruction_loop(rec_img, prev, next, nb_strides, current, image_stride) - # Reshape the values array to the shape of the padded image - # and return the unpadded portion of that result - values = value_map[values[:image_stride]] - values.shape = np.array(image.shape) + 2 * padding - return values[inside_slices] + # Reshape reconstructed image to original image shape and remove padding. + rec_img = value_map[rec_img[:image_stride]] + rec_img.shape = np.array(image.shape) + 2 * padding + return rec_img[inside_slices]