U ¯PÓh® ã@sDddlmZddlZddlmZGdd„deƒZGdd„deƒZdS)é)Ú annotationsN)Ú Transformc@sHeZdZdZddddddd œd d „Zd d d œdd„Zd d d œdd„ZdS)ÚExtractHEStainsaQClass to extract a target stain from an image, using stain deconvolution (see Note). Args: tli: transmitted light intensity. Defaults to 240. alpha: tolerance in percentile for the pseudo-min (alpha percentile) and pseudo-max (100 - alpha percentile). Defaults to 1. beta: absorbance threshold for transparent pixels. Defaults to 0.15 max_cref: reference maximum stain concentrations for Hematoxylin & Eosin (H&E). Defaults to (1.9705, 1.0308). Note: For more information refer to: - the original paper: Macenko et al., 2009 http://wwwx.cs.unc.edu/~mn/sites/default/files/macenko2009.pdf - the previous implementations: - MATLAB: https://github.com/mitkovetta/staining-normalization - Python: https://github.com/schaugf/HEnorm_python éðéç333333Ã?©gºI +‡ÿ?gx $(~ð?Úfloatútuple | np.ndarrayÚNone)ÚtliÚalphaÚbetaÚmax_crefÚreturncCs"||_||_||_t |¡|_dS)N)r r rÚnpÚarrayr)Úselfr r rr©rú`/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/apps/pathology/transforms/stain/array.pyÚ__init__'szExtractHEStains.__init__ú np.ndarray©Úimagerc Cs t|tjƒstdƒ‚| ¡dkr(tdƒ‚| ¡dkrÚyZconcZmax_concÚtmpZimage_cZ image_normrrrrE˜s(      < $ zNormalizeHEStains.__call__N)rrrrKr)rFrGrHrIrrErrrrrJosú rJ)Ú __future__rÚnumpyrÚmonai.transforms.transformrrrJrrrrÚ s  \