making in-place addition modification suggested in issue #1089

This commit is contained in:
Rebecca
2014-08-31 11:37:35 +01:00
parent 25d6c58674
commit 812b23d41f
+2 -1
View File
@@ -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)