StainNormalizer¶
- class StainNormalizer[source]¶
Stain normalization base class. This class contains code inspired by StainTools [https://github.com/Peter554/StainTools] written by Peter Byfield.
- extractor¶
method specific stain extractor.
- stain_matrix_target¶
stain matrix of target.
- Type
- target_concentrations¶
stain concentration matrix of target.
- Type
- maxC_target¶
99th percentile of each stain.
- Type
- stain_matrix_target_RGB¶
target stain matrix in RGB.
- Type
Methods
Fit to a target image.
Estimate concentration matrix given an image and stain matrix.
Transform an image.
- fit(target)[source]¶
Fit to a target image.
- Parameters
target (
numpy.ndarrayof typenumpy.uint8) – target/reference image.
- static get_concentrations(img, stain_matrix)[source]¶
Estimate concentration matrix given an image and stain matrix.
- Parameters
img (
numpy.ndarray) – input image.stain_matrix (
numpy.ndarray) – stain matrix for haematoxylin and eosin stains.
- Returns
stain concentrations of input image.
- Return type
- transform(img)[source]¶
Transform an image.
- Parameters
img (
numpy.ndarrayof typenumpy.uint8) – RGB input source image.- Returns
RGB stain normalized image.
- Return type