load_stain_matrix

load_stain_matrix(stain_matrix_input)[source]

Load a stain matrix as a numpy array.

Parameters

stain_matrix_input (ndarray or str, pathlib.Path) – either a 2x3 / 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)