Metadata-Version: 2.4
Name: physiotwin4d
Version: 2026.7.2
Summary: Methods, workflows, tutorials, and CLI for creating personalized physiological digital twins from 3D medical images
Author-email: "Stephen R. Aylward" <saylward@nvidia.com>
Maintainer-email: "Stephen R. Aylward" <saylward@nvidia.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/Project-MONAI/physiotwin4d
Project-URL: Documentation, https://project-monai.github.io/physiotwin4d/
Project-URL: Repository, https://github.com/Project-MONAI/physiotwin4d.git
Project-URL: Bug Tracker, https://github.com/Project-MONAI/physiotwin4d/issues
Project-URL: Author LinkedIn, https://www.linkedin.com/in/stephenaylward
Project-URL: Author Google Scholar, https://scholar.google.com/citations?user=u1UdL4oAAAAJ&hl
Keywords: medical-imaging,4d-ct,cardiac-imaging,lung-imaging,omniverse,usd,monai,segmentation,registration,deformable-registration,image-registration,model-registration,visualization,ai,deep-learning,totalsegmentator,ICON,ANTS,physiological-motion,4d-visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: itk<6.0.0,>=5.3.0
Requires-Dist: nibabel>=4.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pydicom>=2.4.0
Requires-Dist: pynrrd>=1.0.0
Requires-Dist: vtk>=9.2.0
Requires-Dist: monai>=1.3.0
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.21.0
Requires-Dist: totalsegmentator>=2.0.0
Requires-Dist: antspyx>=0.4.0
Requires-Dist: icon-registration>=1.0.0
Requires-Dist: picsl-greedy>=0.0.12
Requires-Dist: scipy>=1.10.0
Requires-Dist: unigradicon>=1.0.0
Requires-Dist: pyvista[all]>=0.47.0
Requires-Dist: usd-core>=23.11
Requires-Dist: trimesh>=4.0.0
Requires-Dist: netgen-mesher>=6.2.2606
Requires-Dist: ipykernel>=6.0.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: typing-extensions>=4.0.0
Provides-Extra: cuda13
Requires-Dist: cupy-cuda13x>=13.6.0; extra == "cuda13"
Requires-Dist: torch>=2.0.0; extra == "cuda13"
Requires-Dist: torchvision; extra == "cuda13"
Requires-Dist: torchaudio; extra == "cuda13"
Provides-Extra: physicsnemo
Requires-Dist: nvidia-physicsnemo>=2.0.0; extra == "physicsnemo"
Provides-Extra: dev
Requires-Dist: bumpver>=2023.0.0; extra == "dev"
Requires-Dist: jupytext>=1.16.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: mypy>=2.1.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: scipy-stubs<1.16.0.0,>=1.14.0.0; extra == "dev"
Requires-Dist: types-requests>=2.32.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=8.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=3.0.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=3.0.0; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
Requires-Dist: sphinx-tabs>=3.4.7; extra == "docs"
Requires-Dist: myst-parser>=4.0.0; extra == "docs"
Requires-Dist: docutils<0.22; extra == "docs"
Requires-Dist: linkify-it-py>=2.0.0; extra == "docs"
Requires-Dist: uc-micro-py>=1.0.1; extra == "docs"
Requires-Dist: markdown-it-py>=3.0.0; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-xdist>=3.0.0; extra == "test"
Requires-Dist: pytest-timeout>=2.0.0; extra == "test"
Requires-Dist: coverage[toml]>=7.0.0; extra == "test"
Dynamic: license-file

# PhysioTwin4D

**A collection of methods, workflows, tutorials, and CLI tools for creating personalized physiological digital twins.**

PhysioTwin4D typically begins with a 3D medical image of a subject, extracts anatomic models from that image, and then uses AI surrogates to estimate the subject's physiological processes — initially focusing on cardiac and respiratory motion, and expanding to electrophysiology, blood flow, and organ perfusion. The package provides methods for forming these physiological AI surrogates and for fine-tuning the segmentation and registration AI methods that power them, with special emphasis on statistical shape models: they capture subject-specific characteristics that help determine subject-specific physiological function, and establish correspondence across subjects to aid AI surrogate generalization and simplify the application of traditional solvers.

> **Not validated for clinical use.** PhysioTwin4D is a research toolkit. It
> is not a medical device and must not be used for diagnosis, treatment
> planning, or clinical decision-making.

## Documentation

**https://project-monai.github.io/physiotwin4d/** is the primary entry point
for users and contributors. Key sections:

- [Installation](https://project-monai.github.io/physiotwin4d/installation.html) and [Quickstart](https://project-monai.github.io/physiotwin4d/quickstart.html)
- [Tutorials](https://project-monai.github.io/physiotwin4d/tutorials.html) — runnable end-to-end workflows and their datasets
- [CLI & Scripts Guide](https://project-monai.github.io/physiotwin4d/cli_scripts/overview.html) — command-line tools for conversion, segmentation, registration, and USD workflows
- [API Reference](https://project-monai.github.io/physiotwin4d/api/index.html) — workflow, registration, segmentation, and USD classes
- [Developer Guides](https://project-monai.github.io/physiotwin4d/developer/architecture.html) — architecture, extension points, and implementation conventions
- [Contributing](https://project-monai.github.io/physiotwin4d/contributing.html) and [Testing](https://project-monai.github.io/physiotwin4d/testing.html)
- [FAQ](https://project-monai.github.io/physiotwin4d/faq.html) and [Troubleshooting](https://project-monai.github.io/physiotwin4d/troubleshooting.html)

## Highlights

- **Personalized digital twins**: build subject-specific anatomic models and physiological AI surrogates from 3D/4D medical images
- **Statistical shape models**: capture subject-specific anatomy and establish cross-subject correspondence, aiding AI surrogate generalization and simplifying traditional solver setup
- **Simplified workflows on industry-leading open-source tools**: ICON and Greedy for registration; MONAI with TotalSegmentator and Simpleware for segmentation; Netgen for meshing (LGPL license); scikit-learn for statistical shape modeling; ITK for image processing; PyVista and OpenUSD/Omniverse for geometry manipulation; CuPy for accelerated computing; and PhysicsNeMo for AI surrogates
- **Extensible class hierarchy**: add new segmentation and registration methods, and extend to new data types, organs, and physiological processes, without reworking the workflow layer
- **Physiological motion**: cardiac and respiratory motion today, expanding to electrophysiology, blood flow, and organ perfusion
- **NVIDIA Omniverse as the simulation hub**: the end goal for simulation — a simulation-information hub and gateway to other engines (e.g., Ansys solvers), interactive simulations for treatment planning (e.g., Isaac Sim, Newton), visualization systems (e.g., AR/VR devices), and physical systems (e.g., robots via ROS)
- **CLI and Python API**: installed command-line tools and workflow classes for repeatable, scriptable pipelines

## Installation

```bash
# CPU-only — works out of the box; a runtime warning points to the GPU extra
pip install physiotwin4d

# CUDA 13 (recommended for production)
uv pip install "physiotwin4d[cuda13]"
```

See the [installation guide](https://project-monai.github.io/physiotwin4d/installation.html) for GPU setup, source installs, and optional extras (PhysicsNeMo).

## Quick Start

```bash
physiotwin4d-convert-image-to-usd cardiac_4d.nrrd --contrast --output-dir ./results
```

```python
from physiotwin4d import RegisterImagesICON, WorkflowConvertImageToUSD

processor = WorkflowConvertImageToUSD(
    input_filenames=["path/to/cardiac_4d_ct.nrrd"],
    output_directory="./results",
    project_name="cardiac_model",
    registration_method=RegisterImagesICON(),  # or RegisterImagesGreedy()
)
final_usd = processor.process()
```

See the [quickstart](https://project-monai.github.io/physiotwin4d/quickstart.html) and [tutorials](https://project-monai.github.io/physiotwin4d/tutorials.html) for full walkthroughs covering segmentation, registration, statistical shape modeling, and USD export.

## Contributing

See the [contributing guide](https://project-monai.github.io/physiotwin4d/contributing.html) for code style, testing, IDE setup, and pull request conventions.

## License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Note that some optional dependencies carry their own license terms: meshing
via Netgen is LGPL-licensed, and NVIDIA Omniverse is distributed under its
own customer license, which is free for academic and commercial use. To our
knowledge, none of the dependencies carry commercially prohibitive licenses
such as GPL, but no guarantees are provided — review the license of each
dependency for your own use case.
