Open fizxmike opened 2 months ago
Hi Michael,
I am Luis, a clinical Medical Physicist who loves Python. I would like to use pyesapi and pylinac to automate some of my QC tests.
Is it possible to export an image (for example a VMS.TPS.Model.API.Image object) as a DICOM file using a pyesapi script?
The example script I shared above shows how to communicate with Eclipse's DICOM Daemon via pynetdicom. So, if you already have the image set ready in Eclipse, that might be the easiest way. The example script only deals with dose and plans for Protons and Electrons, but with the right modifications, it should be able to support CT images and photon plans as well. It's incomplete, that's why it's not in the main codebase yet.
In principle, one could construct (or edit) a DICOM file using pydicom filling with data retrieved through PyESAPI. Although getting the UUIDs all correct for a new set of DICOM files is something you have to manage yourself.
Adding as feature request. In the meantime, I've attached and example from our Proton and Electron FLASH research that depends on pynetdicom (sister project of pydicom). It will need to be modified to support photon plans (add another SOPClass UID - and check that DICOM UUIDs make sense).