Docs / Demo projects
CT to 3D anatomy
CT scans become coloured 3D models of every organ, bone and vessel to turn around, cut through and print, and a soft-tissue model that moves under gravity.
assets/images/site/demo-ct-anatomy.jpg1600 × 900 pxThe 3D view of a torso from a CT scan: coloured bones, organs and vessels with the Parts list open, next to the three slices of the scan with the structures coloured over them.Public CT scans with expert labels, read in place from Zenodo, checked and shown as slices, then turned into 3D models of each structure. The second flow makes the organs move as you turn the body. For research and teaching, not for clinical use.
The flows
| Flow | What it does |
|---|---|
| 1 · CT to 3D anatomy (expert labels) | Three CT cases of the TotalSegmentator dataset, checked, shown as slices with the anatomy, and turned into 3D models and STL files from the experts' labels. |
| 2 · Soft tissue under gravity | The same case as a soft-tissue model: organs sag, sway and push each other as the body turns, held by the skeleton and contained by the skin. |
What you need
Any worker, on the CPU. Only the files of the chosen cases are read from the dataset. The worker needs Run code from projects turned on (Computing > your worker > Worker settings).
Try it
- Open Projects > Demos and choose CT to 3D anatomy. Read its readme.
- Open flow 1 in the Blueprint and press Run: it runs as it is on your own workers. Switch to the View page to watch it. Its runs and results are yours only.
- To change it, choose Clone into my workspace: a copy goes into your workspace, with its readme, blueprints, the code of its blocks and its files, saved to a GitHub repository of yours (link GitHub first, under Profile > GitHub).
The blocks behind it
Three blocks take a scan from its files to anatomy you can turn around in the browser: Read medical images checks the scans, Labels to 3D models turns each segmented structure into a surface, and Soft body model makes the organs sag and sway in the 3D view. They run on any worker, on the CPU. Scans stay on the worker; only the 3D scene, previews and tables reach EsaSim.
These blocks are for research, teaching and demos. The soft-tissue model is plausible, not validated: it is not for clinical use.
Build the flow yourself
- Bring the cases in with a Dataset block (a folder your worker shares) or Download files (a public dataset such as TotalSegmentator; Case file and Cases take whole case folders, at random or by name, and only the files kept are read out of large zips).
- Read medical images: connect the scans and, optionally, their labels.
- Labels to 3D models: connect the label maps or the masks.
- Soft body model (optional): connect the masks and the CT scan.
- Connect the models (and the soft body model) to a 3D view, and the tables to a Table view.
Read medical images
Takes NIfTI (.nii, .nii.gz), NRRD or MHA files, or DICOM series (folders of .dcm files, grouped by series). Each scan is checked for size, spacing, orientation, missing slices and thick slices, and DICOM series are written as NIfTI for the next blocks. A picture of each scan shows an axial, a coronal and a sagittal slice in a CT window (soft tissue, bone, lung, brain) or scaled for MR; with labels connected, the structures are coloured over the slices. Only technical DICOM tags reach the table (modality, series, maker, slice thickness): never a patient's name, ID or dates.
Labels to 3D models
Takes a label map per case (each number a structure, with names from a table of id, name and optionally group and color) or masks, one file per structure in a folder such as segmentations/, as in TotalSegmentator. Each structure becomes a smoothed, closed surface, reduced to at most Triangles and checked for pieces, open edges and watertightness, so the table says which models are ready to print.
- GLB scene per case for the 3D view, in metres, grouped as skeleton, organs, vessels, heart, lungs and airways, and muscles, and coloured as anatomy atlases do. It is kept compact (Scene triangles) so it opens quickly.
- STL files per structure, in millimetres, at full detail, for 3D printing.
- Structures picks some by name or group:
liver,kidney_*,vessels,skeleton.
A full TotalSegmentator case (about 100 structures) takes a minute or two.
In the 3D view
The view shows one model at a time, without the floor. The Parts button lists the structures by group: show or hide each one, find one by name, and point at a model to read its name. A cutting plane slices through the anatomy. A 3D mouse turns and moves it.
Soft body model
Following the metaball soft-tissue method of Gianluca De Novi (PhD thesis, University of Bologna, 2011), each soft structure is filled with spheres whose centres are particles with mass, joined by damped elastic links inside the structure, to its neighbours (connective tissue) and to the skeleton, which stays fixed. Muscles are tied to the bones where they meet them, a chest wall keeps the lungs inside the ribs, and the skin is the body's outline in the CT.
Each structure gets a stiffness (Young's modulus) and a density: liver, spleen, pancreas, kidney, thyroid and muscle from shear-wave elastography of healthy people, the others from the literature. A Tissues table (tissue, match, E, density, damping) changes them.
In the 3D view, drag to turn the body around its centre (Ctrl-drag moves it): the organs feel gravity from the new side and lag behind a quick turn or shake. Pull an organ to see it stretch. The Damping slider goes from jelly to a body that settles at once.