is_slide_correctly_stained
Decides if a slide is stained with an expected staining protocol.
This function decides if the per-tile computed color differences are close enough for a slide to be considered stained correctly (according to a given threshold). All of the differences are aggreagated using median.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stain1_diffs
|
list[float] | NDArray[float64]
|
List of differences for the first stain. |
required |
stain2_diffs
|
list[float] | NDArray[float64]
|
List of differences for the second stain. |
required |
global_threshold
|
float
|
Threshold used to determine if the color differences
are small enough for a slide to be considered correctly stained.
Currently recommended thresold values are |
required |
Returns:
| Type | Description |
|---|---|
CorrectStaining
|
Dictionary with answer if the slide is stained correctly. |
Note
The returned dictionary contains the following values:
| Key | Description |
|---|---|
correct_staining |
True if the differences are considered to be small enough for a slide to be considered as correctly stained. |
stain1_diff_median |
Median of differences for the first stain. |
stain2_diff_median |
Median of difference for the second stain. |
Source code in rationai/qc/staining/is_slide_correctly_stained.py
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 | |