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:
Hope that helps,
Darcy