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