load_stain_matrix¶

load_stain_matrix(stain_matrix_input)[source]¶

Load a stain matrix as a numpy array.

Parameters:

stain_matrix_input (ndarray | PathLike) – Either a 2x3 or 3x3 numpy array or a path to a saved .npy / .csv file. If using a .csv file, there should be no column headers provided

Returns:

The loaded stain matrix.

Return type:

stain_matrix (numpy.ndarray)

Examples

>>> from tiatoolbox import utils
>>> sm = utils.misc.load_stain_matrix(stain_matrix_input)