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 content items with value type WAVEFORM cannot be decoded #472
highdicom.sr.WaveformContentItem can be constructed, but WAVEFORM items cannot be read back, and the referenced_waveform_channels property never returns the stored channels.
Minimal reproduction:
fromhighdicom.srimportCodedConcept, ContentSequence, WaveformContentItemitem=WaveformContentItem(
name=CodedConcept('260753009', 'SCT', 'Source'),
referenced_sop_class_uid='1.2.840.10008.5.1.4.1.1.9.1.1', # 12-lead ECGreferenced_sop_instance_uid='1.2.3.4',
referenced_waveform_channels=[(1, 1), (1, 2)],
relationship_type='CONTAINS',
)
print(item.ReferencedSOPSequence[0].ReferencedWaveformChannels) # [1, 1, 1, 2]print(item.referenced_waveform_channels) # NoneWaveformContentItem.from_dataset(item)
# ValueError: Dataset is not an SR Content Item with value type "IMAGE"ContentSequence.from_sequence([item])
# KeyError: <ValueTypeValues.WAVEFORM: 'WAVEFORM'>
WaveformContentItem.from_dataset() accepts a dataset with Value Type WAVEFORM (and rejects one with Value Type IMAGE; at the moment it does the reverse).
ContentSequence.from_sequence() decodes WAVEFORM items into WaveformContentItem instances.
Actual: as shown in the comments above. Because ContentSequence.from_sequence() is used when reading documents, any SR or Key Object Selection document whose content tree contains a WAVEFORM item (for example a KOS that selects an ECG, which TID 2010 encodes with Value Type WAVEFORM) fails to load with srread(), KeyObjectSelectionDocument.from_dataset(), etc. KeyObjectSelection.get_references() already lists WAVEFORM as a supported value type, but it cannot get that far.
Oh dear! Certainly an unfortunate one. I guess we can conclude that in the 6 years since this library was released, no-one has actually tried to read SRs/KOs with waveform items before (myself included)! Your adventurousness is commended
Activity
CPBridge commentedon Oct 21, 2026
Oh dear! Certainly an unfortunate one. I guess we can conclude that in the 6 years since this library was released, no-one has actually tried to read SRs/KOs with waveform items before (myself included)! Your adventurousness is commended