BiomedSciAI / histocartography

A standardized Python API with necessary preprocessing, machine learning and explainability tools to facilitate graph-analytics in computational pathology.
GNU Affero General Public License v3.0
241 stars 57 forks source link

HE Reference matrix #28

Closed krishnakanagal closed 2 years ago

krishnakanagal commented 2 years ago

Hi,

I had a question regarding Macenko Stain Normalizer. I see that the H&E Reference matrix is a hard coded matrix of shape (2, 3). Can you shed some light on how did you get this matrix? I am looking for a paper where this matrix is provided. Below is the line of code which I am referring to in the code _histocartography/preprocessing/stainnormalizers.py

self.stain_matrix_target = np.array(
                [[0.5626, 0.7201, 0.4062], [0.2159, 0.8012, 0.5581]]
PushpakPati commented 2 years ago

The stain matrix is extracted from a reference image using the Macenko algorithm. The script histocartography/preprocessing/stain_normalizers.py also allows to pass your own reference image to extract the matrix.