You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Do you know if there is a way to export a RS patient (e.g. connect.get_current("Patient")) as DICOM files to a path? I am able to do so via the UI, but need a scriptable version. Recording the actions gives me an "Unscriptable Action" error.
I have looked at the following options
patient.ExportPatient --> does .rsback
db.BackupPatient --> does .rsbak
case.ScriptableDicomExport (not sure exactly how to use it)
The text was updated successfully, but these errors were encountered:
Disclaimer: This may not be 100 percent correct since I no longer work at the clinic where I had access to RayStation. All of this is from memory and this repo.
The case.ScriptableDicomExport method is the only way I know of. Use the state tree (import statetree; statetree.runStateTree()) for more information, but this is my understanding of the parameters:
ExportFolderPath: Directory to export .dcm files to
Examinations: List of names of exams to export
BeamSets: List of IDs of beam sets to export. Each beam set is exported as an RTPLAN DICOM file.
PhysicalBeamSetDoseForBeamSets: List of IDs of beam sets for which to export dose. Each beam set dose is exported as an RTDOSE DICOM file.
PhysicalBeamDosesForBeamSets: List of IDs of beam sets whose beam doses to export. Each beam dose is exported as an RTDOSE DICOM file.
RtStructureSetsForExaminations: List of names of exams whose structure sets to export. Each structure set is exported as an RTSTRUCT DICOM file.
RtStructureSetsReferencedFromBeamSets: List of IDs of beam sets whose structure sets to export. Each beam set's structure set is exported as an RTSTRUCT DICOM file.
To export all of these DICOM files for the open patient (connect.get_current('Patient')), you can do the following:
for case in patient.Cases:
exam_names = [exam.Name for exam in case.Examinations]
beam_set_ids = [beam_set.BeamSetIdentifier() for plan in case.TreatmentPlans for beam_set in plan.BeamSets]
case.ScriptableDicomExport(ExportFolderPath='path/to/export/to', Examinations=exam_names, BeamSets=beam_set_ids, PhysicalBeamSetDoseForBeamSets=beam_set_ids, PhysicalBeamDosesForBeamSets=beam_set_ids, RtStructureSetsForExaminations=exam_names, RtStructureSetsReferencedFromBeamSets=beam_set_ids)
I have a few examples of ScriptableDicomExport in this repo.
RayStation is weird in that a single plan can have multiple beam sets. To my knowledge, no other TPS has the concept of a "beam set."
Hi,
Do you know if there is a way to export a RS patient (e.g.
connect.get_current("Patient")
) as DICOM files to a path? I am able to do so via the UI, but need a scriptable version. Recording the actions gives me an "Unscriptable Action" error.I have looked at the following options
The text was updated successfully, but these errors were encountered: