Export RTStruct referencing original volume

Hi Everyone,

I’m trying to use the DicomRtImportExportPlugin python module to export RTStructs associated with a CT volume (call it the original volume). When I use the exporter it creates a new CT volume (same pixel values but different SOPInstanceUIDs) and the RTStruct references the new volume. Is there any way to export a RTStruct that references the original volume? The rest of my colleagues are using the original image volumes so it would be nice to have the RTStructs reference those.

Happy to provide code snippets if/when it would be useful.

Thanks

Operating system: Windows
Slicer version: 4.10.2

This is a very fair request. Unfortunately right now we can only export with the duplicate CT, creating all new UIDs. Export is done by Plastimatch (here) and it was designed to export an all-new study.

We already have ha many discussions about exporting DICOM series to existing study, see for example here: https://issues.slicer.org/view.php?id=3937
So far, however, none of the developers have had enough time and push to make it happen. Contributions are very welcome.

As an alternative, you can manually change DICOM tags such as study ID and referenced CT instance UID. But I know that if you need to do it as part of a regular workflow it is not feasible.

If you are willing use plastimatch, you can do this:

plastimatch convert --input RTSTRUCT.dicom --referenced-ct dicom-ct-directory/ --output-dicom output/

2 Likes

Good to know! Is it also possible not to re-export the CT and reference the existing one to begin with?

1 Like

Hi Greg and Csaba,

Thanks for your suggestions. Plastimatch worked well.

I also tried the other solution of writing a python script that would go through the slicer-generated RTStruct (referencing a Slicer-generated volume) and map all the SOPInstanceUIDs and SeriesInstanceUID back to the original volume. I verified that the RTStructs could be opened by Slicer and MiM.

In case it’s useful to the community, I’ve posted the relevant code in it’s own github repo.

Ryan

2 Likes

Excellent, thanks for reporting back! Special thanks for sharing your script :slight_smile:

1 Like