Scene
Optional dependencies
To use this module, install the optional dependency nanodrr[scene].
nanodrr.scene
¶
visualize_scene
¶
visualize_scene(
subject: Subject,
k_inv: Float[Tensor, "B 3 3"],
rt_inv: Float[Tensor, "B 4 4"],
sdd: Float[Tensor, B],
height: int,
width: int,
render_mesh: bool = True,
render_imgs: bool = True,
single_channel: bool = False,
culling: CullingMode | None = "back",
use_label: bool = False,
cutoff: float | None = 0.01,
plotter: Plotter | None = None,
verbose: bool = False,
**kwargs
) -> Plotter
Render a DRR and return a 3D scene with camera frustums and anatomy.
| PARAMETER | DESCRIPTION |
|---|---|
subject
|
The subject containing the CT volume and labelmap.
TYPE:
|
k_inv
|
Inverse intrinsic matrices.
TYPE:
|
rt_inv
|
Camera-to-world transforms.
TYPE:
|
sdd
|
Source-to-detector distances.
TYPE:
|
height
|
Detector height in pixels.
TYPE:
|
width
|
Detector width in pixels.
TYPE:
|
render_mesh
|
If True, extract a surface mesh and add it to the plot.
TYPE:
|
render_imgs
|
If True, render DRRs before plotting.
TYPE:
|
single_channel
|
If True, sum channels before texturing the detector.
TYPE:
|
culling
|
Face culling mode passed to each mesh (e.g.
TYPE:
|
use_label
|
If
TYPE:
|
cutoff
|
Threshold for binarizing the image. Ignored when
TYPE:
|
plotter
|
A PyVista plotter to add to.
TYPE:
|
verbose
|
If True, print progress during mesh extraction.
TYPE:
|
**kwargs
|
Additional arguments forwarded to :func:
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Plotter
|
A PyVista plotter with the anatomy mesh and camera frustums added. |