We noticed that MetaExtractor fails in _get_elem_value() in case some DICOM fields are empty / are of length zero.
For example, if PatientWeight is included in a dataset, but empty, MetaExtractor fails in this line with TypeError: 'NoneType' object is not iterable as we try to iterate over value, which is None.
According to the DICOM standard, optional fields such as PatientWeight "may or may not be included and could be zero length". (source). Leaving the field empty thus conforms to the standard.
Note that this error only occurs for DICOM fields of these value representations due to this line.
A None check in _get_elem_value() would probably fix the issue.
I am aware that the repo is no longer actively maintained but decided to report the issue anyway due to the planned integration into nibabel.
We noticed that
MetaExtractor
fails in_get_elem_value()
in case some DICOM fields are empty / are of length zero.For example, if
PatientWeight
is included in a dataset, but empty, MetaExtractor fails in this line withTypeError: 'NoneType' object is not iterable
as we try to iterate overvalue
, which isNone
.According to the DICOM standard, optional fields such as
PatientWeight
"may or may not be included and could be zero length". (source). Leaving the field empty thus conforms to the standard.Note that this error only occurs for DICOM fields of these value representations due to this line.
A
None
check in_get_elem_value()
would probably fix the issue.I am aware that the repo is no longer actively maintained but decided to report the issue anyway due to the planned integration into nibabel.