Repository: Project-MONAI/MONAI
File: tests/test_apply_transform_to_pointsd.py (Python)

Code before:
    [MetaTensor(DATA_2D, affine=AFFINE_1), POINT_2D_WORLD, None, True, False, POINT_2D_IMAGE],  # use image affine
    [None, MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), None, False, False, POINT_2D_WORLD],  # use point affine
    [None, MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), AFFINE_1, False, False, POINT_2D_WORLD],  # use input affine
    [
        MetaTensor(DATA_2D, affine=AFFINE_1),
        POINT_2D_WORLD,
        None,
        True,
        True,
        POINT_2D_IMAGE_RAS,
    ],  # test affine_lps_to_ras
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, False, POINT_3D_IMAGE],
    ["affine", POINT_3D_WORLD, None, True, False, POINT_3D_IMAGE],  # use refer_data itself
    [
        MetaTensor(DATA_3D, affine=AFFINE_2),
        MetaTensor(POINT_3D_IMAGE, affine=AFFINE_2),
        None,
        False,
        False,
        POINT_3D_WORLD,
    ],
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, True, POINT_3D_IMAGE_RAS],
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, True, POINT_3D_IMAGE_RAS],
]
TEST_CASES_SEQUENCE = [
    [
        (MetaTensor(DATA_2D, affine=AFFINE_1), MetaTensor(DATA_3D, affine=AFFINE_2)),
        [POINT_2D_WORLD, POINT_3D_WORLD],
        None,
        True,
        False,
        ["image_1", "image_2"],
        [POINT_2D_IMAGE, POINT_3D_IMAGE],
    ],  # use image affine
    [
        (MetaTensor(DATA_2D, affine=AFFINE_1), MetaTensor(DATA_3D, affine=AFFINE_2)),
        [POINT_2D_WORLD, POINT_3D_WORLD],
        None,
        True,
        True,
        ["image_1", "image_2"],
        [POINT_2D_IMAGE_RAS, POINT_3D_IMAGE_RAS],
    ],  # test affine_lps_to_ras
    [
        (None, None),
        [MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), MetaTensor(POINT_3D_IMAGE, affine=AFFINE_2)],
        None,
        False,
        False,
        None,
        [POINT_2D_WORLD, POINT_3D_WORLD],

Review comment (suggestion):
We should have at least one test here where the `affine` argument is not `None` to check that the logic for choosing this works when `refer_keys` is empty or `None`. 

Code after:
    [MetaTensor(DATA_2D, affine=AFFINE_1), POINT_2D_WORLD, None, True, False, POINT_2D_IMAGE],  # use image affine
    [None, MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), None, False, False, POINT_2D_WORLD],  # use point affine
    [None, MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), AFFINE_1, False, False, POINT_2D_WORLD],  # use input affine
    [None, POINT_2D_WORLD, AFFINE_1, True, False, POINT_2D_IMAGE],  # use input affine
    [
        MetaTensor(DATA_2D, affine=AFFINE_1),
        POINT_2D_WORLD,
        None,
        True,
        True,
        POINT_2D_IMAGE_RAS,
    ],  # test affine_lps_to_ras
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, False, POINT_3D_IMAGE],
    ["affine", POINT_3D_WORLD, None, True, False, POINT_3D_IMAGE],  # use refer_data itself
    [
        MetaTensor(DATA_3D, affine=AFFINE_2),
        MetaTensor(POINT_3D_IMAGE, affine=AFFINE_2),
        None,
        False,
        False,
        POINT_3D_WORLD,
    ],
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, True, POINT_3D_IMAGE_RAS],
    [MetaTensor(DATA_3D, affine=AFFINE_2), POINT_3D_WORLD, None, True, True, POINT_3D_IMAGE_RAS],
]
TEST_CASES_SEQUENCE = [
    [
        (MetaTensor(DATA_2D, affine=AFFINE_1), MetaTensor(DATA_3D, affine=AFFINE_2)),
        [POINT_2D_WORLD, POINT_3D_WORLD],
        None,
        True,
        False,
        ["image_1", "image_2"],
        [POINT_2D_IMAGE, POINT_3D_IMAGE],
    ],  # use image affine
    [
        (MetaTensor(DATA_2D, affine=AFFINE_1), MetaTensor(DATA_3D, affine=AFFINE_2)),
        [POINT_2D_WORLD, POINT_3D_WORLD],
        None,
        True,
        True,
        ["image_1", "image_2"],
        [POINT_2D_IMAGE_RAS, POINT_3D_IMAGE_RAS],
    ],  # test affine_lps_to_ras
    [
        (None, None),
        [MetaTensor(POINT_2D_IMAGE, affine=AFFINE_1), MetaTensor(POINT_3D_IMAGE, affine=AFFINE_2)],
        None,
        False,
        False,
        None,