Importing DX image with malformed tag causes error
The error below comes up in the task_admin page when OpenREM tries to import data from a particular Siemens radiographic room. It helpfully suggests changing the pydicom config to change the error to a warning by setting "pydicom.config.convert_wrong_length_to_UN = True".
Traceback (most recent call last): File "E:\venv311\Lib\site-packages\pydicom\dataelem.py", line 859, in DataElement_from_raw value = convert_value(vr, raw, encoding) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\venv311\Lib\site-packages\pydicom\values.py", line 771, in convert_value return converter(byte_string, is_little_endian, num_format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\venv311\Lib\site-packages\pydicom\values.py", line 389, in convert_numbers raise BytesLengthException( pydicom.errors.BytesLengthException: Expected total bytes to be an even multiple of bytes per value. Instead received b'\x00\x00' with length 2 and struct format 'f' which corresponds to bytes per value of 4. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\venv311\Lib\site-packages\pydicom\tag.py", line 28, in tag_in_exception yield File "E:\venv311\Lib\site-packages\pydicom\dataset.py", line 2389, in walk data_element = self[tag] |
---|
Comments (6)
-
reporter -
reporter Fixing merge conflicts. Refs issue
#1006→ <<cset f315d38f1b46>>
-
reporter It seems that tag (0021,100C) is likely to be related to the patient coordinate system (PCS). See https://github.com/xiangruili/dicm2nii/blob/master/dicm_dict.m where for a Siemens system this tag has been verified as 'PositivePCSDirections'.
-
reporter Fixing conflict in changes file. Refs issue
#1006→ <<cset e6a331e1c543>>
-
reporter Merged in issue1006importingDXimageWithMalformedTagCausesError (pull request #591)
Changing the pydicom config in the radiographic extractor to throw a warning rather than an error if a tag is the wrong length. Refs issue
#1006Approved-by: Ed McDonagh
Fixes issue
#1006→ <<cset 0e366bd6b2a2>>
-
reporter - changed status to resolved
Merged in issue1006importingDXimageWithMalformedTagCausesError (pull request #591)
Changing the pydicom config in the radiographic extractor to throw a warning rather than an error if a tag is the wrong length. Refs issue
#1006Approved-by: Ed McDonagh
Fixes issue
#1006→ <<cset 0e366bd6b2a2>>
- Log in to comment
Changing the pydicom config in the radiographic extractor to throw a warning rather than an error if a tag is the wrong length. Refs issue
#1006→ <<cset 4ef284b5ef82>>