Re: pydicom "Unknow DICOM tag"

624 views
Skip to first unread message

Darcy Mason

unread,
Jan 30, 2013, 10:38:11 PM1/30/13
to pyd...@googlegroups.com
On Wednesday, January 30, 2013 9:40:20 PM UTC-5, Mathieu Zhang wrote:
I am getting the following KeyError when trying to load and pretty print a dicom file: 
1.2.826.0.1.3680043.2.135.734079.49588716.7.1359389056.505.91_0001_000000_135938909507f3.v2
ds.file_meta
(0002, 0010) Transfer Syntax UID                 UI: Implicit VR Little Endian
ds
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/mlfzhang/m3d_ro/local/lib/python2.7/site-packages/pydicom-0.9.6-py2.7.egg/dicom/dataset.py", line 527, in __str__
    return self._PrettyStr()
...
 
 File "/home/mlfzhang/m3d_ro/local/lib/python2.7/site-packages/pydicom-0.9.6-py2.7.egg/dicom/dataelem.py", line 320, in DataElement_from_raw
    raise KeyError, "Unknown DICOM tag %s - can't look up VR" % str(raw.tag)    
KeyError: "Unknown DICOM tag (2d5c, 2e36) - can't look up VR"

Is there a way to add the unknown tag to a ignore or known list? Thanks! 


First, since that tag number is not a private group (which would be an odd number), and not in the DICOM dictionary (pydicom updated to the latest fairly recently), then maybe the file is corrupt somehow.

However, assuming the file is okay and it is just a tag that pydicom doesn't know about, there is a way to add an entry to pydicom's dicom dictionary. This has come up many times so I decided to add an example file to the source code to show how to do it:
http://code.google.com/p/pydicom/source/browse/source/dicom/examples/add_dict_entries.py. If you follow that example to add this tag before reading your file, then you should be able to work around the unknown tag.

Hope that helps,
Darcy

Mathieu Zhang

unread,
Jan 31, 2013, 2:16:25 PM1/31/13
to pyd...@googlegroups.com
Great information. Thanks for the reply.
Reply all
Reply to author
Forward
0 new messages