/// <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 double GetComplementVolumeAtDose(PlanningItem pi)
        {
            var structures = StructureNames.Select(s => pi.GetStructure(s));
            var volAtDose  = pi.GetComplementVolumeAtDose(structures, ConstraintDose, VolumeType);

            return(volAtDose);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        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));
        }
Пример #4
0
 /// <summary>
 ///     Returns the structures in the planning item from the structure names property
 /// </summary>
 /// <param name="pi">the planning item to query</param>
 /// <returns>the collection of structures</returns>
 public IEnumerable <Structure> GetStructures(PlanningItem pi)
 {
     return(StructureNames.Select(s => pi.GetStructure(s)));
 }