forked from rexcardan/ESAPIX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
851 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#region | ||
|
||
using ESAPIX.Facade.API; | ||
using System.Linq; | ||
using VMS.TPS.Common.Model.Types; | ||
|
||
#endregion | ||
|
||
namespace ESAPIX.Extensions | ||
{ | ||
public static class FPlanSumExtensions | ||
{ | ||
/// <summary> | ||
/// This method exists to guess the prescription of a plan sum by summing all plan setup prescribed doses and | ||
/// generating a | ||
/// relative dvh curve. Can't technically do relative dose with plan sum...but let's try to do it anyway | ||
/// </summary> | ||
/// <param name="ps">the plan sum where relative dose dvh curve is desired</param> | ||
/// <param name="s">the structure to sample</param> | ||
/// <param name="vPres">the volume presentation to create the curve</param> | ||
/// <param name="binWidth">the bin width to create the curve</param> | ||
/// <returns></returns> | ||
public static DVHPoint[] GetRelativeDVHCumulativeData(this PlanSum ps, Structure s, VolumePresentation vPres, | ||
double binWidth) | ||
{ | ||
var guessedRxGy = ps.TotalPrescribedDoseGy(); | ||
var psDVH = ps.GetDVHCumulativeData(s, DoseValuePresentation.Absolute, vPres, binWidth); | ||
var scalingPoint = new DoseValue(guessedRxGy, DoseValue.DoseUnit.Gy); | ||
var dvhCurve = psDVH.CurveData.ConvertToRelativeDose(scalingPoint); | ||
return dvhCurve; | ||
} | ||
|
||
public static Course Course(this PlanSum ps) | ||
{ | ||
#if VMS110 | ||
return ps.PlanSetups.FirstOrDefault()?.Course; | ||
#else | ||
return ps.Course; | ||
#endif | ||
} | ||
} | ||
} |
Oops, something went wrong.