Export a volume to DICOM format - missing metadata

I followed the example from Export a volume to DICOM file format.

It successfully exported a volume, however, when I load the exported DICOM back to Slicer the study and patient name are missing:

Maybe I misunderstood something, but I thought that in this tree ‘test patient’ and ‘test study’ (as specified in the script repository) would appear.

MacOS, 3D Slicer 4.13.0-2022-02-16

Turns out DICOM tags have to be set explicitly with:

exp.setTag('PatientID', patient_id)

The information is not automatically taken from the hierarchy tree.

I added an explanation to the DOCs in this pull request

1 Like