Skip to content

Commit

Permalink
Added tests for ImageMosaic.stitch()
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Mar 7, 2024
1 parent 6810c5a commit f20e4e7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/test_unit/test_image_mosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"07;;(115,115,0)",
]

EXPECTED_OVERLAP_COORDINATES = [
[3, 120, 2],
[6, 7, 118],
[5, 123, 116],
[6, 120, 118],
[5, 123, 116],
[3, 120, 2],
[6, 7, 118],
[5, 123, 116],
[6, 120, 118],
[5, 123, 116],
[6, 123, 118],
[6, 123, 118],
]

EXPECTED_OVERLAP_SIZE = [
[109, 12, 126],
[107, 125, 12],
[108, 9, 14],
[106, 15, 10],
[107, 125, 12],
[109, 12, 126],
[107, 125, 12],
[108, 9, 14],
[106, 15, 10],
[107, 125, 12],
[109, 12, 126],
[109, 12, 126],
]


@pytest.fixture(scope="module")
def image_mosaic(naive_bdv_directory):
Expand Down Expand Up @@ -86,3 +116,13 @@ def test_stitch(mocker, image_mosaic, naive_bdv_directory):
mock_run_big_stitcher.assert_called_once()

assert len(image_mosaic.overlaps) == 12

for idx, overlap in enumerate(image_mosaic.overlaps):
assert (
image_mosaic.overlaps[overlap].coordinates
== EXPECTED_OVERLAP_COORDINATES[idx]
).all()
assert (
image_mosaic.overlaps[overlap].size[0]
== EXPECTED_OVERLAP_SIZE[idx]
).all()

0 comments on commit f20e4e7

Please sign in to comment.