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 |
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 ( |
104 files |
44,394 |
36.5% |
Test Suite ( |
66 files |
24,660 |
20.3% |
Experiment Scripts ( |
66 files |
13,914 |
11.4% |
Tutorials ( |
50 files |
16,750 |
13.8% |
Utility Scripts ( |
8 files |
3,347 |
2.8% |
Documentation ( |
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 |
|---|---|---|
|
1,489 |
USD file manipulation and inspection |
|
1,349 |
Model-to-patient registration workflow |
|
1,306 |
ITK transform utilities, exterior motion |
|
1,243 |
PCA-based shape model registration |
|
1,226 |
Tetrahedral meshing, relaxation and repair |
|
1,121 |
High-level VTK -> USD converter |
|
1,108 |
OmniSurface materials for labeled anatomy |
|
949 |
Per-structure scoring against acquired frames |
|
923 |
Image I/O, resampling, preprocessing |
|
876 |
Surface extraction and contour manipulation |
|
873 |
Physics-informed cardiac motion training |
|
840 |
Predicted displacements back into geometry |
|
2,751 |
Low-level VTK -> USD building blocks (9 files) |
|
2,604 |
CLI entry-point scripts (11 commands, 13 files) |
|
4,073 |
Aorta blood-flow simulation (11 files) |
Project Maturity Indicators
Indicator |
Status |
|---|---|
Documentation Coverage |
Sphinx site + per-package READMEs |
Test Suite Present |
Yes ( |
CI/CD Pipeline |
GitHub Actions (Ubuntu + Windows; Python 3.11/3.12/3.13), plus a self-hosted Windows GPU runner |
Dependency Management |
|
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 |
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, anddev; 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 |
|---|---|
|
Modern Python packaging, dependencies, tool configs |
|
Repository highlights and quick start |
|
Apache 2.0 license |
|
Per-repo guidance for Claude Code |
|
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 |
11,452 |
Python docstrings |
All public modules |
embedded |
Knowledge graph |
|
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.mdfiles (e.g.src/monai_physio/vtk_to_usd/CLAUDE.md)AGENTS.mdandCLAUDE.mdguidance 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