From 812b23d41f8d7e71b962044c640b18e70dbd73e7 Mon Sep 17 00:00:00 2001 From: Rebecca Date: Sun, 31 Aug 2014 11:37:35 +0100 Subject: [PATCH] making in-place addition modification suggested in issue #1089 --- skimage/color/colorconv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skimage/color/colorconv.py b/skimage/color/colorconv.py index 80f115ee..59e68048 100644 --- a/skimage/color/colorconv.py +++ b/skimage/color/colorconv.py @@ -1127,7 +1127,8 @@ def separate_stains(rgb, conv_matrix): >>> ihc = data.immunohistochemistry() >>> ihc_hdx = separate_stains(ihc, hdx_from_rgb) """ - rgb = dtype.img_as_float(rgb) + 2 + rgb = dtype.img_as_float(rgb, force_copy=True) + rgb += 2 stains = np.dot(np.reshape(-np.log(rgb), (-1, 3)), conv_matrix) return np.reshape(stains, rgb.shape)