CustomExtractor#

class CustomExtractor(stain_matrix)[source]#

Get the user-defined stain matrix.

This class contains code inspired by StainTools [https://github.com/Peter554/StainTools] written by Peter Byfield.

Examples

>>> from tiatoolbox.tools.stainextract import CustomExtractor
>>> from tiatoolbox.utils.misc import imread
>>> extractor = CustomExtractor(stain_matrix)
>>> img = imread('path/to/image')
>>> stain_matrix = extractor.get_stain_matrix(img)

Methods

get_stain_matrix

Get the user defined stain matrix.

get_stain_matrix(_)[source]#

Get the user defined stain matrix.

Returns:

User defined stain matrix.

Return type:

numpy.ndarray