A community effort to develop an open standard library for Medical Physics in Python. We build high quality, transparent software together via peer review and open source distribution. Open code is better science.
PyMedPhys is an open-source Medical Physics Python library built by an open community that values code sharing, review, improvement, and learning from each other. It is inspired by the collaborative work of our physics peers in astronomy and the Astropy Project. PyMedPhys is available on PyPI and GitHub.
PyMedPhys supports three main ways of working:
- a Python library for notebooks, scripts, and clinic-specific tooling
- a command line interface (CLI) for repeatable automation
- a point-and-click app layer for selected workflows
PyMedPhys is currently within the beta stage of its life-cycle. It will
stay in this stage until the version number leaves 0.x.x and enters
1.x.x. While PyMedPhys is in beta stage, no API is guaranteed to be
stable from one release to the next. Upgrading pymedphys can therefore
break existing scripts or workflows. We try to stay ahead of that by
documenting breaking changes in the Release Notes.
If you are new to PyMedPhys, start with these four questions in order:
PyMedPhys is often used to:
- compare dose or fluence-like data with gamma, interpolation, and MetersetMap
- work with DICOM and pseudonymisation workflows
- work with delivery, logfile, and iCom data
- query or integrate with Mosaiq
- use point-and-click apps for selected workflows
PyMedPhys currently supports Python 3.12, 3.13, and 3.14.
For most users, we recommend using uv to create an environment and install
PyMedPhys:
uv python install 3.12
uv venv --python 3.12
uv pip install "pymedphys[user]"If you cannot use uv on your workstation, the Quick Start Guide also
includes a standard Python + venv + pip fallback path.
Use the Python library when you want notebooks, analysis, plots, and clinic-specific workflows.
Use the CLI when you want repeatable commands, scheduled jobs, or shell automation.
Use the app layer when you want the least coding and a graphical workflow.
For a fuller comparison, read Choose your path.
The PyMedPhys documentation has two overarching guides:
- The Users Guide: where you can get started with the library, the CLI, and the app layer; read task-focused how-to guides; find background information on larger projects and concepts; and browse the Technical Reference when you already know the feature you need.
- The Contributors Guide: for those who want to contribute to PyMedPhys. This includes the Contributors Guide landing page, detailed workstation setup guides, important repository information, and some tips & tricks for common problems.
PyMedPhys has a GitHub Discussions page to help users find their feet and to support collaboration and general discussion.
PyMedPhys' first paper in the Journal of Open Source Software contains more background information, including the Statement of Need. You can access the paper here.
When referencing PyMedPhys, please cite this paper as follows:
Biggs, S., Jennings, M., Swerdloff, S., Chlap, P., Lane, D., Rembish, J., McAloney, J., King, P., Ayala, R., Guan, F., Lambri, N., Crewson, C., Sobolewski, M. (2022). PyMedPhys: A community effort to develop an open, Python-based standard library for medical physics applications. Journal of Open Source Software, 7(78), 4555, https://doi.org/10.21105/joss.04555
PyMedPhys uses uv for package and project management and Hatchling to build distributions. See the Contributors Guide for the complete setup and PR workflow.
After cloning the repository, install the PyMedPhys dependencies and set up pre-commit by running:
uv sync --python 3.14 --locked uv run -- pre-commit install
Run automated tests with:
uv run -- pymedphys dev tests
PyMedPhys is built and supported by its maintainers and contributors, past and present.
- Simon Biggs (founder)
- Phillip Chlap
- Radformation Inc., USA
- University of New South Wales, Australia
- Stuart Swerdloff
- SJS Targeted Solutions, LLP, New Zealand
Recent contributions include code, review, testing, documentation, and user support.
- Derek Lane (DLaneAtElekta)
- ELEKTA AB, Houston TX
- Rafael Ayala (QuickCheck tools and tests)
- Cedric Belanger (RT Dose pixel spacing)
- David Buckle (plan complexity tools)
- Matthew Cooper (auto-contouring)
- Marcus Fisk (Streamlit and iCOM)
- Cancer Care Riverina, Australia
- Fada Guan (gamma examples)
- Marcelo Jordao (TRF decoding)
- ELEKTA AB, Hong Kong SAR
- Paul King (sinograms and profiles)
- Nicola Lambri (gamma tutorials and development tooling)
- IRCCS Humanitas Research Hospital, Italy
- Humanitas University, Italy
- Pedro Martinez (linac QA tools for graticules, jaws, and light and radiation field alignment, plus Oncentra brachytherapy utilities)
- Jacob McAloney (film comparison)
- mfizyczka (TRF test data and format investigation)
- Jake Rembish (plan transfer, weekly chart checks, plan scoring, and the JOSS paper)
- Matthew Sobolewski (early Winston–Lutz development)
- Milo Vermeulen (package path handling)
- Philip Yarra (Pinnacle export)
See the GitHub contributor history for more contributors.
PyMedPhys includes third-party code and data under their own licences, whose files the package lists in its metadata.
PyMedPhys's DICOM de-identification includes tables generated from the DICOM Standard, edition 2026d, and rule files that name its attributes and codes:
- DICOM PS3.3 2026d, © NEMA
- DICOM PS3.4 2026d, © NEMA
- DICOM PS3.6 2026d, © NEMA
- DICOM PS3.15 2026d, © NEMA
- DICOM PS3.16 2026d, © NEMA
The National Electrical Manufacturers Association (NEMA) publishes the DICOM Standard at https://www.dicomstandard.org/. The tables were extracted automatically from the published DICOM Standard and may contain errors. The published Standard is authoritative. PyMedPhys regenerates the tables for each new edition of the DICOM Standard.
DICOM® is the registered trademark of the National Electrical Manufacturers Association (NEMA) for its standards publications relating to digital communications of medical information. NEMA does not endorse, sponsor, or certify PyMedPhys.
Some of PyMedPhys's data tables include LOINC codes, which carry this notice:
This material contains content from LOINC (http://loinc.org). LOINC is copyright © Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes (LOINC) Committee and is available at no cost under the license at http://loinc.org/license. LOINC® is a registered United States trademark of Regenstrief Institute, Inc.


