# Unable to get DICOM SQ tags from simpleITK series reader metadata keys

**URL:** https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321
**Category:** Engineering
**Tags:** dicom, simpleitk
**Created:** [October 12, 2019, 10:34pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321 "2019-10-12T22:34:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Jigabytes](https://discourse.itk.org/user_avatar/discourse.itk.org/jigabytes/32/967_2.png) [@Jigabytes](https://discourse.itk.org/u/Jigabytes)
#### Post date: [October 12, 2019, 10:34pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/1 "2019-10-12T22:34:54Z")

</div>

Hi, I am I read a dicom series using series reader. I wanted to read dicom metadata but I could not see metadata keys that further has collection of dicom tags in it. As an example I wish to read 0054|0016 which further has dicom tags like 0018|1072, 0018|1074 in it which I wish to read. Can you please guide on how to get such meta data dicom tags read from simpleITK perspective?  
Thanks, Jiten

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [October 13, 2019, 1:45pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/2 "2019-10-13T13:45:10Z")

</div>

Hello @Jigabytes,

Please take a look at [this example](https://simpleitk.readthedocs.io/en/master/link_DicomSeriesReadModifyWrite_docs.html) which shows how to set the reader to load all DICOM tags. After you follow the example, please post back if the tags are still not loaded.

---

<div class="post-metadata">

### Author: ![Jigabytes](https://discourse.itk.org/user_avatar/discourse.itk.org/jigabytes/32/967_2.png) [@Jigabytes](https://discourse.itk.org/u/Jigabytes)
#### Post date: [October 13, 2019, 10:00pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/3 "2019-10-13T22:00:44Z")

</div>

Hello @zivy, yes before creating this topic I referred to the link you provided and obtained all metadata keys with setup mentioned in example, yet I could not see 0054|0016 parent tag and its child tags 0018|1072, 0018|1074 in the keys returned by series reader get metadata keys api. Is there any other alternative or is this issue with series reader metadata retrieval apis? Thanks, Jiten

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [October 14, 2019, 1:17pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/4 "2019-10-14T13:17:21Z")

</div>

Have you tried opening the file(s) with e.g. Slicer, and looking at the list of tags? If the tags are not there you cannot obtain them.

---

<div class="post-metadata">

### Author: ![Jigabytes](https://discourse.itk.org/user_avatar/discourse.itk.org/jigabytes/32/967_2.png) [@Jigabytes](https://discourse.itk.org/u/Jigabytes)
#### Post date: [October 14, 2019, 3:13pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/5 "2019-10-14T15:13:56Z")

</div>

Hi @dzenanz I did not try with slicer but I have Osirix through which I was able to see mentioned tags.

---

<div class="post-metadata">

### Author: ![mihail.isakov](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mihail.isakov](https://discourse.itk.org/u/mihail.isakov)
#### Post date: [October 14, 2019, 3:31pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/6 "2019-10-14T15:31:19Z")

</div>

IMHO, if you have to access attributes in a data set - try GDCM (is in ITK by default) or DCMTK (must be enabled in cmake) or pydicom. I can share code how to read sequences with GDCM. MetaData dictionary [skips](https://github.com/InsightSoftwareConsortium/ITK/blob/85fd3addbf3afcb1a4c1dde53db7de8637eb68d0/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L612) sequences in GDCMImageIO.

---

<div class="post-metadata">

### Author: ![Jigabytes](https://discourse.itk.org/user_avatar/discourse.itk.org/jigabytes/32/967_2.png) [@Jigabytes](https://discourse.itk.org/u/Jigabytes)
#### Post date: [October 15, 2019, 4:42am UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/7 "2019-10-15T04:42:20Z")

</div>

Hi @mihail.isakov Thanks for ur response. Is GDCM exposed via simple ITK? I was able to get the SQ attributes via pydicom. Its just that I have to add dependency on pydicom to read SQ attributes and was hoping to get it all from SimpleITK. It would be great if u could share code to retrieve bthe SQ attribute via GDCM. Thanks, Jiten!

---

<div class="post-metadata">

### Author: ![Bernardo\_Henz](https://discourse.itk.org/user_avatar/discourse.itk.org/bernardo_henz/32/3369_2.png) [@Bernardo\_Henz](https://discourse.itk.org/u/Bernardo_Henz)
#### Post date: [March 31, 2023, 2:46pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/8 "2023-03-31T14:46:28Z")

</div>

@Jigabytes I’m facing the same issue: I’m able to read the SQ tag using pydicom, but SITK is unable to retrieve neither the key nor value of the the particular tag.

Did you find a solution for SITK?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [April 1, 2023, 12:36pm UTC](https://discourse.itk.org/t/unable-to-get-dicom-sq-tags-from-simpleitk-series-reader-metadata-keys/2321/9 "2023-04-01T12:36:35Z")

</div>

DICOM tags can be very complex and may store large amount of information with many cross-references to information stored in other files. These other files may be stored locally or need to be retrieved from remote servers. DICOM storage is essentially a complex hierarchical distributed object-oriented database.

The metadata dictionary interface in ITK readers cannot provide a comprehensive interface for such a complex database. All you can expect from a DICOM image file reader is to provide file names and DICOM UIDs of the frames that were used to build the volume. You can consider any extra tags the reader gives you as a bonus, made available just for convenience for some common simple use cases.

For full access to all the DICOM metadata, you can use your DICOM toolkit of choice such as DCMTK, GDCM, pydicom, highdicom, etc.
