Dose information for Plan Sums

Apr 24 at 6:04 PM
Hello,

New to scripting and have a question about getting dose information for plan sums. Can anyone share with me how I could make the simple code below work to grab dose information from the active plan sum?

Thanks!

using System;
using System.Linq;
using System.Text;
using System.Windows;
using System.Collections.Generic;
using VMS.TPS.Common.Model.API;
using VMS.TPS.Common.Model.Types;

namespace VMS.TPS
{
public class Script
{
public Script()
{
}

public void Execute(ScriptContext context /*, System.Windows.Window window*/)
{
        // TODO : Add here your code that is called when the script is launched from Eclipse
        //Structure Bladder = context.StructureSet.Structures.Where()
        Structure Bladder = context.StructureSet.Structures.Where(s => s.Id == "Bladder").Single();
        //DVHData dvh = context.PlanSetup.GetDVHCumulativeData(Bladder, DoseValuePresentation.Absolute, VolumePresentation.Relative, size);
        PlanSetup plan = context.PlanSetup;
        DoseValue d40 = plan.GetDoseAtVolume(Bladder, 40, VolumePresentation.AbsoluteCm3, DoseValuePresentation.Absolute);
        MessageBox.Show(String.Format("Dose to 40cc of Bladder = {0}",d40));
    }
}
}