Skip to content

Releases: e0404/pyRadPlan

v0.4.1

15 Jun 23:53

Choose a tag to compare

Patch Release

  • multiple corresponding units for given quantities in the GUI
  • missing keys in init_beam not being skipped
  • hotfix for deprecated numpy.matrix in to_namespace()

Added

  • multiple corresponding units for given quantities in the GUI

Fixed

  • missing keys in init_beam not being skipped
  • hotfix for deprecated numpy.matrix in to_namespace()

v0.4.0

17 May 13:35

Choose a tag to compare

Major preliminary release adding AI-assisted planning, GPU acceleration, biological dose calculation, a TOPAS Monte Carlo interface, and an interactive result viewer.

  • AI-powered beam angle and VOI objective suggestions (pydantic-ai)
  • Full Array API GPU support (CuPy, PyTorch, JAX) with native CUDA kernels
  • Biological RBE calculation and biologically based optimization
  • TOPAS MC interface for protons/ions (physical & LET scoring)
  • Interactive dose viewer widget with DVH, QI panel, and VOI overlays (PySide6)
  • GUI dependency updated from PyQt5 to PySide6 + pyqtgraph

Added

  • module: LLM-powered treatment planning helpers built on
  • — queries an LLM to suggest gantry and couch angles for a given treatment site and radiation mode, and writes them into
  • — queries an LLM to propose optimization objectives for each VOI in a and attaches validated objective instances directly to the VOIs
  • — pydantic-settings class for global configuration; reads the default model from the environment variable (default: ); any provider supported by pydantic-ai can be selected via the model string
  • New example demonstrating an end-to-end proton prostate plan with AI-generated beam angles and objectives
  • AGENTS.md and CLAUDE.md for AI-assisted development
  • GPU-accelerated dose calculation via Array API using CuPy and PyTorch backends (alongside NumPy/), including memory management, streaming, and per-beam cleanup
  • helper to convert arrays (and scipy sparse matrices) between Array API namespaces, with explicit and options
  • to select a sensible default device for a given namespace, with multi-GPU index support ( / )
  • DLPack-based device handling (, , / constants) for seamless backend interop
  • GPU lifecycle helpers: , , , , ,
  • / helpers with device targeting
  • Backend availability checks and a preferred-backend wishlist (, , , , , )
  • Native CUDA kernel implementation for geometric distance calculation: (CuPy ), (CuPy ), and , replacing the previous Numba CUDA path
  • Array API conform N-D interpolation on rectilinear grids (generic 2D/3D fallback, with dedicated paths for NumPy/SciPy, JAX, and CuPy)
  • Improved : fast paths using for NumPy/JAX/CuPy, JAX and PyTorch backends (with fallback if Triton is not installed), support for lists/tuples/dicts of arrays with optional stacking
  • Array API compatibility for beam initialization and ray geometry computation (, )
  • More efficient sparse matrix conversion using direct CSR/CSC construction, avoiding unnecessary deep copies
  • Kernel-data caching and to move kernel arrays onto the active backend/device
  • Device propagation through fluence optimization (, , scipy solver, )
  • New example demonstrating how to query backends and run dose calculation on different array backends
  • Benchmarks and for interpolation across backends
  • quantity resolver that checks for presence of quantities and instantiates the required ones
  • biological RBE calculation from alpha and beta kernels
  • biological based optimization
  • alpha and beta parameters to dij with function to get them for a given ct and cst
  • quantity resolver that checks for presence of quantities and instantiates the required ones
  • a TOPAS monte carlo interface. Implemented are protons and ions with basic physical and let based scoring. Material conversions are water and a pre defined schneider converter. The interface is structure into input files so that different beam models or scorers can be added easily. The interface also as template files that are used to create the simulation files. Which also give a nice overwiev on the structure of the simulation files.
  • jinja2 as project dependency
  • Documentation: extended user guide
  • Documentation: extended installation instructions
  • First implementation of an interactive result viewer widget ( extra) for visualizing dose/quantity distributions slice-by-slice with scroll/zoom, VOI contour overlay, isoline rendering, and colormap selection
  • DVH viewer and DVH comparison tools in the GUI analysis widget
  • Quality indicator (QI) panel in the GUI analysis widget
  • and fields on for storing per-structure display properties
  • palette (per VOI type: TARGET, OAR, EXTERNAL, HELPER) exported from
  • method that auto-assigns colors from the predefined palette, skipping colors already in use, preserving any explicitly set
  • field validator on accepting named color strings, float 0–1 arrays, and int 0–255 tuples

Changed

  • Pencil beam dose calculation now applies the lateral cutoff mask before computation rather than after, and keeps Dij assembly on the CPU (size limited) while the rest of the calculation runs on GPU
  • Per-beam dose/LET/effect computation in now slices intensities by beam (faster matmul) instead of multiplying by a beam mask, and is fully Array API namespace aware
  • Siddon raytracer now picks up the engine's device and allocates plane/coordinate arrays directly on that device
  • SVD photon pencil beam engine refactored to use Array API arrays for ray-position aggregation and kernel weighting (still calls SciPy interpolators on host arrays)
  • resampling in BLD now uses interpolation to return mask on the grid provided by the dose engine
  • in SVDPB field_grid is now built before the resampling of the beamlet mask to guarantee matching grids
  • in now uses instead of a colormap cycle, so contour colors are consistent with the GUI viewer
  • GUI optional dependency changed from to and
  • Proton pencil-beam example updated to use the new dose viewer widget

Fixed

  • now falls back to linear interpolation when BSpline is requested but the image has fewer than 4 voxels in any dimension, preventing intermittent NaN values from the BSpline prefilter on small grids
  • CuPy issue in LPS coordinate handling (gantry/couch rotation matrices now built via with the correct device/dtype)
  • SVD pencil beam engine updated to match changes in the base pencil beam engine
  • Device handling and type checks in optimization solvers (IPOPT and SciPy) so the optimization runs on the same device as the quantities
  • Preliminary workaround for CUDA / cuBLAS DLL conflicts when PyTorch and CuPy are imported in the same environment
  • now skips NumPy/ namespaces silently
  • handles non-list array inputs via so non-NumPy arrays validate correctly on import
  • raises for scalar / list / tuple inputs instead of failing on the sparse-array check
  • now calls during validation so every VOI always has a color assigned
  • property .size raising an error in dij.py when torch is used. Switching to array_api_compat.size()

v0.3.5

12 May 14:53

Choose a tag to compare

Minor Patch to

  • correct leaf-edge cases in shape transition matrix for photon forward dose calculation
  • fix a temporary files retention bug in the FRED MC interface

Changed

  • transmission mask in beam limiting devices now uses edge smoothing to account for finite grid size

Fixed

  • Bugfix in FRED MC engine, where temporary files were not deleted

v0.3.4

05 May 15:47

Choose a tag to compare

Patch Release to sanitize some dose calculation behavoir:

  • Storage of multiple Dij's streamlined to reduce memory consumption
  • plot_slice function has a few additional parameters and sanitized slice titles
  • resample_image now explicitly states extrapolation behavior
  • streamlined kernel normalization within photon SVDPB engine
  • CI quality of life changes

Added

  • dose engines now have private flags and to guarantee sparse dij structure before finalization
  • Issue and Pull/Merge Request templates
  • default pre-commit hooks for line endings, case conflicts, merge conflicts, etc. Also added codespell, CITATION.cff verifyer and toml check
  • and now accept a generic (CT, dict, or ) instead of only a via the argument
  • gained and ( or ) options for grayscale windowing, replacing the previous
  • in now also accepts a
  • Jennifer Josephine Hardt added as author (CITATION.cff and pyproject.toml)
  • Added an option to to choose the extrapolator. Default is to use a nearest neighbor extrapolator, but individual values can beprovided as well.

Changed

  • New version of photons_Generic.mat basedata file can now be provided, allowing a version field alongside meta and data files within the machine struct. Version 2 requires correct kernel normalization (without implying a spacing in the convolution integral). photons_Generic.mat has been updated to version 2 with correct kernel normalization.
  • Photon dose calculation now does not rely on hardcoded convolution resolution integral normalization of machine kernels. Assumes that old kernels use hardcoded factor of 4 for 0.5 mm resolution (1/0.5^2).
  • Sparse structure now uses one shared index structure across dijs if possible
  • internally refactored into modular helpers (input validation, axis resolution, image/contour/overlay drawing, scale bar, finalization) for readability and reuse
  • Slice titles now follow the format (or when no image volume is provided)
  • / parameter renamed to and renamed to

Deprecated

  • and arguments to / still work as aliases for and but emit a

Fixed

  • CI Release Workflow now tests correctly on release commits without an [Unreleased] section in the Changelog.
  • CI Release Workflow now fetches tags correctly and supplies the correct release body from the tag message

v0.3.3

14 Apr 22:15

Choose a tag to compare

Hotfix to a raytracer bug that created NaN's in individual rays in certain geometries when calculating the radiological depth cube.


Added

  • Automatic Release workflow on GitHub reading CHANGELOG.md and tag message
  • Benchmark Folder with inital Raytracer benchmark that can be run with pytest-benchmark

Changed

  • Changelog now follows thee Keep A Changelog conventions

Fixed

  • Fixed raytracer issue where certain geometrical configurations could lead to individual rays starting with invalid indices, inserting misplaced NaN's into the radiological depth cube.

Patch 0.3.2

09 Apr 22:15

Choose a tag to compare

Patch 0.3.2

Small patch release with a new optimization objective, a structure for Beam Limiting Devices for Field/Shape-based dose calculation, and several bug fixes, and a CITATION.cff.

New Features

  • Mimicking objective for dose-mimicking optimization (SquaredMimicking)
  • includes prototype for field-based dose calculation using Beam Limiting Device & FieldShape hierarchy
  • Added CITATION.cff with authors and ORCIDs

Bug Fixes

  • Raytracer candidate matrix now uses lateral cutoff by default (overridable)
  • Fixed binary mask interpolation in VOI
  • Fixed import of empty voxel index lists from matRad
  • Fixed crash when optimization problem has no objectives
  • Fixed export of None values and type check in dij/grids
  • Fixed missing x-divergence of ray in FRED MC engine
  • Fixed single-field STF generator to properly inherit from IMRT generator

Notes

This patch release was used for the baseline examples in DoseRad2026: https://github.com/DoseRad2026/pyradplan-pb-baseline

Pre-Release 0.3.0

12 Jan 15:12

Choose a tag to compare

Pre-Release 0.3.0

This update features Array API compatibility, a FRED interface, VHEE model, documentation, examples in jupytext style, some refactoring and bugfixes.
We further are removing python 3.9 support due to array api compatibility.

New Features

  • Partly integrated Array API compatibility. Coming with GPU support for Cupy and Torch. Note: Python 3.9 support has been removed.
  • FRED interface (Monte Carlo tool)
  • VHEE planning with a Generic (unfocused) beam and a focused beam.
  • dij.compute_result_ct_grid() now returns quantities per beam too.
  • create_body_segmentation() method for the CST object
  • Option to cancel solver at any iteration via keyboard input

Bug Fixes & Performance

  • Increased memory efficiency in dose calc
  • Fixed overlap priorities when similar levels exist
  • Fixed np.floating deprecation
  • Fixed pydantic>=2.11 compatibility
  • Fixed issues with single bixel calculations in Raytracer
  • Elevated minimum required version of numpydantic
  • Tuning of initial Scipy parameters

Full Changelog: v0.2.8...v0.3.0

Patch Release 0.2.8

07 Aug 02:45

Choose a tag to compare

This patch release incorporates performance improvements, plan analysis in form of DVHs, and some data validation fixes.

It corresponds to the version used in the SynthRad2025 challenge, see also https://github.com/SynthRad2025

Patch Notes:

  • DVHCollection and DVH for plan analysis
  • Ray Tracer recovery in case of numerical issues
  • CT validates given x/y/z vectors correctly
  • Fix for validating VOIs with single voxels from matRad
  • performance improvements for raytracer and dij filling
  • maps to associate bixel/beamlet indices with beams / rays in stf

Full Changelog: v0.2.3...v0.2.8

Patch Release v0.2.3

09 May 13:04

Choose a tag to compare

Changes:

  • add slice visualization function
  • add LET for protons
  • fixes issues with ray validation
  • scenarios are now pydantic models
  • performance fix for raytracer
  • various validation fixes
  • docstring / code quality improvements

Full Changelog: v0.2.2...v0.2.3

v0.2.2

11 Mar 14:58

Choose a tag to compare

First official pre-release of pyRadPlan

pyRadPlan is an open-source radiotherapy treatment planning toolkit designed for interoperability with matRad.

Main Features

  • matRad compatible data structures with stable validation and serialization with pydantic
  • native reimplementation of matRad's pencil beam dose calculation for photons, protons & ions
  • generic machine data
  • native optimization framework using scipy or IPOPT (via ipyopt)

Disclaimers & License

pyRadPlan is still a work in progress, thus we decided to not assign a major version number yet. Everything is still subject to change, so handle with care.

DO NOT USE MATRAD CLINICALLY - Check the LICENSE file and README.md for more infos.

Full History since initial commit: v0.0.1...v0.2.2