Hello, I use the “DICOM Export” feature from right clicking on a volume in the Data module frequently to output modified volumes in a format readable by other medical devices. It is very helpful that several fields are filled in with correct values (patient name, id, date) and that I can modify others (modality, descriptions). However, for one use case, the device is rejecting my exported volumes because they do not specify a “WindowCenter” and “WindowWidth”. I would like to add a value for these tags (preferably just drawn automatically from the Slicer display settings for the volume).
What is the easiest way to do this?
I see that I can use the “Create a DICOM series” module, but this requires specifying every single field I want filled in, which is unwieldy and potentially error prone (and actually I don’t see that WindowCenter and WindowWidth are options there anyway). I also see the example in the Script Repository of exporting a DICOM volume via python script, but aside from customizing the output directory, I don’t see how to change any of the DICOM tags in that process (i.e. change the series description, window settings, etc while keeping the automatically extracted patient info).
It would be great if you could add the missing fields to CreateDICOMSeries module (it is a very simple CLI module) and update DICOMScalarVolumePlugin.py and DICOMExportScalarVolume.py to set these fields. This should not be harder than adding a pydicom post-processing step just for your project, and all Slicer users would benefit from it.
@lassoan, I have returned to this problem and, despite the code you link to, the exported volumes seem to be missing the WindowCenter and WindowWidth fields. Can you test on a sample volume and see if you get the same behavior (i.e. no “0028|1050” field in exported DICOM volume)?
A tricky bug prevented writing of the window center&width fields. I’ve fixed the bug and also improved the exporter so that the current display window center&width values are used for export. The fix will be available in the Slicer Preview Release on Friday.