VarianAPIs / PyESAPI

Python interface to Eclipse Scripting API
MIT License
69 stars 32 forks source link

Mean dose #10

Closed apichu closed 4 years ago

apichu commented 5 years ago

Hi How to calculate mean dose?

Kiragroh commented 5 years ago

Getting DVH Max, min and mean:

PlanSetup ps = context.PlanSetup;

DVHData dvh = ps.GetDVHCumulativeData(MyStructure, VMS.TPS.Common.Model.Types.DoseValuePresentation.Absolute, VMS.TPS.Common.Model.Types.VolumePresentation.Relative, 0.1);

var maxDose = dvh.MaxDose;

var minDose = dvh.MinDose;

var meanDose = dvh.MeanDose;

apichu commented 5 years ago

Thanks. But I need it Python (PyESAPI) code ?

fizxmike commented 4 years ago

Since pyesapi is a wrapper of C# interface (plus some extras), you can use nearly identical code. The types are exposed in pyesapi module, something like: dvh = ps.GetDVHCumulativeData(structure, pyesapi.DoseValuePresentation.Absolute, pyesapi.VolumePresentation.Relative, 0.1)