|
48 | 48 | # input pixels not uniformly filled, leading to two different stains extracted
|
49 | 49 | EXTRACT_STAINS_TEST_CASE_5 = [
|
50 | 50 | np.array([[[100, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]]]),
|
51 |
| - np.array([[0.70710677, 0.18696113], [0.0, 0.0], [0.70710677, 0.98236734]]), |
| 51 | + np.array([[0.18696113, 0.70710677], [0.0, 0.0], [0.98236734, 0.70710677]]), |
52 | 52 | ]
|
53 | 53 |
|
54 | 54 | # input pixels all transparent and below the beta absorbance threshold
|
|
68 | 68 | NORMALIZE_STAINS_TEST_CASE_4 = [
|
69 | 69 | {"target_he": np.full((3, 2), 1)},
|
70 | 70 | np.array([[[100, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]]]),
|
71 |
| - np.array([[[87, 87, 87], [33, 33, 33]], [[33, 33, 33], [33, 33, 33]], [[33, 33, 33], [33, 33, 33]]]), |
| 71 | + np.array([[[31, 31, 31], [85, 85, 85]], [[85, 85, 85], [85, 85, 85]], [[85, 85, 85], [85, 85, 85]]]), |
72 | 72 | ]
|
73 | 73 |
|
74 | 74 |
|
@@ -135,7 +135,7 @@ def test_result_value(self, image, expected_data):
|
135 | 135 | [[0.18696113],[0],[0.98236734]] and
|
136 | 136 | [[0.70710677],[0],[0.70710677]] respectively
|
137 | 137 | - the resulting extracted stain should be
|
138 |
| - [[0.70710677,0.18696113],[0,0],[0.70710677,0.98236734]] |
| 138 | + [[0.18696113,0.70710677],[0,0],[0.98236734,0.70710677]] |
139 | 139 | """
|
140 | 140 | if image is None:
|
141 | 141 | with self.assertRaises(TypeError):
|
@@ -206,17 +206,17 @@ def test_result_value(self, arguments, image, expected_data):
|
206 | 206 |
|
207 | 207 | For test case 4:
|
208 | 208 | - For this non-uniformly filled image, the stain extracted should be
|
209 |
| - [[0.70710677,0.18696113],[0,0],[0.70710677,0.98236734]], as validated for the |
| 209 | + [[0.18696113,0.70710677],[0,0],[0.98236734,0.70710677]], as validated for the |
210 | 210 | ExtractHEStains class. Solving the linear least squares problem (since
|
211 | 211 | absorbance matrix = stain matrix * concentration matrix), we obtain the concentration
|
212 |
| - matrix that should be [[-0.3101, 7.7508, 7.7508, 7.7508, 7.7508, 7.7508], |
213 |
| - [5.8022, 0, 0, 0, 0, 0]] |
| 212 | + matrix that should be [[5.8022, 0, 0, 0, 0, 0], |
| 213 | + [-0.3101, 7.7508, 7.7508, 7.7508, 7.7508, 7.7508]] |
214 | 214 | - Normalizing the concentration matrix, taking the matrix product of the
|
215 | 215 | target stain matrix and the concentration matrix, using the inverse
|
216 | 216 | Beer-Lambert transform to obtain the RGB image from the absorbance
|
217 | 217 | image, and finally converting to uint8, we get that the stain normalized
|
218 |
| - image should be [[[87, 87, 87], [33, 33, 33]], [[33, 33, 33], [33, 33, 33]], |
219 |
| - [[33, 33, 33], [33, 33, 33]]] |
| 218 | + image should be [[[31, 31, 31], [85, 85, 85]], [[85, 85, 85], [85, 85, 85]], |
| 219 | + [[85, 85, 85], [85, 85, 85]]] |
220 | 220 | """
|
221 | 221 | if image is None:
|
222 | 222 | with self.assertRaises(TypeError):
|
|
0 commit comments