Skip to content

DonBeleren/vtk-volume-rendering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VTK Volume Rendering

Volume rendering and isosurface extraction of two scientific datasets, using VTK and PyQt5.

The two datasets:

  • vmhead2 is a CT scan of a human head.
  • jet_vort is the vorticity magnitude of a turbulent jet flame.

There are four scripts, one for each dataset/technique combination.

Script What it does
dvr_head.py Direct volume rendering of the head. The transfer function pulls three tissue layers out of the same scalar field: skin around value 550, muscle near 1100, skull near 1450. Raising opacity at each range isolates a layer or composites them together.
dvr_flame.py Direct volume rendering of the jet vorticity field, with a colorbar overlay.
salient_head.py Three nested isosurfaces of the head, each at a tissue boundary.
salient_flame.py Five stacked isosurfaces of the vorticity field, colored by scalar value.

Each script opens a PyQt5 window with an embedded VTK render view.

Running

Python 3, plus the two packages in requirements.txt:

pip install -r requirements.txt

Then from the repo root:

python src/dvr_head.py
python src/dvr_flame.py
python src/salient_head.py
python src/salient_flame.py

The scripts locate their .vti file relative to themselves, so the working directory doesn't matter. Pass -r <w> <h> if you want a different render window size from the 1024x768 default.

Layout

.
├── src/                  the four scripts
├── Datasets/             .vti volume datasets (small + large variants of each)
└── docs/screenshots/     example renders

Screenshots

Renderings of the vmhead2 CT scan and jet_vort simulation datasets.

Head CT, isolating layers

Same scalar field, three different opacity settings. Skin sits around scalar value 550, muscle around 1100, skull around 1450. Adjusting opacity at each range reveals one layer or composites them all.

Full DVR head Skull isolated Skull through skin
Skin and bone composited. Opacity raised on the skull range only. Skull visible through translucent skin.

Jet vorticity isosurfaces

Single isosurface Multi-band isosurface
One isosurface near the middle of the vorticity range. Multiple isosurfaces stacked, colored by vorticity.

Releases

No releases published

Packages

 
 
 

Contributors

Languages