Export DVH in tabular format

Sep 1, 2016 at 12:51 PM
From File > Export > DVH in Tabular format, one can export DVH for selected structures into a single text file. I have been using the R package RadOnc to load these DVH for analysis. I have a single dummy patient containing 40 plans and I wish to write a script to export the DVH in this way for all structures in the 40 plans. I cannot find a way to do this via scripting? Any advice appreciated
Sep 10, 2016 at 10:22 PM
Look at the GetDVHCumulativeData method of the PlanningItem class (the parent class of PlanSetup and PlanSum). It returns a DVHData object that contains the CurveData property, which represents the DVH itself.
Sep 12, 2016 at 12:31 AM
I wrote a Python script to do what you asked. It's on my GitHub account as export-dvh. I also wrote a blog post describing the script in more detail: Export DVHs to a CSV File Using Python. I hope it helps!
Sep 23, 2016 at 2:01 PM
Excellent thanks for the script, I will try it out soon. Using python certainly looks preferable to C#..!
Oct 19, 2016 at 3:51 PM
I am now just exporting the dose.dcm files, importing with dicompyler-core (https://github.com/dicompyler/dicompyler-core), and doing my analysis there. Cheers!