You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SR documents with a NUM content item that has an empty Measured Value Sequence cannot be read #475
The Measured Value Sequence (0040,A300) of a NUM content item is type 2. PS3.3 Table C.18.1-1 says "Zero or one Item shall be included in this Sequence", and the Numeric Value Qualifier Code Sequence (0040,A301) is "Required if Measured Value Sequence (0040,A300) is empty" and gives the reason the value is absent (CID 42, e.g. "Measurement failure", "Not a number").
highdicom raises an IndexError when it decodes such an item. Because the content tree is decoded when a document is read, hd.sr.srread() and Comprehensive3DSR.from_dataset() fail for the whole document.
File ".../highdicom/sr/value_types.py", line 1239, in from_dataset
item
...
IndexError: list index out of range
The same error occurs with hd.sr.srread() on data/test_files/sr_document.dcm after emptying the Measured Value Sequence of its NUM item and adding a Numeric Value Qualifier Code Sequence item.
Expected: the item and the document can be read. The measurement is reported with no value and the qualifier gives the reason.
Actual: IndexError: list index out of range from NumContentItem.from_dataset().
Measurement.from_sequence() (used by get_measurements()) also rebuilds the measurement by calling the constructor with item.value and item.unit, so it would fail for these items too.
Activity