Skip to main content

Visualize Geometry

Sethealth allows to load 3D models (geometry) into an existing workspace. Imagine, for example, viewing a custom implant model over a CT. Loading, generating and serializing geometries can be done through the geometry module.


Here the workspace has its own role too. A workspace contains a list of geometry models:


This array (initially empty), can be modified in order to append geometries into an existing workspace. UI components will then render the 3D model over the medical resource.

// Load medical data
const med = await{
type: "nrrd",
if (med.error) {
const medHandler = med.value[0];
// Creating workspace from medical data
const workspace = await sethealth.workspace.create(medHandler);
// Load a geometry (from a .stl) file
const result = await sethealth.geometry.loadFromSource({
type: "stl",
if (result.error) {
// Append the geometry to the workspace
const geometries = result.value;
this.setState({ workspace });

As shown here, the workspace is created with the MedHandler and then the Geometry is attached to workspace.geometries.

Render a Geometry#

The attached geometry can then be visualized with the component <set-view-geometry>.

<SetViewGeometry workspace={myWorkspace} />

The only required field is the workspace. For further information about this component, check out the component docs.