suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

Writing "OW/OB" error #65

Closed suever closed 9 years ago

suever commented 9 years ago

From darcymason@gmail.com on December 07, 2009 20:38:57

Writing Explicit VR with the 'ambiguous' entries in the DICOM dictionary ("OW/OB" and the like) actually writes the full (more than 2 character VR) to the file, causing errors on reading the file back. See pydicom group discussion thread http://groups.google.com/group/pydicom/browse_thread/thread/58f84ee30560d53 .

File attached is essentially the same as the code from the discussion thread, which can be a starting point for a unit test for this issue.

Not clear what best way to resolve this is -- the VR must be disambiguated, which could be hard for code to do. Perhaps easiest thing is to simply generate a (helpful) error message, force the user to disambiguate the VR.

Attachment: write_ds_with_OW-OB.py

Original issue: http://code.google.com/p/pydicom/issues/detail?id=65

suever commented 9 years ago

From darcymason@gmail.com on December 07, 2009 17:58:57

Another thought ... for Pixel Data, it could be automatically disambiguated using the BitsStored data element value. But should still come up with a general solution for the
many other ambiguous VRs in the dictionary.

suever commented 9 years ago

From darcymason@gmail.com on December 15, 2011 17:47:56

Closing this issue. There is now an exception raised if attempting to write explicit VR that is not two characters. For pydicom to determine the correct VR would likely create a substantial amount of hard-to-test and maintain code. Better to not have this in pydicom core.

Status: Verified