Skip to content

Commit d21f10e

Browse files
minor changes to vis
1 parent ca1ebae commit d21f10e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

deepdrr/vis.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def show(
2828
*item: Any,
2929
full: Union[bool, List[bool]] = False,
3030
colors: List[str] = ["tan", "cyan", "green", "red"],
31+
background: str = "#4d94b0",
3132
) -> np.ndarray:
3233
"""Show the given items in a pyvista window.
3334
@@ -36,7 +37,7 @@ def show(
3637
"""
3738
plotter = pv.Plotter()
3839
plotter.show_axes()
39-
plotter.set_background("#4d94b0")
40+
plotter.set_background(background)
4041

4142
items = item
4243
fulls = utils.listify(full, len(items))
@@ -45,5 +46,7 @@ def show(
4546
plotter.add_mesh(item.get_mesh_in_world(full=full), color=color)
4647

4748
plotter.reset_camera()
48-
_, image = plotter.show(screenshot=True)
49+
plotter.show(auto_close=False)
50+
image = plotter.screenshot()
51+
plotter.close()
4952
return image

deepdrr/vol/volume.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def from_dicom(
386386
materials_path = cache_dir / f"{stem}_materials_thresholding.npz"
387387
if use_cached and materials_path.exists():
388388
logger.info(f"found materials segmentation at {materials_path}.")
389+
# TODO: recover from EOFError
389390
materials = dict(np.load(materials_path))
390391
else:
391392
logger.info(f"segmenting materials in volume")

0 commit comments

Comments
 (0)