MONAI Physio - Software Development Statistics

Report Generated: December 4, 2026 Project Version: 2026.12.0 Status: Beta (Development Status: 4 - Beta)

Line counts below are total lines per file (wc -l), including blanks and comments, over Git-tracked files only (git ls-files).


Executive Summary

MONAI Physio is a collection of methods, workflows, tutorials, and CLI tools for creating personalized physiological digital twins from 3D/4D medical images. This report summarizes development effort, code quality, and project maturity.

Key Metrics at a Glance

Metric

Value

Total Lines of Code

~121,500

Development Period

December 5, 2025 - December 4, 2026 (~12 months)

Total Commits

217 (on main)

Primary Developer

1 (Stephen Aylward), plus 2 outside contributors


Detailed Code Statistics

Lines of Code Breakdown

Category

Files

Lines of Code

Percentage

Core Python Source (src/)

104 files

44,394

36.5%

Test Suite (tests/)

66 files

24,660

20.3%

Experiment Scripts (experiments/)

66 files

13,914

11.4%

Tutorials (tutorials/)

50 files

16,750

13.8%

Utility Scripts (utils/)

8 files

3,347

2.8%

Documentation (docs/*.rst)

96 files

11,452

9.4%

Markdown (repo-wide READMEs, guides)

35 files

7,028

5.8%

TOTAL

425 files

~121,500

100%

The 50 files under tutorials/ are 43 numbered tutorials - 40 scripts and 3 tutorial_00 notebooks - plus 7 parameter modules (parameters_base.py and one per dataset) that carry the constants the tutorials share.

The tutorial scripts and experiments are plain .py files run with python <script>.py; the three tutorial_00 demos are Jupyter notebooks. Experiment scripts additionally carry # %% percent-cell markers, so they can be stepped through cell-by-cell in VS Code / Cursor; tutorials are straightforward top-to-bottom scripts.

Core Module Highlights (Python Source)

Module

Lines

Purpose

process_usd.py

1,489

USD file manipulation and inspection

workflow_fit_statistical_model_to_patient.py

1,349

Model-to-patient registration workflow

process_transforms.py

1,306

ITK transform utilities, exterior motion

register_models_pca.py

1,243

PCA-based shape model registration

process_volumetric_mesh.py

1,226

Tetrahedral meshing, relaxation and repair

convert_vtk_to_usd.py

1,121

High-level VTK -> USD converter

process_usd_anatomy.py

1,108

OmniSurface materials for labeled anatomy

workflow_evaluate_movement.py

949

Per-structure scoring against acquired frames

process_images.py

923

Image I/O, resampling, preprocessing

process_surface_mesh.py

876

Surface extraction and contour manipulation

train_physicsnemo_physics_informed_motion.py

873

Physics-informed cardiac motion training

workflow_infer_movement.py

840

Predicted displacements back into geometry

vtk_to_usd/ subpackage

2,751

Low-level VTK -> USD building blocks (9 files)

cli/ subpackage

2,604

CLI entry-point scripts (11 commands, 13 files)

aorta/ subpackage

4,073

Aorta blood-flow simulation (11 files)


Project Maturity Indicators

Indicator

Status

Documentation Coverage

Sphinx site + per-package READMEs

Test Suite Present

Yes (tests/ with baselines via Git LFS)

CI/CD Pipeline

GitHub Actions (Ubuntu + Windows; Python 3.11/3.12/3.13), plus a self-hosted Windows GPU runner

Dependency Management

pyproject.toml, uv-friendly

Code Quality Tools

Ruff (lint + format), mypy

Example Scripts

66 experiment scripts + 43 tutorials (40 scripts, 3 notebooks)

Version Management

Calendar versioning via bumpver

API Reference

Google-style docstrings + Sphinx API docs under docs/api/

Package Distribution

PyPI-ready


Technical Complexity Assessment

Domain Complexity

MONAI Physio operates across several technically demanding domains:

Domain

Complexity Level

Key Technologies

Medical Imaging

Very High

ITK, MONAI, nibabel, pydicom, pynrrd

Deep Learning

High

PyTorch, CUDA 13, transformers

3D Graphics / USD

High

VTK, PyVista, OpenUSD, trimesh

Image Registration

Very High

ANTs, Greedy, Icon, UniGradICON

AI Segmentation

High

TotalSegmentator, Simpleware bridge

Geometric Processing

High

ICP, PCA, distance maps, statistical shape models

AI Surrogates

Very High

PhysicsNeMo, MeshGraphNet, torch-geometric

Architectural Sophistication

  • Class hierarchy depth: 3-4 levels (well-structured inheritance from MONAIPhysioBase)

  • Module coupling: medium (clear separation between segmentation, registration, USD conversion, and workflow layers)

  • Public API surface documented via Sphinx API docs under docs/api/

  • 28 required external dependencies (medical imaging, AI/ML, USD, registration), plus three optional extras: netgen, aorta, and dev; PyTorch, torch-scatter, and cuDSS are installed first by the user for their GPU


Dependencies & Infrastructure

Core Dependencies (selected)

Category

Key Packages

Medical Imaging

ITK, MONAI, nibabel, pydicom, pynrrd

Deep Learning

PyTorch (installed first by the user), transformers

AI Surrogates

PhysicsNeMo, torch-geometric, torch-scatter (user-installed)

Registration

ANTs (antspyx), picsl-greedy, icon-registration, UniGradICON

3D Graphics / USD

VTK, PyVista, USD-core, trimesh

AI Segmentation

TotalSegmentator

Development Tools

pytest, pytest-cov, pytest-xdist, ruff, mypy, sphinx, uv

Infrastructure Files

File

Purpose

pyproject.toml

Modern Python packaging, dependencies, tool configs

README.md

Repository highlights and quick start

LICENSE

Apache 2.0 license

CLAUDE.md

Per-repo guidance for Claude Code

AGENTS.md

Per-repo guidance for AI coding agents


Quality Metrics

Code Quality Configuration

  • Ruff - Formatting and linting (line length: 88)

  • mypy - Strict type checking (disallow_untyped_defs = true)

  • pre-commit - Hooks for ruff + mypy + fast tests on push

Testing Framework

  • pytest - Testing framework

  • pytest-cov - Coverage reporting

  • pytest-xdist - Parallel test execution

  • pytest-timeout - Per-test timeout (20 min default)

Test Categories (opt-in buckets via marker flags):

  • Unit and integration tests (fast, run by default)

  • slow - slower tests (opt-in via --run-slow)

  • requires_gpu - GPU/CUDA-dependent tests (opt-in via --run-gpu)

  • requires_simpleware - tests needing a local Synopsys Simpleware Medical install (opt-in via --run-simpleware)

  • requires_physicsnemo - tests needing PhysicsNeMo (opt-in via --run-physicsnemo)

  • tutorial - runs tutorial scripts end-to-end (opt-in via --run-tutorials; multi-hour)


Documentation Statistics

Type

Count

Lines

Markdown files

35 (repo-wide READMEs, guides)

7,028

reStructuredText

96 files under docs/

11,452

Python docstrings

All public modules

embedded

Knowledge graph

graphify-out/, refreshed via graphify update .

n/a (not checked in)

Documentation Highlights

  • Sphinx site (published to GitHub Pages) covering getting started, tutorials, CLI & scripts, API reference, developer guides, contributing, testing, FAQ, and troubleshooting

  • Per-subpackage READMEs and CLAUDE.md files (e.g. src/monai_physio/vtk_to_usd/CLAUDE.md)

  • AGENTS.md and CLAUDE.md guidance for AI coding agents; contributors keep their own agent and skill definitions outside the checkout


Summary

MONAI Physio is a beta-quality scientific toolkit for creating personalized physiological digital twins: it extracts anatomic models from 3D/4D medical images and uses AI surrogates - together with statistical shape models for subject-specific characterization and cross-subject correspondence - to estimate a subject’s physiological processes, currently cardiac and respiratory motion. It is built on top of established medical imaging, AI/ML, and 3D graphics libraries with a small, focused public API and a plain-Python-script example/tutorial layout that runs both interactively and unattended.


Last Updated: December 4, 2026