RTP.DoseVolumeConstraintsEvaluation 1.0.1

dotnet add package RTP.DoseVolumeConstraintsEvaluation --version 1.0.1
                    
NuGet\Install-Package RTP.DoseVolumeConstraintsEvaluation -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RTP.DoseVolumeConstraintsEvaluation" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RTP.DoseVolumeConstraintsEvaluation" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RTP.DoseVolumeConstraintsEvaluation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RTP.DoseVolumeConstraintsEvaluation --version 1.0.1
                    
#r "nuget: RTP.DoseVolumeConstraintsEvaluation, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RTP.DoseVolumeConstraintsEvaluation@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RTP.DoseVolumeConstraintsEvaluation&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=RTP.DoseVolumeConstraintsEvaluation&version=1.0.1
                    
Install as a Cake Tool

RTP.DoseVolumeConstraintsEvaluation

RTP.DoseVolumeConstraintsEvaluation is a small library for parsing and evaluating dose–volume constraints commonly used in radiotherapy treatment planning.


What the library does

  • Parse textual dose–volume constraints such as:
    • D2.5ccm<=56Gy, D50%<20Gy, Dmean<=40Gy,
    • V20Gy<=30ccm, V40Gy<=50%, V70Gy>5.5cmm
  • Evaluate constraints against cumulative DVHCurve objects (from RadiationTreatmentPlanner.Utils)
  • Report per-constraint results (observed values, limits, satisfied/not satisfied)
  • Perform unit conversions for doses (Gy ↔ cGy) and volumes (ccm ↔ cmm ↔ percent with respect to DVH total volume)

Important: DVHs with relative volumes (volume axis in percent) are not supported for evaluation and will cause a NotSupportedException to be thrown. Use absolute-volume DVHs (ccm or cmm) when evaluating.


Supported constraints

  • Dose at volume: D{volume}{unit}{op}{dose}{unit}
    Examples: D2ccm<=56Gy, D50%<20Gy, Dmean<=40Gy
    Dmax is internally mapped to D0%. Dmean uses DVHCurve.GetMeanDose().

  • Volume at dose: V{dose}{unit}{op}{volume}{unit}
    Examples: V20Gy<=30ccm, V40Gy<=50%, V30cGy<=0.5ccm

  • Supported operators: <

  • Supported dose units: Gy, cGy, % (percent is allowed for constraints)

  • Supported volume units: ccm / cm³ / cm3, cmm / mm³ / mm3, %


Quick example

Create two DVH curves (PTV and Heart), parse constraints and evaluate them.

using System;
using System.Collections.Generic;
using RadiationTreatmentPlanner.Utils.DVH;
using RadiationTreatmentPlanner.Utils.Dose;
using RadiationTreatmentPlanner.Utils.Volume;
using RTP.DoseVolumeConstraintsEvaluation;

// Create PTV DVH (Gy vs ccm)
var ptvPoints = new List<Tuple<UDose, UVolume>>
{
    Tuple.Create(new UDose(0, UDose.UDoseUnit.Gy), new UVolume(150, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(20, UDose.UDoseUnit.Gy), new UVolume(120, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(40, UDose.UDoseUnit.Gy), new UVolume(60, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(60, UDose.UDoseUnit.Gy), new UVolume(10, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(70, UDose.UDoseUnit.Gy), new UVolume(0, UVolume.VolumeUnit.ccm))
};
var ptvDvh = new DVHCurve(ptvPoints, DVHCurve.Type.CUMULATIVE, DVHCurve.DoseType.PHYSICAL);

// Create Heart DVH (Gy vs ccm)
var heartPoints = new List<Tuple<UDose, UVolume>>
{
    Tuple.Create(new UDose(0, UDose.UDoseUnit.Gy), new UVolume(100, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(10, UDose.UDoseUnit.Gy), new UVolume(80, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(20, UDose.UDoseUnit.Gy), new UVolume(50, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(40, UDose.UDoseUnit.Gy), new UVolume(20, UVolume.VolumeUnit.ccm)),
    Tuple.Create(new UDose(60, UDose.UDoseUnit.Gy), new UVolume(0, UVolume.VolumeUnit.ccm))
};
var heartDvh = new DVHCurve(heartPoints, DVHCurve.Type.CUMULATIVE, DVHCurve.DoseType.PHYSICAL);

// Parse constraints (one constraint per structure in this example)
var ptvConstraint = ConstraintParser.Parse("PTV", "D2.5ccm<=65Gy");
var heartConstraint = ConstraintParser.Parse("Heart", "V40Gy<=20ccm");

// Create evaluator with both constraints
var evaluator = new ConstraintEvaluator(new[] { ptvConstraint, heartConstraint });

// Evaluate PTV and Heart separately
var ptvReport = evaluator.Evaluate("PTV", ptvDvh);
var heartReport = evaluator.Evaluate("Heart", heartDvh);

// Print results
Console.WriteLine($"PTV: All satisfied: {ptvReport.AllSatisfied}");
foreach (var r in ptvReport.Results) Console.WriteLine($"  {r.Message}");

Console.WriteLine($"Heart: All satisfied: {heartReport.AllSatisfied}");
foreach (var r in heartReport.Results) Console.WriteLine($"  {r.Message}");
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 591 12/1/2025
1.0.0 576 12/1/2025

First release.