Skip to content

Repository files navigation

ALViS

Accurate Lung Visualization and Simulation

Problem Defintion & Goals

Overview of the Project Flow

Given a CT-Scan for the lungs of a patient, we extract the personalized extended bronchial tree using AVATREE and the FAST framework in order to develop a computational model using OpenFOAM for airflow and gas transport in the subject-specific human lungs. The project as a whole is meant to be open-source allowing for any possible future contributions by the community.

Sample Output

Bronchial Tree up to 7 Generations

Skeleton with Initial Design for Custom Alveoli

3D Mesh with Modified Trachea Opening

OpenFOAM case configuration

OpenFOAM_Automation.py configures the pressure, velocity, and meshing dictionaries for a binary airway tree. It requires PyFoam and an existing OpenFOAM case containing 0/p, 0/U, system/snappyHexMeshDict, and system/surfaceFeaturesDict.

python3 OpenFOAM_Automation.py --generations 7 --case /path/to/openfoam-case

This produces 2^n outlet patches for n generations. The helper stops at 12 generations by default (4,096 outlets); pass --allow-large-case only when that scale is intended.

Build & Reproduce

Native build dependencies (Homebrew):

brew install eigen boost cgal itk qt
cmake -S src -B build-mac -G Ninja && ninja -C build-mac -j2

Run

Viewer with airflow demo (see docs/demo-airflow.md for the full story):

./src/ApplicationV2 demo/tree.obj             # healthy bifurcation + flow
./src/ApplicationV2 demo_constricted/tree.obj # 50% stenosis variant
./src/ApplicationV2 data/lung.obj             # large mesh, no flow data

Keys: a particles, v color mode (branch/pressure/plain), +/- speed, l load, w wireframe, p screenshot, --help for all.

Re-run the CFD at a new inlet velocity:

demo/rerun.sh --case demo/case --demo demo --velocity 0.025 --iters 200

Docker OpenFOAM usage:

docker compose run --rm modeller bash
python3 OpenFOAM_Automation.py --generations 7 --case /path/to/openfoam-case

Run tests:

pytest

About

A computational pipeline that transforms patient CT scans into personalized 3D lung models, enabling highly accurate simulations of airflow and gas transport.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages