Exemple #1
0
def test_surface_model_loader_2_surface_no_assembly():
    config = ConfigurationManager('tests/data/config/surface_model_two.json')
    config_data = config.get_copy()
    loader = SurfaceModelLoader(config_data)
    assert loader is not None
    assert len(loader.get_assembly_names()) == 0
    assert len(loader.get_surface_model_names()) == 2
Exemple #2
0
def test_surface_model_loader_2_surface_no_prefix():
    config_with_no_prefix_in_json = ConfigurationManager('tests/data/config/surface_model_two_no_prefix.json')
    config_with_no_prefix_in_json_data = config_with_no_prefix_in_json.get_copy()
    loader_no_prefix = SurfaceModelLoader(config_with_no_prefix_in_json_data, directory_prefix="tests/data/models/Liver/")
    assert loader_no_prefix is not None
    assert len(loader_no_prefix.get_assembly_names()) == 0
    assert len(loader_no_prefix.get_surface_model_names()) == 2
Exemple #3
0
def test_surface_model_loader_2_in_assembly_on_its_own(setup_vtk_overlay_window):
    config = ConfigurationManager('tests/data/config/surface_model_two_assemblies.json')
    config_data = config.get_copy()
    loader = SurfaceModelLoader(config_data)
    assert loader is not None
    assert len(loader.get_assembly_names()) == 2
    assert len(loader.get_surface_model_names()) == 3
    widget, _, _, app = setup_vtk_overlay_window
    widget.add_vtk_models(loader.get_surface_models())
    widget.show()
Exemple #4
0
def test_surface_model_loader_2_surface_with_assembly():
    config = ConfigurationManager('tests/data/config/surface_model_two_in_assembly.json')
    config_data = config.get_copy()
    loader = SurfaceModelLoader(config_data)
    assert loader is not None
    assert len(loader.get_assembly_names()) == 1
    assert len(loader.get_surface_model_names()) == 2

    # Call these functions for coverage purposes
    loader.get_assembly("veins")
    model = loader.get_surface_model("portal veins")

    # Check, the name should come from json file.
    assert model.get_name() == "portal veins"