From 516bd6368b23f45cc386a0485e8b80cb3ecb29fa Mon Sep 17 00:00:00 2001 From: Narbek Date: Mon, 11 Nov 2024 16:49:55 +0500 Subject: [PATCH] mg split fix --- extensions/default/src/getSopClassHandlerModule.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/extensions/default/src/getSopClassHandlerModule.js b/extensions/default/src/getSopClassHandlerModule.js index 74f8cea5a07..1a02f1443f6 100644 --- a/extensions/default/src/getSopClassHandlerModule.js +++ b/extensions/default/src/getSopClassHandlerModule.js @@ -129,8 +129,12 @@ const makeDisplaySet = instances => { return imageSet; }; -const isSingleImageModality = modality => { - return modality === 'CR' || modality === 'MG' || modality === 'DX'; +const isSingleImageModality = (modality, hasMultiSourceImageSequenceInstance) => { + return ( + modality === 'CR' || + (modality === 'MG' && !hasMultiSourceImageSequenceInstance) || + modality === 'DX' + ); }; function getSopClassUids(instances) { @@ -156,6 +160,9 @@ function getDisplaySetsFromSeries(instances) { if (!instances || !instances.length) { throw new Error('No instances were provided'); } + const hasMultiSourceImageSequenceInstance = instances.some( + i => (i.SourceImageSequence || []).length > 1 + ); const displaySets = []; const sopClassUids = getSopClassUids(instances); @@ -183,7 +190,7 @@ function getDisplaySetsFromSeries(instances) { acquisitionDatetime: instance.AcquisitionDateTime, }); displaySets.push(displaySet); - } else if (isSingleImageModality(instance.Modality)) { + } else if (isSingleImageModality(instance.Modality, hasMultiSourceImageSequenceInstance)) { displaySet = makeDisplaySet([instance]); displaySet.setAttributes({ sopClassUids,