{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / color / colorconv / combine_stains

function

skimage.color.colorconv:combine_stains

source: /dev/scikit-image/src/skimage/color/colorconv.py:1743

Signature

def combine_stains(stains, conv_matrix, *, channel_axis = -1)

Summary

Stain to RGB color space conversion.

Parameters

stains : array_like of shape (..., C=3, ...)

The image in stain color space. By default, the final dimension denotes channels.

conv_matrix : ndarray

The stain separation matrix as described by G. Landini [1].

channel_axis : int, optional

This parameter indicates which axis of the array corresponds to channels.

Returns

out : ndarray of shape (..., C=3, ...)

The image in RGB format. Same dimensions as input.

Raises

: ValueError

If stains is not at least 2-D with shape (..., C=3, ...).

Notes

Stain combination matrices available in the color module and their respective colorspace:

  • rgb_from_hed: Hematoxylin + Eosin + DAB

  • rgb_from_hdx: Hematoxylin + DAB

  • rgb_from_fgx: Feulgen + Light Green

  • rgb_from_bex: Giemsa stainMethyl Blue + Eosin

  • rgb_from_rbd: FastRed + FastBlue + DAB

  • rgb_from_gdx: Methyl Green + DAB

  • rgb_from_hax: Hematoxylin + AEC

  • rgb_from_bro: Blue matrix Anilline Blue + Red matrix Azocarmine + Orange matrix Orange-G

  • rgb_from_bpx: Methyl Blue + Ponceau Fuchsin

  • rgb_from_ahx: Alcian Blue + Hematoxylin

  • rgb_from_hpx: Hematoxylin + PAS

Examples

from skimage import data
from skimage.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)
✓

Aliases

  • skimage.color.combine_stains