Ejemplo n.º 1
0
def test_montage_with_missing_number_missing(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[10, 11, 12])
    montage, mask, number_missing = \
            pre.montage_with_missing(files, order=SPIRAL_CLOCKWISE_RIGHT_25,
                                     re_string=r'.*_[A-P]\d{2}f(\d{2})d0',
                                     re_group=1)
    assert number_missing == 3
Ejemplo n.º 2
0
def test_montage_with_missing_mask(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[3, 8])
    montage, mask, number_missing = pre.montage_with_missing(files)

    expected_mask = np.ones((10, 10), np.bool)
    expected_mask[6:8, 4:6] = False
    expected_mask[2:4, 6:8] = False

    np.testing.assert_array_equal(expected_mask, mask)
Ejemplo n.º 3
0
def test_montage_with_missing_mask(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[3, 8])
    montage, mask, number_missing = \
            pre.montage_with_missing(files, order=SPIRAL_CLOCKWISE_RIGHT_25,
                                     re_string=r'.*_[A-P]\d{2}f(\d{2})d0',
                                     re_group=1)

    expected_mask = np.ones((10, 10), np.bool)
    expected_mask[6:8, 4:6] = False
    expected_mask[2:4, 6:8] = False

    np.testing.assert_array_equal(expected_mask, mask)
Ejemplo n.º 4
0
def test_montage_with_missing(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[20])
    montage, mask, number_missing = \
            pre.montage_with_missing(files, order=SPIRAL_CLOCKWISE_RIGHT_25,
                                     re_string=r'.*_[A-P]\d{2}f(\d{2})d0',
                                     re_group=1)

    expect_montage = np.array([[0, 0, 21, 21, 22, 22, 23, 23, 24, 24],
                               [0, 0, 21, 21, 22, 22, 23, 23, 24, 24],
                               [19, 19, 6, 6, 7, 7, 8, 8, 9, 9],
                               [19, 19, 6, 6, 7, 7, 8, 8, 9, 9],
                               [18, 18, 5, 5, 0, 0, 1, 1, 10, 10],
                               [18, 18, 5, 5, 0, 0, 1, 1, 10, 10],
                               [17, 17, 4, 4, 3, 3, 2, 2, 11, 11],
                               [17, 17, 4, 4, 3, 3, 2, 2, 11, 11],
                               [16, 16, 15, 15, 14, 14, 13, 13, 12, 12],
                               [16, 16, 15, 15, 14, 14, 13, 13, 12, 12]],
                              np.uint8)

    np.testing.assert_array_equal(expect_montage, montage)
Ejemplo n.º 5
0
def test_montage_with_missing(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[20])
    montage, mask, number_missing = pre.montage_with_missing(files)

    expect_montage = np.array(
        [
            [0, 0, 21, 21, 22, 22, 23, 23, 24, 24],
            [0, 0, 21, 21, 22, 22, 23, 23, 24, 24],
            [19, 19, 6, 6, 7, 7, 8, 8, 9, 9],
            [19, 19, 6, 6, 7, 7, 8, 8, 9, 9],
            [18, 18, 5, 5, 0, 0, 1, 1, 10, 10],
            [18, 18, 5, 5, 0, 0, 1, 1, 10, 10],
            [17, 17, 4, 4, 3, 3, 2, 2, 11, 11],
            [17, 17, 4, 4, 3, 3, 2, 2, 11, 11],
            [16, 16, 15, 15, 14, 14, 13, 13, 12, 12],
            [16, 16, 15, 15, 14, 14, 13, 13, 12, 12],
        ],
        np.uint8,
    )

    np.testing.assert_array_equal(expect_montage, montage)
Ejemplo n.º 6
0
def test_montage_with_missing_number_missing(test_image_files_montage):
    files = test_image_files_montage(missing_fields=[10, 11, 12])
    montage, mask, number_missing = pre.montage_with_missing(files)
    assert number_missing == 3