|
36 | 36 | # Image ROIs: |
37 | 37 | IROI1 = [SIZE // 2, SIZE // 2, SIZE - 25 - SIZE // 2, SIZE - SIZE // 2] # Rectangle |
38 | 38 | IROI2 = [SIZE // 3, SIZE // 2, SIZE // 4] # Circle |
| 39 | +IROI3 = [ |
| 40 | + SIZE // 2, |
| 41 | + SIZE // 2, |
| 42 | + SIZE // 2, |
| 43 | + SIZE - SIZE // 4, |
| 44 | + SIZE - SIZE // 4, |
| 45 | + SIZE - SIZE // 3, |
| 46 | +] # Polygon (triangle, that is intentionally inside the rectangle, so that this ROI |
| 47 | +# has no impact on the mask calculations in the tests) |
39 | 48 |
|
40 | 49 |
|
41 | 50 | def __run_signal_computations(panel: SignalPanel, singleobj: bool | None = None): |
@@ -162,7 +171,7 @@ def __run_image_computations(panel: ImagePanel, singleobj: bool | None = None): |
162 | 171 | roisham = "ROI shape mismatch" |
163 | 172 |
|
164 | 173 | if singleobj is None or not singleobj: # Multiple objects mode |
165 | | - assert len(panel) == obj_nb + 2, "Two objects expected" |
| 174 | + assert len(panel) == obj_nb + 3, "Three objects expected" |
166 | 175 | im1, im2 = panel[obj_nb + 1], panel[obj_nb + 2] |
167 | 176 | assert np.all(im1.data != 0), nzroi |
168 | 177 | assert im1.data.shape == (IROI1[3], IROI1[2]), roisham |
@@ -211,6 +220,7 @@ def create_test_image_with_roi( |
211 | 220 | ima.data += 1 # Ensure that the image has non-zero values (for ROI check tests) |
212 | 221 | roi = dlo.create_image_roi("rectangle", IROI1) |
213 | 222 | roi.add_roi(dlo.create_image_roi("circle", IROI2)) |
| 223 | + roi.add_roi(dlo.create_image_roi("polygon", IROI3)) |
214 | 224 | ima.roi = roi |
215 | 225 | return ima |
216 | 226 |
|
|
0 commit comments