MacenkoExtractor#
- class MacenkoExtractor(luminosity_threshold=0.8, angular_percentile=99)[source]#
Macenko stain extractor.
Get the stain matrix as defined in:
Macenko, Marc, et al. “A method for normalizing histology slides for quantitative analysis.” 2009 IEEE International Symposium on Biomedical Imaging: From Nano to Macro. IEEE, 2009.
This class contains code inspired by StainTools [https://github.com/Peter554/StainTools] written by Peter Byfield.
- Parameters:
Examples
>>> from tiatoolbox.tools.stainextract import MacenkoExtractor >>> from tiatoolbox.utils.misc import imread >>> extractor = MacenkoExtractor() >>> img = imread('path/to/image') >>> stain_matrix = extractor.get_stain_matrix(img)
Methods
Stain matrix estimation.
- get_stain_matrix(img)[source]#
Stain matrix estimation.
- Parameters:
img (
numpy.ndarray
) – Input image used for stain matrix estimation.- Returns:
Estimated stain matrix.
- Return type: