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.
- Type:
- 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.ndarray
of 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.ndarray
of typenumpy.uint8
) – RGB input source image.- Returns:
RGB stain normalized image.
- Return type: