Applies colour deconvolution to an H&E-stained image to separate the haematoxylin and eosin channels.
Usage
sg_stain_deconvolve(image, method = c("macenko", "ruifrok"), stains = NULL)Arguments
- image
An
sg_imageobject with at least 3 colour channels (RGB).- method
Character string specifying the deconvolution method. One of
"macenko"(default), which estimates the two stain vectors from the image, or"ruifrok", which uses the fixed haematoxylin and eosin vectors of Ruifrok and Johnston (2001).- stains
Optional 3x3 numeric matrix whose columns are the stain vectors (optical density in R, G and B) for haematoxylin, eosin and the residual channel, in that order. If
NULL, stain vectors are estimated from the image using the specifiedmethod.