diff --git a/extensions/default/src/getSopClassHandlerModule.js b/extensions/default/src/getSopClassHandlerModule.js index b45a85134..7c312d7ef 100644 --- a/extensions/default/src/getSopClassHandlerModule.js +++ b/extensions/default/src/getSopClassHandlerModule.js @@ -48,12 +48,20 @@ function getDisplaySetInfo(instances) { let firstTimePointInstances; if (instances[0].NumberOfFrames > 1 && timePoints.length > 1) { - // handle multiframe dynamic volume - firstTimePointInstances = timePoints[0].map(imageId => metaData.get('instance', imageId)); + // Handle multiframe dynamic volumes. Local file frame imageIds do not + // always resolve to a frame-level instance object, so keep resolved + // entries and fall back to the source multiframe instance when needed. + firstTimePointInstances = timePoints[0] + .map(imageId => metaData.get('instance', imageId)) + .filter(Boolean); + + if (!firstTimePointInstances.length) { + firstTimePointInstances = [instances[0]]; + } } else { // O(n) to convert it into a map and O(1) to find each instance instances.forEach(instance => instancesMap.set(instance.imageId, instance)); - firstTimePointInstances = timePoint.map(imageId => instancesMap.get(imageId)); + firstTimePointInstances = timePoint.map(imageId => instancesMap.get(imageId)).filter(Boolean); } displaySetInfo = isDisplaySetReconstructable(firstTimePointInstances, appConfig); } else { diff --git a/platform/app/src/App.tsx b/platform/app/src/App.tsx index 446308d00..18393f643 100644 --- a/platform/app/src/App.tsx +++ b/platform/app/src/App.tsx @@ -184,12 +184,16 @@ App.propTypes = { config: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({ - routerBasename: PropTypes.string.isRequired, + routerBasename: PropTypes.string, oidc: PropTypes.array, whiteLabeling: PropTypes.object, extensions: PropTypes.array, + showLoadingIndicator: PropTypes.bool, + showStudyList: PropTypes.bool, + modes: PropTypes.array, + dataSources: PropTypes.array, }), - ]).isRequired, + ]), /* Extensions that are "bundled" or "baked-in" to the application. * These would be provided at build time as part of they entry point. */ defaultExtensions: PropTypes.array, diff --git a/platform/core/src/utils/isDisplaySetReconstructable.js b/platform/core/src/utils/isDisplaySetReconstructable.js index 00decb83a..267df3b38 100644 --- a/platform/core/src/utils/isDisplaySetReconstructable.js +++ b/platform/core/src/utils/isDisplaySetReconstructable.js @@ -11,12 +11,14 @@ const iopTolerance = 0.01; * @param {Object[]} instances An array of `OHIFInstanceMetadata` objects. */ export default function isDisplaySetReconstructable(instances, appConfig) { - if (!instances.length) { + const definedInstances = instances?.filter(Boolean) || []; + + if (!definedInstances.length) { return { value: false }; } - const firstInstance = instances[0]; + const firstInstance = definedInstances[0]; - const isMultiframe = firstInstance.NumberOfFrames > 1; + const isMultiframe = (firstInstance.NumberOfFrames || 0) > 1; if (appConfig) { const rows = toNumber(firstInstance.Rows); @@ -30,16 +32,16 @@ export default function isDisplaySetReconstructable(instances, appConfig) { // in favor of the calculation by metadata (orientation and positions) // Can't reconstruct if we only have one image. - if (!isMultiframe && instances.length === 1) { + if (!isMultiframe && definedInstances.length === 1) { return { value: false }; } // Can't reconstruct if all instances don't have the ImagePositionPatient. - if (!isMultiframe && !instances.every(instance => instance.ImagePositionPatient)) { + if (!isMultiframe && !definedInstances.every(instance => instance.ImagePositionPatient)) { return { value: false }; } - const sortedInstances = sortInstancesByPosition(instances); + const sortedInstances = sortInstancesByPosition(definedInstances); return isMultiframe ? processMultiframe(sortedInstances[0]) : processSingleframe(sortedInstances); } diff --git a/platform/ui-next/src/components/CinePlayer/CinePlayer.tsx b/platform/ui-next/src/components/CinePlayer/CinePlayer.tsx index d7e5fa26d..c801886b2 100644 --- a/platform/ui-next/src/components/CinePlayer/CinePlayer.tsx +++ b/platform/ui-next/src/components/CinePlayer/CinePlayer.tsx @@ -103,9 +103,10 @@ const CinePlayer: React.FC = ({ onOpenChange={setPopoverOpen} > - +