Plan quality metrics scripts

Aug 18, 2016 at 4:02 PM
I am new to the Eclipse scripting and try to learn it by downloading the codes from this website. When I try to run the Plan quality metrics script from inside Eclipse 11, I get the following error.

\PlanQualityMetrics\PlanQualityMetrics.cs (94,19): error CS0234: The type or namespace name 'PlanSumReporter' doesn't exist in the namespace 'VMS.TPS' (are you missing as assembly reference?)

Any one can help with that ? Thanks
Sep 10, 2016 at 10:01 PM
Did you compile the script in Visual Studio?
Sep 13, 2016 at 11:40 PM
Hi aamoush,

Quite a few people get hung up when trying to run this project. When you download the PlanQualitymetrics file from this website, you may need to re-attach the assemblies VMS.TPS.Common.Model.API and VMS.TPS.Common.Model.Types. I'll try it out over the next couple off days and see if I can't get a short screenshot set of how to do this.
Sep 27, 2016 at 1:56 PM
I'd be very interested in hearing if you resolved this problem. I am getting the same PlanSumReporter error as you.
Sep 27, 2016 at 9:58 PM

So there are actually 2 steps that you need to do in order to be able to run this script.
  1. In the Visual Studio IDE, open the references drop-down in the solutions explorer and right click and remove the references VMS.TPS.Common.Model.API and VMS.TPS.Common.Model.Types. Then Right click on "References" and select Add References. At the bottom of the dialog, there will be a button to browse ("..."), click that and find the new references of the same name as the ones you removed. They can be found in (v11) C:\Program Files (x86)\Varian\Vision\11.0\bin64\ and in (v13) C:\Program Files (x86)\Varian\Vision\13.0\bin64\esapi .
  2. Only do this step IF your system is in cGy!! You have to go into the script file named "UserDefinedMetrics.cs". In this window, you have to find and replace all ".Gy" and replace with ".cGy". You can do this manually or by hitting CTRL+F, and the little arrow at the left of the find window will allow you to replace all instances of .Gy with .cGy.
If this still doesn't help, or I wasn't clear, please let me know here. I'll attach this thread to email alert me if there is a change.

Sep 30, 2016 at 4:34 PM
Hi, on a related topic: I'm new to ESAPI as well, and have been using the same methodology as the OP to try and understand how it all works. I don't have Visual Studio yet, so am unable to do the corrective actions that mcschmidt mentions. My question is regarding the version of Visual Studio to buy - per other documentation in this group, Visual Studio 2010 is suggested, however, I don't know if it's still available. Is Visual Studio 2015 OK to go with?
Sep 30, 2016 at 4:50 PM
I'm currently using Visual Studio Community 2015, which is free.
Sep 30, 2016 at 5:27 PM
Thank you!
Oct 3, 2016 at 10:13 PM
OK, I downloaded Visual Studio Community 2015 and tried the process outlined by mcschmidt on Sep 27th to reconnect the references. I get an error that says

"a reference to "C:\program files .....\vms.tps.common.model.api.dll could not be added. The project targets .NETCore while the file reference targets .NET Framework. This is not a supported scenario"

What am I doing wrong? TIA!
Oct 4, 2016 at 12:39 AM
Right-click on the project, go to properties, and make sure that the .NET version is 4.5 if you're using ESAPI v. 13.6. I think it should be .NET 4 if you're using ESAPI v. 11. I'm surprised your project is set to .NETCore. How did you create the project?
Oct 4, 2016 at 4:58 PM
Hi Redcurry: I tried looking up the .NET version as you suggested but couldn't find it. As far as creating the project, I chose the default File-->New-->Visual C#-->Blank App (Universal Windows). At this point, I'm given the choice of .NET versions, and I chose 4.5.
Oct 4, 2016 at 5:43 PM
VMS dlls are not compatible with .NET Core. You need to choose Visual C#>Classic Desktop>>WPF Application.
Oct 4, 2016 at 5:53 PM
Also, just to note: you shouldn't be creating your own application when you want to run the PlanQualityMetrics ESAPI script. I've got detailed instructions for you in PSR format. Email me @ and I will send them to you.
Oct 7, 2016 at 2:36 PM
Thank you all for the help, especially mcschmidt for the great instructions. Managed to get it running!
Oct 7, 2016 at 3:17 PM
Thanks all for your help. Where do you locate VMS.TPS.Common.Model.API and VMS.TPS.Common.Model.Types if you have CITRIX environment ? Thanks
Oct 7, 2016 at 4:05 PM
Hi aamoush,
This is a tough question, as you may not have the rights to browse to that location, or the Visual studio window will browse your local C drive instead of the Aria server's. Anyway the location should be on your Aria Server in C:\ProgramFiles(x86)\Varian\Vision\bin64\esapi. You could probably ask your citrix administrators too get you a copy of it.
Oct 7, 2016 at 4:20 PM
One way that has worked for me in Citrix environment is to open up a patient, right click on Dose, and export dose plane (like you are sending it to MapCheck). Click through the options until you get to the last part where you can choose where to save it and choose "change for selected object".
At this point, it will open up a file browser, which you may be able to use to find the files you need. (Choose "All Files" in the save type to see them.) Then you should be able to copy them and hopefully be able to put on another network drive that you have access to.
Not sure how your clinic is set up, but that has worked for me in the past.
Oct 10, 2016 at 4:54 PM
I Got a copy of the VMS files and followed the steps to remove the old references, add new references, replace Gy by cGY and build the code. The code was built successfully but when I go to Eclipse (v11) to run the script, I get the following message: The type or namespace name 'PlanSumReporter' does not exist in the namespace 'VMS.TPS (are you missing an assembly reference?)'.

Does that mean the code only works with plan sum ?
Oct 10, 2016 at 5:35 PM
What are your motivations for using ESAPI to extract DVH information for evaluating plan quality versus using the Plan Objectives available in the Clinical Protocols already in Eclipse? Thanks for any feedback!
Oct 10, 2016 at 6:38 PM
Hi aamoush,

Are you sure you're running the file from the projects folder that is called PlanQualityMetrics.esapi.dll? Usually if you run the plugin, you'll get this error. I was able to run this project on a single plan that was not associated with a plan sum. I've also heard from other people this script only works on a plan sum so this may be a common failure people are running into. Is there anyway you could take a screenshot of just the esapi window (NO PHI, please) and send it to me so I can see which file you're running?

Oct 10, 2016 at 6:53 PM
Thanks so much. You are right, I wasn't running the right file. It works now. I appreciate your help !
Oct 11, 2016 at 8:16 PM
Has anyone tried to make a separate UserDefinedMetrics for different prescription levels? I think it would be handy to make separate constraints files for, say, two different pelvis prescriptions (for example: one with bladder constraints for an 80 Gy Rx and other for a 45 Gy Rx). I assume you'd need a different PlanQualityMetrics.esapi.dll file for each one to pull the correct files. I haven't tracked down exactly where the UserDefines are being called yet though.

Perhaps it is too ambitious, curious if anyone has tried.