Pinnacle : KeyDependency

Description

  • KeyDependency is a list of event-action “dependencies” in the currently open plan
  • Executes an action (AddAction) whenever a specified event occurs (KeyString)
    • Ex. Whenever a beam angle is changed, a script is called to rename it (need to verify this works)
  • Consists of three parts – Name, KeyString and AddAction
  • The dependency remains until it’s “destroyed” in a script or the plan is closed
  • Each new KeyDependency is created by invoking CreateChild
  • A script can be called, or a single line of code when the KeyString occurs
  • Works only on software level changes
    • e.g. Can be set to execute when the software sees TrialList.Current.BeamList.Current.Name, but not something specific like TrialList.Current.BeamList.Current.Name = "New Name"
    • This can be really hit-or-miss as it doesn’t seem to work for anything associated with the IMRT Inverse Planning window.
  • The technique can be utilized with the PinnacleInit file to automate checks and tasks based on user actions

Examples

  • KeyDependency calling a script when an event occurs (in this case, another trial is selected)
KeyDependencyList.CreateChild = "";
KeyDependencyList.Last =
 {
     Name = “TempDependency”;
     KeyString = “TrialList.Current.Name”; 
     AddAction = “Script.ExecuteNow = SomeScriptName.Script”;//Calls your script
 };
  • KeyDependency running a line of code when an event occurs
KeyDependencyList.CreateChild = "";
KeyDependencyList.Last =
 {
     Name = “TempDependency2”;
     KeyString = “TrialList.Current.Name”; 
    AddAction = “TrialList.Current.BeamList.Current.Name = TrialList.Current.Name”; //Beam name changed to match trial name
 };
  • Like other variables, KeyDependencies must be destroyed manually in the script or they will persist until the plan is closed
KeyDependencyList.TempDependency.Destroy = “”;
Bibliography
1. Scripting on the Pinnacle3 Treatment Planning System. Geoghegan, S. https://tpswiki.com/wp-content/uploads/2022/01/Scripting_on_the_Pinnacle_TPS.pdf