Plan Quality Metrics Script

Mar 20 at 4:34 PM
Dear All,
I have a question related to Plan Quality Metrics Script, if you have SIB case either IMRT or VMAT when you have 2 or more PTVs inside the plan.
The script is designed to work with one target only.
I tried to work around with the script as we do with other structures by adding the following;
lets consider we have 3 PTVs
70Gy, 66 Gy and 60 Gy

This is what I added inside UserDefinedMetrics.cs
// quality metrics for the target
    public class Target
    {
      public static PlanQualityMetric[] getPQMs(DoseValue totalPrescribedDose)
      {
        PlanQualityMetric[] PQMs = 
          {
            new VolumeAtDose("V[100%(Rx) > 95%]", new DoseValue(totalPrescribedDose.Dose*1.0, totalPrescribedDose.Unit),   95.0, 0.9474, VolumePresentation.Relative, PQMUtilities.LimitType.lower),
            new VolumeAtDose("V[93%(Rx) > 99%]", new DoseValue(totalPrescribedDose.Dose*0.93, totalPrescribedDose.Unit),   99.0, 0.9596, VolumePresentation.Relative, PQMUtilities.LimitType.lower),
            new VolumeAtDose("V[110%(Rx) < 20%]", new DoseValue(totalPrescribedDose.Dose*1.10, totalPrescribedDose.Unit),   20.0, 1.25, VolumePresentation.Relative, PQMUtilities.LimitType.upper)
          };
        return PQMs;
      }
    }

        // quality metrics for the PTV70 structure

        public  static class PTV70
        {
            public static PlanQualityMetric[] PQMs =
      {
           new VolumeAtDose("V70Gy > 95%",new DoseValue(7000.0, DoseValue.DoseUnit.cGy), 95.0, 0.9474),
           new VolumeAtDose("V65.1Gy > 99%",new DoseValue(6510.0, DoseValue.DoseUnit.cGy), 99.0, 0.9596),
           new VolumeAtDose("V77Gy < 20%",new DoseValue(7700.0, DoseValue.DoseUnit.cGy), 20.0, 1.25)
          };
                 public static string[] searchIds = { "PTV70", "PTV_70", "PTV-70", "PTV-70Gy", "PTV_70Gy" };

        }

        // quality metrics for the PTV66 structure

        public static class PTV66
        {
            public static PlanQualityMetric[] PQMs =
      {
           new VolumeAtDose("V66Gy > 95%",new DoseValue(6600.0, DoseValue.DoseUnit.cGy), 95.0, 0.9474),
           new VolumeAtDose("V61.38Gy > 99%",new DoseValue(6138.0, DoseValue.DoseUnit.cGy), 99.0, 0.9596),
           new VolumeAtDose("V72.6Gy < 20%",new DoseValue(7260.0, DoseValue.DoseUnit.cGy), 20.0, 1.25)
          };
            public static string[] searchIds = { "PTV66", "PTV_66", "PTV-66","PTV-66Gy", "PTV_66Gy" };
        }

        // quality metrics for the PTV60 structure

        public static class PTV60
        {
            public static PlanQualityMetric[] PQMs =
      {
           new VolumeAtDose("V60Gy > 95%",new DoseValue(6000.0, DoseValue.DoseUnit.cGy), 95.0, 0.9474),
           new VolumeAtDose("V55.8Gy > 99%",new DoseValue(5580.0, DoseValue.DoseUnit.cGy), 99.0, 0.9596),
           new VolumeAtDose("V66Gy < 20%",new DoseValue(6600.0, DoseValue.DoseUnit.cGy), 20.0, 1.25)
          };
            public static string[] searchIds = { "PTV60", "PTV_60", "PTV-60","PTV-60Gy", "PTV_60Gy" };
        }
and also I added the following to PQMReporter.cs
// find stats for PTV structures
            addStructurePQM(plan, ss, PTV70.searchIds, PTV70.PQMs, writer);
            addStructurePQM(plan, ss, PTV66.searchIds, PTV66.PQMs, writer);
            addStructurePQM(plan, ss, PTV60.searchIds, PTV60.PQMs, writer);
But when I run the script and I get the report
The analysis for PTVs are not correct; for example first criteria ( new VolumeAtDose("V60Gy > 95%",new DoseValue(6000.0, DoseValue.DoseUnit.cGy), 95.0, 0.9474),
even if I am covering more than 95% , the evaluation result is FAIL rather than PASS

I have 2 more questions:

first:
How to make the program round up the results instead of having 95.004 to have only 95.0
second:
How to make the print out of the xml file fits into A4 paper rather than having half of the table in one page and the half in another page.

I wonder if someone can please guide me what to do
Thank you all.
Mar 25 at 1:13 PM
Any suggestion please,, still facing same issue
Hope one of the experts could answer me

thank you all