Estimating Stain Vectors
The colour deconvolution method introduced by Ruifrok and Johnston is used by QuPath.
Last updated
The colour deconvolution method introduced by Ruifrok and Johnston is used by QuPath.
Last updated
Once the projects are created, and the project_Classifiers is opned, the next step is to estimate the stain vectors.
The images in this tutorial are from a Windows laptop with version 0.4.4 of QuPath whereas we updated the rest to the newest QuPath version 0.5.1 which is needed for this tutorial.
If you are working with a Mac your interface might look different, although it is the same software.
โctrl+Lโ > type โestimate stain vectorsโ and click on Yes.
Select Ok, and set a name for stain vectors H-DAB estimated.
choose hematoxylin and set it on auto, perform the same for DAB
Shortcuts for view of different colors
โ1โ Original stain
โ2โ Hematoxylin
โ3โ DAB
"4โ Residual
โ5โ normalised optical density colors
Under Workflow > create script > you can create the code lines for the estimation of the staining vectors. Delete all the lines except the last setColorDeconvolutionStains{...}.
Save the created script as "EstimatingStainVectors_component" under File > Save.
Create a new folder "scripts" in the project.
setColorDeconvolutionStains('{"Name" : "H-DAB estimated", "Stain 1" : "Hematoxylin", "Values 1" : "0.73481 0.63078 0.24935", "Stain 2" : "DAB", "Values 2" : "0.27519 0.51569 0.81138", "Background" : " 255 255 255"}');
Under Automate > Show script editor the script can always be reopened and needs to be run for example on the training image before detecting the cells.
In this video, Pete Bankhead the creator of QuPath shows the 2 different ways how to estimate the correct stain vectors for DAB and Hematoxylin. Note that the above instruction shows the second method, with a region containing immunopositive cells (brown) and immunonegative cells (blue) as well as a background. The other method sets the vectors individually, by setting them manually for the DAB and Hematoxylin. Both methods work and can be used.
License:
Ruifrok, Arnout & Johnston, Dennis. (2001). Ruifrok AC, Johnston DA. Quantification of histochemical staining by color deconvolution. Anal Quant Cytol Histol 23: 291-299. Analytical and quantitative cytology and histology / the International Academy of Cytology [and] American Society of Cytology. 23. 291-9.
With an open scan as an example, shortcut โRโ or click on (draw square) around a section with brown cells, blue cells, and a background.
Click on under auto-detection, this will lead to a change in the stain vectors that is automatically saved for the corresponding image.
Should you experience any difficulties, please visit the original broad tutorial.
To optimise all the stains on the initial image, Click on and optimise all the stains.