# Export a volume to DICOM format - missing metadata

**URL:** https://discourse.slicer.org/t/export-a-volume-to-dicom-format-missing-metadata/22182
**Category:** Support
**Created:** [February 25, 2022, 4:17pm UTC](https://discourse.slicer.org/t/export-a-volume-to-dicom-format-missing-metadata/22182 "2022-02-25T16:17:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)
#### Post date: [February 25, 2022, 4:17pm UTC](https://discourse.slicer.org/t/export-a-volume-to-dicom-format-missing-metadata/22182/1 "2022-02-25T16:17:44Z")

</div>

I followed the example from [Export a volume to DICOM file format](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#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:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/3/f3388fbab07d78081334e03d892aa9d8a6cb0d6b.png)

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

---

<div class="post-metadata">

### Author: ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)
#### Post date: [March 3, 2022, 2:15pm UTC](https://discourse.slicer.org/t/export-a-volume-to-dicom-format-missing-metadata/22182/2 "2022-03-03T14:15:44Z")

</div>

Turns out DICOM tags have to be set explicitly with:

```auto
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](https://github.com/Slicer/Slicer/pull/6238)
