From 6dedf5573e78a5751bed0b79646700acedfc8a38 Mon Sep 17 00:00:00 2001 From: Devu-trenser <91659097+Devu-trenser@users.noreply.github.com> Date: Tue, 27 Jan 2026 20:43:55 +0530 Subject: [PATCH] fix: Handle optional ContentSequence for NUM content items (#5703) * fix: SR validation * Adding links to cs3d * Update to dcmjs 0.48.0 * Update package files to include updated adapter * Update package files --------- Co-authored-by: Bill Wallace Co-authored-by: arul-trenser --- .../src/getSopClassHandlerModule.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts b/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts index 6bd00da44..dcec2f4b1 100644 --- a/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts +++ b/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts @@ -637,15 +637,20 @@ function _processNonGeometricallyDefinedMeasurement(mergedContentSequence) { NUMContentItems.forEach(item => { const { ConceptNameCodeSequence, ContentSequence, MeasuredValueSequence } = item; - const { ValueType } = ContentSequence; - if (ValueType !== 'SCOORD' && ValueType !== 'SCOORD3D') { - console.warn(`Graphic ${ValueType} not currently supported, skipping annotation.`); - return; - } + // Handle spatial reference ONLY if ContentSequence exists + if (ContentSequence) { + const { ValueType } = ContentSequence; - const coords = _getCoordsFromSCOORDOrSCOORD3D(ContentSequence); - if (coords) { - measurement.coords.push(coords); + if (ValueType !== 'SCOORD' && ValueType !== 'SCOORD3D') { + console.warn(`Graphic ${ValueType} not currently supported, skipping annotation.`); + return; + } + + const coords = _getCoordsFromSCOORDOrSCOORD3D(ContentSequence); + + if (coords) { + measurement.coords.push(coords); + } } if (MeasuredValueSequence) {