mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Merge pull request #1116 from rebeccaroisin/inplace_addition
Speed-up through in-place addition (closes gh-1089)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user