dominant_stains
Estimates dominant stain vectors for a given image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
RGBImage
|
Tissue stained with two stains. |
required |
i0
|
int
|
Transmitted light intensity (i.e., what is the intensity of light that passed through no tissue). |
240
|
alpha
|
int
|
Percentile offset for robust stain estimation. |
1
|
beta
|
float
|
Threshold for removing transparent pixels in OD-space. |
0.15
|
Note
Default values for i0, alpha, and beta parameters are inspired
by the reference implementation.
Returns:
| Type | Description |
|---|---|
DominantStains
|
Dictionary with two dominant stains. |
Note
The returned dictionary contains the following values:
| Key | Description |
|---|---|
stain1 |
First dominant stain vector. |
stain2 |
Second dominant stain vector. |
Examples:
from skimage.data import immunohistochemistry
from rationai.qc.staining import dominant_stains
img = immunohistochemistry()
result = dominant_stains(img=img)
stain1, stain2 = result["stain1"], result["stain2"]
# Values should be somewhat close to Hematoxylin and DAB stain vectors.
print(stain1, stain2)
Source code in rationai/qc/staining/dominant_stains.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |