pyanno4rt: Python-based Advanced Numerical Nonlinear Optimization for Radiotherapy

pyanno4rt is a Python package for conventional and outcome prediction model-based inverse photon and proton treatment plan optimization, including radiobiological and machine learning (ML) models for tumor control probability (TCP) and normal tissue complication probability (NTCP). It leverages state-of-the-art local and global solution methods to handle both single- and multi-objective (un)constrained optimization problems, thereby covering a number of different problem designs. To summarize roughly, the following functionality is provided:

Import of patient data and dose information from different sources

  • DICOM files (.dcm)
  • MATLAB files (.mat)
  • Python files (.npy, .p)

Individual configuration and management of treatment plan instances

  • Dictionary-based plan generation
  • Dedicated logging channels and singleton datahubs
  • Automatic input checks to preserve the integrity
  • Snapshot/copycat functionality for storage and retrieval

Fluence vector initialization strategies

  • Data medoid initialization
  • Tumor coverage initialization
  • Warm start initialization

Multi-objective treatment plan optimization

  • Dose-volume and outcome prediction model-based optimization functions (18 objectives + 6 constraints)
  • Dose-fluence projections (dose + constant RBE)
  • Optimization methods (lexicographic, weighted-sum, Pareto)
  • Local and global solvers (interior-point/proximal/multi-objective/population-based/local)
  • Data-driven outcome prediction model handling

    • Dataset import and preprocessing
    • Automatic feature map generation
    • 27-type feature catalog for iterative (re)calculation to support model integration into optimization
    • 8 highly customizable internal model classes (individual preprocessing/inspection/evaluation units, SMBO hyperparameter tuning, OOF prediction)
    • External model loading via user-definable model folder paths
    • Evaluation tools

      • Cumulative and differential dose volume histograms (DVH)
      • Dose statistics and clinical quality measures

      Graphical user interface

      • Responsive PyQt5 design with easy-to-use and clear surface
      • Extendable visualization suite using Matplotlib and PyQt5

    This package integrates external local and global solvers to perform the optimization, where the L-BFGS-B algorithm from SciPy acts as default and fallback if IPOPT is not available to import. You will find comprehensive instructions on how to (optionally) install and configure IPOPT for Linux in the corresponding folder.