pywsi.normalization package¶
Submodules¶
pywsi.normalization.macenko module¶
-
class
pywsi.normalization.macenko.
MacenkoNormalization
(beta=0.15, alpha=1, lambda1=0.01, lambda2=0.01, gamma1=0.01, maskout_white=True, nonwhite_threshold=0.8)[source]¶ Bases:
object
-
get_both_stains
(vis=True)[source]¶ Get the 3 channel values belonging to both stainsn
Parameters: - vis: bool
Should visualize?
-
get_concentrations
(image, stain_matrix)[source]¶ Get concentration matrix.
Parameters: - image: array_like
rgb
Returns: - concentration: array_like
N x 2 matrix for an N x M case.
-
get_eosin_channel
(source_image=None, total=True)[source]¶ Get eosin channel concentration of source or target image.
If source image is providedd, then the returned value represents the target stain vector remains the same, the source image concentration is then calculated by an inverse calculation C = IS^{-1}
If no source image is provided, it simply returns the concentration channel of the target image, second column in this case.
-
get_eosin_stain
(vis=True)[source]¶ Get the 3 channel values belonging to the eosin stain
Parameters: - vis: bool
Should visualize?
Returns: - E: array_like
A length 3 vector of RGB values
-
get_hematoxylin_channel
(source_image=None, total=True)[source]¶ Get hematoxylin channel concentration of source or target image.
If source image is providedd, then the returned value represents the target stain vector remains the same, the source image concentration is then calculated by an inverse calculation C = IS^{-1}
If no source image is provided, it simply returns the concentration channel of the target image, first column in this case.
-
get_hematoxylin_stain
(vis=True)[source]¶ Get the 3 channel values belonging to the hematoxylin stain
Parameters: - vis: bool
Should visualize?
Returns: - H: array_like
A length 3 vector of RGB values
-