/// <summary> /// Gets the dose at a volume for all structures in this constraint by merging their dvhs /// </summary> /// <param name="pi">the planning item containing the dose to be queried</param> /// <returns>the dose value at the volume of this constraint</returns> public DoseValue GetDoseAtVolume(PlanningItem pi) { var structures = StructureNames.Select(s => pi.GetStructure(s)); var doseAtVol = pi.GetDoseAtVolume(structures, Volume, VolumeType, ConstraintDose.GetPresentation()); return(doseAtVol); }
/// <summary> /// Merges cumulative DVHs into one DVH based on absolute volume /// </summary> /// <param name="pi">the planning item containing the dose to query</param> /// <returns>the DVH as an array of DVHPoint values</returns> public DVHPoint[] GetMergedDVH(PlanningItem pi) { var structures = GetStructures(pi); var dvhs = structures.Select(s => pi.GetDVHCumulativeData(s, ConstraintDose.GetPresentation(), VolumePresentation.AbsoluteCm3, 0.1)); return(dvhs.MergeDVHs()); }
public override ConstraintResult Constrain(PlanningItem pi) { var msg = string.Empty; var passed = GetFailedResultType(); var structures = StructureNames.Select(s => pi.GetStructure(s)); var doseAtVol = pi.GetDoseAtVolume(structures, Volume, VolumeType, ConstraintDose.GetPresentation()); passed = PassingFunc(doseAtVol); var stringUnit = VolumeType == VolumePresentation.AbsoluteCm3 ? "CC" : "%"; var value = $"{doseAtVol.GetDose(ConstraintDose.Unit).ToString("F3")} {ConstraintDose.UnitAsString}"; msg = $"Dose to {Volume} {stringUnit} of {StructureName} is {value}."; return(new ConstraintResult(this, passed, msg, value)); }
public override ConstraintResult Constrain(PlanningItem pi) { var msg = string.Empty; var passed = GetFailedResultType(); var dvhs = GetStructures(pi) .Select(s => pi.GetDVHCumulativeData(s, ConstraintDose.GetPresentation(), VolumePresentation.AbsoluteCm3, 0.01)); var min = dvhs.Min(d => d.MinDose); var value = $"{min.GetDose(ConstraintDose.Unit).ToString("F3")} {ConstraintDose.UnitAsString}"; passed = min.GreaterThanOrEqualTo(ConstraintDose) ? ResultType.PASSED : GetFailedResultType(); msg = $"Minimum dose to {string.Join("/", StructureNames)} is {value}."; return(new ConstraintResult(this, passed, msg, value)); }