skimage2.color.combine_stains#
- skimage2.color.combine_stains(stains, conv_matrix, *, channel_axis=-1)[source]#
Stain to RGB color space conversion.
- Parameters:
- stainsarray_like of shape (…, C=3, …)
The image in stain color space. By default, the final dimension denotes channels.
- conv_matrixndarray
The stain separation matrix as described by G. Landini [1].
- channel_axisint, optional
This parameter indicates which axis of the array corresponds to channels.
Added in version 0.19:
channel_axiswas added in 0.19.
- Returns:
- outndarray of shape (…, C=3, …)
The image in RGB format. Same dimensions as input.
- Raises:
- ValueError
If
stainsis not at least 2-D with shape (…, C=3, …).
Notes
Stain combination matrices available in the
colormodule and their respective colorspace:rgb_from_hed: Hematoxylin + Eosin + DABrgb_from_hdx: Hematoxylin + DABrgb_from_fgx: Feulgen + Light Greenrgb_from_bex: Giemsa stain : Methyl Blue + Eosinrgb_from_rbd: FastRed + FastBlue + DABrgb_from_gdx: Methyl Green + DABrgb_from_hax: Hematoxylin + AECrgb_from_bro: Blue matrix Anilline Blue + Red matrix Azocarmine + Orange matrix Orange-Grgb_from_bpx: Methyl Blue + Ponceau Fuchsinrgb_from_ahx: Alcian Blue + Hematoxylinrgb_from_hpx: Hematoxylin + PAS
References
[1][2]A. C. Ruifrok and D. A. Johnston, “Quantification of histochemical staining by color deconvolution,” Anal. Quant. Cytol. Histol., vol. 23, no. 4, pp. 291–299, Aug. 2001.
Examples
>>> from _skimage2 import data >>> from _skimage2.color import (separate_stains, combine_stains, ... hdx_from_rgb, rgb_from_hdx) >>> ihc = data.immunohistochemistry() >>> ihc_hdx = separate_stains(ihc, hdx_from_rgb) >>> ihc_rgb = combine_stains(ihc_hdx, rgb_from_hdx)