# Dicom tags

**URL:** <https://community.materialise.com/t/dicom-tags/423>\
**Category:** MIS - Scripting Forum\
**Tags:** mimics\
**Created:** [June 14, 2021, 7:57am UTC](https://community.materialise.com/t/dicom-tags/423 "2021-06-14T07:57:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericabg](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@ericabg](https://community.materialise.com/u/ericabg)\
**Post date:** [June 14, 2021, 7:57am UTC](https://community.materialise.com/t/dicom-tags/423/1 "2021-06-14T07:57:59Z")

</div>

Hi,

I am trying to get the dicom tags from the file that is currently open in Mimics. However, not all the tags seem to come up. For example, I use the following command:

tags = mimics.get\_dicom\_tags()  
print(tags.keys())

and obtain this:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/materialiseacademy/original/1X/83a94a49c6620f46fcd0f1b500a5d422364e0913.png)

while the image in Mimics shows this information:  
 ![dicom_tags_2](https://canada1.discourse-cdn.com/flex035/uploads/materialiseacademy/original/1X/4fcc81332bbb77ac95cd9cb940bc1efc8f96799b.png)

We can see that the tags id number don’t correspond and I am not sure why? That means I cannot get some information about my image.

In addition, if I use these lines to get the value of the tags:

IO = tags[0x0020, 0x0037] #-Here I am getting Image Orientation (Patient)  
print("{}: {}".format(IO.description, IO.value))

IO.value is a string. Is there a way to get a float right away? I could convert the string to float but it because more complicated if the value is negative (i.e. -1) and was hoping to just directly the value as a float?

Thank you!

---

<div class="post-metadata">

**Author:** ![Marnic](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Marnic](https://community.materialise.com/u/Marnic)\
**Post date:** [June 16, 2021, 2:38pm UTC](https://community.materialise.com/t/dicom-tags/423/2 "2021-06-16T14:38:53Z")

</div>

Hi Erica,

The reason why the DICOM tags from your script and the image information are not the same is because Mimics works with Decimal numbers while DICOM tags are hexadecimal. In order to link your script to the DICOM information, you will need to convert the numbers.

A free tool that can be used for this is the following: [https://www.rapidtables.com/convert/number/decimal-to-hex.html?x=4144](https://www.rapidtables.com/convert/number/decimal-to-hex.html?x=4144)

Hope this helps!

Kind regards,

Marnic
