brachyutils
BrachyUtils
BrachyUtils is developed to be a scripting treatment planning system for brachytherapy. The current state mostly focuses on high dose rate (HDR) brachytherapy. For full documentation, take a look at our docs webpage. The main modules and submodules are described below:
geometryphantom_utils: Handles geometry definition (Patient, segmentations or measurement setup). IO for DICOM, NRRD, and Nifti (read only). The main class here isBrachyPhantom.egsphant_utils: Handles manipulation of the data in the EGSPhant format from the EGSnrc. This class can create aBrachyEgsphantfromBrachyPhantomor load it from.egsphantor.seq.nrrdfiles.catheter_utils: Implements theCatheterTable, which provides DICOM and JSON IO for HDR treatment plans. TheCatheterTablenumerous functionalities for adding and removing catheters and dwells and storing the dose rates and the totoal dose of the treatment plan.registration_utils: Provides the ability to perform image-based and contour-based registration usingreg_opentps,reg_plastimatch, andreg_simple_elastix. All these modules makes use of the abstract class and the functionality provided inreg_utils.
dosedose_utils: Provides IO for dose and uncertainty data from DICOM, 3ddose and NRRD intoBrachyDose. Several functinality exists for cropping and resampling dose maps exists.dose_generation_utils: Several classes exist here that allow for generating dose from a treatment plan. The main abstract class isBrachyDoseGenerator, and currently the concrete classes are:RapidBrachyTG43,RapidBrachyMC, andBrachyUtilsTG43.dose_comparison_utils: Allows for comparison between twoBrachyDoseobjects based on percent error maps (according to AAPM-WGDCAB Report 372) and Gamma index analysis. The main class isBrachyDoseComparisonfilm_utils: The class that allows for processing radiochromic film data. It has two subclasses,CalibrationCurveandFilmCalibration.
planning:plan_utils: This module implementsBrachyPlanwhich makes use of all the previous modules to handle treatment planning operations in brachytherapy. We recommend getting started using theload_dicom_to_planfunction.simulation_utils: The class to store information regarding the source in brachytherapy (IO from json and dicom) as well as simulation parameters such as the number of threads to use and the number of histories to be simulated. The two main classes here areBrachySimulationandBrachySource.structure_utils: This module containsBrachyStructure, which in additon to the structure mask, contain information regarding the associated DVH metrics for each structure and the optimization config.optimization: An extensive module that handles dwell time optimization using Gurobi (optim_gurobi), AMPL (optim_ampl) and ORTools (optim_ortools). All of these contain concrete classes that extend the abstract classBrachyDwellTimeOptimand use several functionalities provided inoptim_utils.mobomodule handles multi objective optimization of the penalty weights and theoptim_cathmodule builds towards catheter placement optimization.
1""" 2# BrachyUtils 3 4 5 6BrachyUtils is developed to be a scripting treatment planning system for brachytherapy. The current state mostly focuses on high dose rate (HDR) brachytherapy. For full documentation, take a look at our [docs webpage](https://engerlab.github.io/brachyutils/brachyutils.html). The main modules and submodules are described below: 7 81. `geometry` 9 1. `phantom_utils`: Handles geometry definition (Patient, segmentations or measurement setup). IO for DICOM, NRRD, and Nifti (read only). The main class here is `BrachyPhantom`. 10 2. `egsphant_utils`: Handles manipulation of the data in the EGSPhant format from the EGSnrc. This class can create a `BrachyEgsphant` from `BrachyPhantom` or load it from `.egsphant` or `.seq.nrrd` files. 11 3. `catheter_utils`: Implements the `CatheterTable`, which provides DICOM and JSON IO for HDR treatment plans. The `CatheterTable` numerous functionalities for adding and removing catheters and dwells and storing the dose rates and the totoal dose of the treatment plan. 12 4. `registration_utils`: Provides the ability to perform image-based and contour-based registration using `reg_opentps`, `reg_plastimatch`, and `reg_simple_elastix`. All these modules makes use of the abstract class and the functionality provided in `reg_utils`. 132. `dose` 14 1. `dose_utils`: Provides IO for dose and uncertainty data from DICOM, 3ddose and NRRD into `BrachyDose`. Several functinality exists for cropping and resampling dose maps exists. 15 2. `dose_generation_utils`: Several classes exist here that allow for generating dose from a treatment plan. The main abstract class is `BrachyDoseGenerator`, and currently the concrete classes are: `RapidBrachyTG43`, `RapidBrachyMC`, and `BrachyUtilsTG43`. 16 3. `dose_comparison_utils`: Allows for comparison between two `BrachyDose` objects based on percent error maps (according to AAPM-WGDCAB Report 372) and Gamma index analysis. The main class is `BrachyDoseComparison` 17 4. `film_utils`: The class that allows for processing radiochromic film data. It has two subclasses, `CalibrationCurve` and `FilmCalibration`. 183. `planning`: 19 1. `plan_utils`: This module implements `BrachyPlan` which makes use of all the previous modules to handle treatment planning operations in brachytherapy. We recommend getting started using the `load_dicom_to_plan` function. 20 2. `simulation_utils`: The class to store information regarding the source in brachytherapy (IO from json and dicom) as well as simulation parameters such as the number of threads to use and the number of histories to be simulated. The two main classes here are `BrachySimulation` and `BrachySource`. 21 3. `structure_utils`: This module contains `BrachyStructure`, which in additon to the structure mask, contain information regarding the associated DVH metrics for each structure and the optimization config. 22 4. `optimization`: An extensive module that handles dwell time optimization using Gurobi (`optim_gurobi`), AMPL (`optim_ampl`) and ORTools (`optim_ortools`). All of these contain concrete classes that extend the abstract class `BrachyDwellTimeOptim` and use several functionalities provided in `optim_utils`. `mobo` module handles multi objective optimization of the penalty weights and the `optim_cath` module builds towards catheter placement optimization. 23 24""" 25 26__all__ = [ 27 "dose", 28 "geometry", 29 "planning", 30] 31# trunk-ignore(ruff/F401) 32from .dose import * 33# trunk-ignore(ruff/F401) 34from .geometry import * 35# trunk-ignore(ruff/F401) 36from .planning import * 37 38from .planning.optimization import * # noqa: F401, F403 39 40from .geometry.registration_utils import * # noqa: F401, F403 41 42from .geometry.catheter_utils import * # noqa: F401, F403