@ohif/extension-cornerstone 3.14.0-beta.97 → 3.14.0-beta.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/dist/915.ohif-extension-cornerstone.umd.js +1 -1
  2. package/dist/ohif-extension-cornerstone.umd.js +1 -5
  3. package/package.json +18 -8
  4. package/src/Viewport/OHIFCornerstoneViewport.css +46 -0
  5. package/src/Viewport/OHIFCornerstoneViewport.tsx +502 -0
  6. package/src/Viewport/Overlays/CornerstoneOverlays.tsx +103 -0
  7. package/src/Viewport/Overlays/CustomizableViewportOverlay.css +25 -0
  8. package/src/Viewport/Overlays/CustomizableViewportOverlay.tsx +469 -0
  9. package/src/Viewport/Overlays/ViewportImageScrollbar.tsx +106 -0
  10. package/src/Viewport/Overlays/ViewportImageSliceLoadingIndicator.tsx +87 -0
  11. package/src/Viewport/Overlays/ViewportOrientationMarkers.css +41 -0
  12. package/src/Viewport/Overlays/ViewportOrientationMarkers.tsx +136 -0
  13. package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/ViewportSliceProgressScrollbar.tsx +195 -0
  14. package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/helpers.ts +46 -0
  15. package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/hooks.ts +383 -0
  16. package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/index.ts +1 -0
  17. package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/types.ts +17 -0
  18. package/src/Viewport/Overlays/utils.ts +66 -0
  19. package/src/commandsModule.ts +2951 -0
  20. package/src/components/AccordionGroup/AccordionGroup.tsx +195 -0
  21. package/src/components/AccordionGroup/index.ts +4 -0
  22. package/src/components/ActiveViewportWindowLevel/ActiveViewportWindowLevel.tsx +23 -0
  23. package/src/components/ActiveViewportWindowLevel/index.js +1 -0
  24. package/src/components/AdvancedRenderingControls/AdvancedRenderingControls.tsx +149 -0
  25. package/src/components/AdvancedRenderingControls/index.ts +1 -0
  26. package/src/components/CinePlayer/CinePlayer.tsx +247 -0
  27. package/src/components/CinePlayer/index.ts +3 -0
  28. package/src/components/DicomUpload/DicomUpload.tsx +111 -0
  29. package/src/components/DicomUpload/DicomUploadProgress.tsx +396 -0
  30. package/src/components/DicomUpload/DicomUploadProgressItem.tsx +119 -0
  31. package/src/components/ExportSegmentationSubMenuItem.tsx +75 -0
  32. package/src/components/MeasurementItems.tsx +70 -0
  33. package/src/components/MeasurementTableNested.tsx +30 -0
  34. package/src/components/MeasurementsMenu.tsx +84 -0
  35. package/src/components/MeasurementsOrAdditionalFindings.tsx +82 -0
  36. package/src/components/ModalityLoadBadge/ModalityLoadBadge.tsx +171 -0
  37. package/src/components/ModalityLoadBadge/index.ts +1 -0
  38. package/src/components/NavigationComponent/NavigationComponent.tsx +138 -0
  39. package/src/components/NavigationComponent/index.ts +3 -0
  40. package/src/components/OHIFViewportActionCorners.tsx +94 -0
  41. package/src/components/OpacityMenu/OpacityMenu.tsx +54 -0
  42. package/src/components/OpacityMenu/OpacityMenuWrapper.tsx +85 -0
  43. package/src/components/OpacityMenu/index.ts +2 -0
  44. package/src/components/PanelAccordionTrigger.tsx +48 -0
  45. package/src/components/SegmentationToolConfig.tsx +71 -0
  46. package/src/components/SegmentationUtilityButton.tsx +61 -0
  47. package/src/components/SelectItemWithModality.tsx +29 -0
  48. package/src/components/SeriesMeasurements.tsx +90 -0
  49. package/src/components/SeriesSummaryFromDisplaySet.tsx +21 -0
  50. package/src/components/StudyMeasurements.tsx +88 -0
  51. package/src/components/StudyMeasurementsActions.tsx +75 -0
  52. package/src/components/StudySummaryFromMetadata.test.ts +47 -0
  53. package/src/components/StudySummaryFromMetadata.tsx +31 -0
  54. package/src/components/StudySummaryWithActions.tsx +14 -0
  55. package/src/components/ThresholdMenu/ThresholdMenu.tsx +104 -0
  56. package/src/components/ThresholdMenu/ThresholdMenuWrapper.tsx +85 -0
  57. package/src/components/ThresholdMenu/index.ts +2 -0
  58. package/src/components/TrackingStatus/TrackingStatus.tsx +32 -0
  59. package/src/components/TrackingStatus/index.ts +1 -0
  60. package/src/components/VOIManualControlMenu/VOIManualControlMenu.tsx +190 -0
  61. package/src/components/VOIManualControlMenu/VOIManualControlMenuWrapper.tsx +85 -0
  62. package/src/components/VOIManualControlMenu/index.ts +2 -0
  63. package/src/components/ViewportColorbar/ViewportColorbar.tsx +150 -0
  64. package/src/components/ViewportColorbar/ViewportColorbarsContainer.tsx +125 -0
  65. package/src/components/ViewportColorbar/index.ts +5 -0
  66. package/src/components/ViewportDataOverlaySettingMenu/ViewportDataOverlayMenu.tsx +538 -0
  67. package/src/components/ViewportDataOverlaySettingMenu/ViewportDataOverlayMenuWrapper.tsx +91 -0
  68. package/src/components/ViewportDataOverlaySettingMenu/utils.ts +118 -0
  69. package/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx +249 -0
  70. package/src/components/ViewportOrientationMenu/ViewportOrientationMenuWrapper.tsx +29 -0
  71. package/src/components/ViewportWindowLevel/ViewportWindowLevel.tsx +261 -0
  72. package/src/components/ViewportWindowLevel/getViewportVolumeHistogram.ts +72 -0
  73. package/src/components/ViewportWindowLevel/histogramWorker.js +97 -0
  74. package/src/components/ViewportWindowLevel/index.js +1 -0
  75. package/src/components/ViewportWindowLevel/utils.ts +176 -0
  76. package/src/components/WindowLevelActionMenu/Colorbar.tsx +30 -0
  77. package/src/components/WindowLevelActionMenu/Colormap.tsx +121 -0
  78. package/src/components/WindowLevelActionMenu/VolumeLighting.tsx +82 -0
  79. package/src/components/WindowLevelActionMenu/VolumeRenderingOptions.tsx +38 -0
  80. package/src/components/WindowLevelActionMenu/VolumeRenderingPresets.tsx +36 -0
  81. package/src/components/WindowLevelActionMenu/VolumeRenderingPresetsContent.tsx +78 -0
  82. package/src/components/WindowLevelActionMenu/VolumeRenderingQuality.tsx +64 -0
  83. package/src/components/WindowLevelActionMenu/VolumeShade.tsx +47 -0
  84. package/src/components/WindowLevelActionMenu/VolumeShift.tsx +92 -0
  85. package/src/components/WindowLevelActionMenu/WindowLevel.tsx +157 -0
  86. package/src/components/WindowLevelActionMenu/WindowLevelActionMenu.tsx +102 -0
  87. package/src/components/WindowLevelActionMenu/WindowLevelActionMenuWrapper.tsx +131 -0
  88. package/src/components/WindowLevelActionMenu/defaultWindowLevelPresets.ts +23 -0
  89. package/src/components/WindowLevelActionMenu/index.ts +11 -0
  90. package/src/components/WindowLevelActionMenu/windowLevelPresetHotkeys.test.ts +19 -0
  91. package/src/components/index.ts +12 -0
  92. package/src/constants/index.ts +13 -0
  93. package/src/customizations/CustomDropdownMenuContent.tsx +106 -0
  94. package/src/customizations/CustomSegmentStatisticsHeader.tsx +140 -0
  95. package/src/customizations/captureViewportModalCustomization.tsx +175 -0
  96. package/src/customizations/colorbarCustomization.ts +93 -0
  97. package/src/customizations/gpuSettingsPresetCustomization.ts +8 -0
  98. package/src/customizations/layoutSelectorCustomization.ts +104 -0
  99. package/src/customizations/measurementsCustomization.ts +124 -0
  100. package/src/customizations/miscCustomization.ts +22 -0
  101. package/src/customizations/modalityColorMapCustomization.ts +23 -0
  102. package/src/customizations/segmentationHydrationCustomization.ts +16 -0
  103. package/src/customizations/segmentationPanelCustomization.tsx +119 -0
  104. package/src/customizations/segmentationToolbarCustomization.ts +964 -0
  105. package/src/customizations/toolGroupToolsCustomization.ts +204 -0
  106. package/src/customizations/toolbarButtonsCustomization.ts +805 -0
  107. package/src/customizations/viewportClickCommandsCustomization.ts +15 -0
  108. package/src/customizations/viewportDownloadWarningCustomization.tsx +6 -0
  109. package/src/customizations/viewportOverlayCustomization.tsx +46 -0
  110. package/src/customizations/viewportScrollbarCustomization.tsx +27 -0
  111. package/src/customizations/viewportToolsCustomization.ts +33 -0
  112. package/src/customizations/volumeRenderingCustomization.ts +14 -0
  113. package/src/customizations/windowLevelPresetsCustomization.ts +5 -0
  114. package/src/enums.ts +9 -0
  115. package/src/getCustomizationModule.tsx +54 -0
  116. package/src/getHangingProtocolModule.ts +47 -0
  117. package/src/getPanelModule.tsx +128 -0
  118. package/src/getSopClassHandlerModule.js +284 -0
  119. package/src/getToolbarModule.tsx +622 -0
  120. package/src/hooks/index.ts +8 -0
  121. package/src/hooks/useActiveViewportSegmentationRepresentations.ts +14 -0
  122. package/src/hooks/useMeasurementTracking.ts +132 -0
  123. package/src/hooks/useMeasurements.ts +104 -0
  124. package/src/hooks/useSegmentations.ts +147 -0
  125. package/src/hooks/useViewportDisplaySets.ts +284 -0
  126. package/src/hooks/useViewportHover.ts +77 -0
  127. package/src/hooks/useViewportRendering.tsx +868 -0
  128. package/src/hooks/useViewportSegmentations.ts +245 -0
  129. package/src/hps/fourUp.ts +117 -0
  130. package/src/hps/frameView.ts +1581 -0
  131. package/src/hps/main3D.ts +142 -0
  132. package/src/hps/mpr.ts +197 -0
  133. package/src/hps/mprAnd3DVolumeViewport.ts +124 -0
  134. package/src/hps/only3D.ts +70 -0
  135. package/src/hps/primary3D.ts +142 -0
  136. package/src/hps/primaryAxial.ts +114 -0
  137. package/src/id.js +5 -0
  138. package/src/index.tsx +350 -0
  139. package/src/init.tsx +445 -0
  140. package/src/initCineService.ts +75 -0
  141. package/src/initContextMenu.ts +94 -0
  142. package/src/initCornerstoneTools.js +188 -0
  143. package/src/initDoubleClick.ts +82 -0
  144. package/src/initMeasurementService.ts +576 -0
  145. package/src/initStudyPrefetcherService.ts +33 -0
  146. package/src/initWADOImageLoader.js +56 -0
  147. package/src/panels/PanelMeasurement.tsx +84 -0
  148. package/src/panels/PanelSegmentation.tsx +338 -0
  149. package/src/services/ColorbarService/ColorbarService.ts +242 -0
  150. package/src/services/ColorbarService/index.ts +2 -0
  151. package/src/services/CornerstoneCacheService/CornerstoneCacheService.ts +326 -0
  152. package/src/services/CornerstoneCacheService/index.js +3 -0
  153. package/src/services/SegmentationService/RTSTRUCT/mapROIContoursToRTStructData.ts +36 -0
  154. package/src/services/SegmentationService/SegmentationService.test.ts +3698 -0
  155. package/src/services/SegmentationService/SegmentationService.ts +2376 -0
  156. package/src/services/SegmentationService/backends/ISegmentationBackend.ts +102 -0
  157. package/src/services/SegmentationService/backends/ISegmentationServiceInternals.ts +44 -0
  158. package/src/services/SegmentationService/backends/LegacySegmentationBackend.ts +139 -0
  159. package/src/services/SegmentationService/backends/NextSegmentationBackend.ts +159 -0
  160. package/src/services/SegmentationService/backends/index.ts +4 -0
  161. package/src/services/SegmentationService/index.ts +3 -0
  162. package/src/services/SyncGroupService/SyncGroupService.ts +264 -0
  163. package/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts +118 -0
  164. package/src/services/SyncGroupService/index.js +3 -0
  165. package/src/services/ToolGroupService/ToolGroupService.test.ts +83 -0
  166. package/src/services/ToolGroupService/ToolGroupService.ts +541 -0
  167. package/src/services/ToolGroupService/index.js +3 -0
  168. package/src/services/ViewedDataService/ViewedDataService.ts +58 -0
  169. package/src/services/ViewedDataService/index.ts +3 -0
  170. package/src/services/ViewportService/CornerstoneViewportService.ts +1814 -0
  171. package/src/services/ViewportService/IViewportService.ts +64 -0
  172. package/src/services/ViewportService/Viewport.ts +372 -0
  173. package/src/services/ViewportService/adapter/IViewportAdapter.contract.test.ts +467 -0
  174. package/src/services/ViewportService/adapter/IViewportAdapter.ts +179 -0
  175. package/src/services/ViewportService/adapter/LegacyViewportAdapter.ts +240 -0
  176. package/src/services/ViewportService/adapter/NextViewportAdapter.ts +241 -0
  177. package/src/services/ViewportService/adapter/getViewportAdapter.ts +62 -0
  178. package/src/services/ViewportService/adapter/index.ts +16 -0
  179. package/src/services/ViewportService/backends/IViewportBackend.ts +195 -0
  180. package/src/services/ViewportService/backends/IViewportOperations.ts +98 -0
  181. package/src/services/ViewportService/backends/IViewportServiceInternals.ts +47 -0
  182. package/src/services/ViewportService/backends/LegacyViewportBackend.ts +264 -0
  183. package/src/services/ViewportService/backends/LegacyViewportOperations.ts +272 -0
  184. package/src/services/ViewportService/backends/NextViewportBackend.ts +671 -0
  185. package/src/services/ViewportService/backends/NextViewportOperations.ts +169 -0
  186. package/src/services/ViewportService/backends/README.md +62 -0
  187. package/src/services/ViewportService/backends/dataIdRegistry.ts +121 -0
  188. package/src/services/ViewportService/backends/viewportOperations.ts +71 -0
  189. package/src/services/ViewportService/constants.ts +3 -0
  190. package/src/state.ts +34 -0
  191. package/src/stores/index.ts +5 -0
  192. package/src/stores/presentationUtils.ts +42 -0
  193. package/src/stores/useLutPresentationStore.ts +166 -0
  194. package/src/stores/usePositionPresentationStore.ts +172 -0
  195. package/src/stores/useSegmentationPresentationStore.test.ts +146 -0
  196. package/src/stores/useSegmentationPresentationStore.ts +417 -0
  197. package/src/stores/useSelectedSegmentationsForViewportStore.ts +85 -0
  198. package/src/stores/useSynchronizersStore.ts +84 -0
  199. package/src/synchronizers/frameViewSynchronizer.ts +52 -0
  200. package/src/tools/CalibrationLineTool.ts +97 -0
  201. package/src/tools/ImageOverlayViewerTool.tsx +279 -0
  202. package/src/tools/OverlayPlaneModuleProvider.ts +40 -0
  203. package/src/tools/WindowLevelTool.test.ts +55 -0
  204. package/src/tools/WindowLevelTool.ts +22 -0
  205. package/src/types/AppTypes.ts +70 -0
  206. package/src/types/Colorbar.ts +114 -0
  207. package/src/types/Colormap.ts +16 -0
  208. package/src/types/CornerstoneCacheService.ts +40 -0
  209. package/src/types/CornerstoneServices.ts +18 -0
  210. package/src/types/Presentation.ts +83 -0
  211. package/src/types/SelectedSegmentationByTypeMap.ts +3 -0
  212. package/src/types/ViewportPresets.ts +53 -0
  213. package/src/types/VolumeLighting.ts +7 -0
  214. package/src/types/VolumeRenderingConfig.ts +8 -0
  215. package/src/types/WindowLevel.ts +5 -0
  216. package/src/types/index.ts +10 -0
  217. package/src/utils/ActiveViewportBehavior.tsx +80 -0
  218. package/src/utils/CornerstoneViewportDownloadForm.tsx +319 -0
  219. package/src/utils/DicomFileUploader.ts +204 -0
  220. package/src/utils/JumpPresets.ts +14 -0
  221. package/src/utils/autoHydrateViewportTypes.ts +69 -0
  222. package/src/utils/colormaps.js +1597 -0
  223. package/src/utils/createSegmentationForViewport.ts +83 -0
  224. package/src/utils/dicomLoaderService.js +225 -0
  225. package/src/utils/ecgMetadata.test.ts +137 -0
  226. package/src/utils/ecgMetadata.ts +109 -0
  227. package/src/utils/findNearbyToolData.test.ts +125 -0
  228. package/src/utils/findNearbyToolData.ts +21 -0
  229. package/src/utils/generateSegmentationCSVReport.test.ts +324 -0
  230. package/src/utils/generateSegmentationCSVReport.ts +131 -0
  231. package/src/utils/getActiveViewportEnabledElement.test.ts +70 -0
  232. package/src/utils/getActiveViewportEnabledElement.ts +8 -0
  233. package/src/utils/getCenterExtent.test.ts +313 -0
  234. package/src/utils/getCenterExtent.ts +46 -0
  235. package/src/utils/getCornerstoneBlendMode.test.ts +59 -0
  236. package/src/utils/getCornerstoneBlendMode.ts +25 -0
  237. package/src/utils/getCornerstoneOrientation.test.ts +78 -0
  238. package/src/utils/getCornerstoneOrientation.ts +31 -0
  239. package/src/utils/getCornerstoneViewportType.test.ts +169 -0
  240. package/src/utils/getCornerstoneViewportType.ts +88 -0
  241. package/src/utils/getInterleavedFrames.test.ts +85 -0
  242. package/src/utils/getInterleavedFrames.ts +73 -0
  243. package/src/utils/getLegacyViewportType.ts +64 -0
  244. package/src/utils/getNthFrames.test.ts +145 -0
  245. package/src/utils/getNthFrames.ts +31 -0
  246. package/src/utils/getViewportEnabledElement.test.ts +83 -0
  247. package/src/utils/getViewportEnabledElement.ts +8 -0
  248. package/src/utils/getViewportOrientationFromImageOrientationPatient.test.ts +50 -0
  249. package/src/utils/getViewportOrientationFromImageOrientationPatient.ts +56 -0
  250. package/src/utils/hydrationUtils.test.ts +572 -0
  251. package/src/utils/hydrationUtils.ts +197 -0
  252. package/src/utils/imageSliceSync/calculateViewportRegistrations.ts +28 -0
  253. package/src/utils/imageSliceSync/toggleImageSliceSync.ts +101 -0
  254. package/src/utils/index.ts +29 -0
  255. package/src/utils/initGpuSettingsPreset.ts +51 -0
  256. package/src/utils/initViewTiming.test.ts +342 -0
  257. package/src/utils/initViewTiming.ts +52 -0
  258. package/src/utils/initWebWorkerProgressHandler.test.ts +381 -0
  259. package/src/utils/initWebWorkerProgressHandler.ts +110 -0
  260. package/src/utils/interleave.test.ts +304 -0
  261. package/src/utils/interleave.ts +32 -0
  262. package/src/utils/interleaveCenterLoader.test.ts +547 -0
  263. package/src/utils/interleaveCenterLoader.ts +143 -0
  264. package/src/utils/interleaveTopToBottom.test.ts +487 -0
  265. package/src/utils/interleaveTopToBottom.ts +132 -0
  266. package/src/utils/isAnyDisplaySetCommon.ts +18 -0
  267. package/src/utils/isDisplaySetOverlayable.ts +96 -0
  268. package/src/utils/isMeasurementWithinViewport.test.ts +340 -0
  269. package/src/utils/isMeasurementWithinViewport.ts +33 -0
  270. package/src/utils/isReferenceViewable.test.ts +581 -0
  271. package/src/utils/isReferenceViewable.ts +95 -0
  272. package/src/utils/loadDisplaySetData.ts +49 -0
  273. package/src/utils/measurementServiceMappings/Angle.ts +200 -0
  274. package/src/utils/measurementServiceMappings/ArrowAnnotate.ts +176 -0
  275. package/src/utils/measurementServiceMappings/Bidirectional.ts +193 -0
  276. package/src/utils/measurementServiceMappings/CircleROI.ts +227 -0
  277. package/src/utils/measurementServiceMappings/CobbAngle.ts +206 -0
  278. package/src/utils/measurementServiceMappings/EllipticalROI.ts +221 -0
  279. package/src/utils/measurementServiceMappings/Length.ts +206 -0
  280. package/src/utils/measurementServiceMappings/LivewireContour.ts +175 -0
  281. package/src/utils/measurementServiceMappings/PlanarFreehandROI.ts +228 -0
  282. package/src/utils/measurementServiceMappings/Probe.ts +192 -0
  283. package/src/utils/measurementServiceMappings/RectangleROI.ts +225 -0
  284. package/src/utils/measurementServiceMappings/SegmentBidirectional.ts +184 -0
  285. package/src/utils/measurementServiceMappings/SplineROI.ts +227 -0
  286. package/src/utils/measurementServiceMappings/UltrasoundDirectional.ts +214 -0
  287. package/src/utils/measurementServiceMappings/UltrasoundPleuraBLine.ts +179 -0
  288. package/src/utils/measurementServiceMappings/constants/supportedTools.js +21 -0
  289. package/src/utils/measurementServiceMappings/index.ts +3 -0
  290. package/src/utils/measurementServiceMappings/measurementServiceMappingsFactory.ts +324 -0
  291. package/src/utils/measurementServiceMappings/utils/getDisplayUnit.js +3 -0
  292. package/src/utils/measurementServiceMappings/utils/getHandlesFromPoints.js +14 -0
  293. package/src/utils/measurementServiceMappings/utils/getIsLocked.ts +5 -0
  294. package/src/utils/measurementServiceMappings/utils/getIsVisible.ts +6 -0
  295. package/src/utils/measurementServiceMappings/utils/getSOPInstanceAttributes.js +66 -0
  296. package/src/utils/measurementServiceMappings/utils/getValueDisplayString.js +12 -0
  297. package/src/utils/measurementServiceMappings/utils/index.ts +17 -0
  298. package/src/utils/measurementServiceMappings/utils/selection.ts +33 -0
  299. package/src/utils/mpr/getProtocolViewportStructureFromGridViewports.ts +74 -0
  300. package/src/utils/nextViewportPolicies.ts +41 -0
  301. package/src/utils/nextViewports.ts +157 -0
  302. package/src/utils/nthLoader.test.ts +317 -0
  303. package/src/utils/nthLoader.ts +78 -0
  304. package/src/utils/presentations/getViewportPresentations.test.ts +280 -0
  305. package/src/utils/presentations/getViewportPresentations.ts +151 -0
  306. package/src/utils/promptHydrationDialog.test.ts +490 -0
  307. package/src/utils/promptHydrationDialog.ts +197 -0
  308. package/src/utils/removeViewportSegmentationRepresentations.test.ts +129 -0
  309. package/src/utils/removeViewportSegmentationRepresentations.ts +17 -0
  310. package/src/utils/segmentUtils.test.ts +515 -0
  311. package/src/utils/segmentUtils.ts +46 -0
  312. package/src/utils/segmentationExportUtils.test.ts +100 -0
  313. package/src/utils/segmentationExportUtils.ts +171 -0
  314. package/src/utils/segmentationHandlers.test.ts +614 -0
  315. package/src/utils/segmentationHandlers.ts +164 -0
  316. package/src/utils/setUpAnnotationEventHandlers.ts +26 -0
  317. package/src/utils/setUpSegmentationEventHandlers.test.ts +372 -0
  318. package/src/utils/setUpSegmentationEventHandlers.ts +122 -0
  319. package/src/utils/toggleVOISliceSync.test.ts +606 -0
  320. package/src/utils/toggleVOISliceSync.ts +103 -0
  321. package/src/utils/transitions.test.ts +351 -0
  322. package/src/utils/transitions.ts +300 -0
  323. package/src/utils/updateSegmentationStats.test.ts +942 -0
  324. package/src/utils/updateSegmentationStats.ts +192 -0
  325. package/src/utils/viewportDataShape.ts +85 -0
@@ -0,0 +1,487 @@
1
+ import { cache, imageLoadPoolManager, Enums } from '@cornerstonejs/core';
2
+ import zip from 'lodash.zip';
3
+ import compact from 'lodash.compact';
4
+ import flatten from 'lodash.flatten';
5
+ import interleaveTopToBottom from './interleaveTopToBottom';
6
+
7
+ jest.mock('@cornerstonejs/core', () => ({
8
+ cache: {
9
+ getVolume: jest.fn(),
10
+ },
11
+ imageLoadPoolManager: {
12
+ addRequest: jest.fn(),
13
+ },
14
+ Enums: {
15
+ RequestType: {
16
+ Prefetch: 'Prefetch',
17
+ },
18
+ },
19
+ }));
20
+
21
+ jest.mock('lodash.zip', () => jest.fn());
22
+ jest.mock('lodash.compact', () => jest.fn());
23
+ jest.mock('lodash.flatten', () => jest.fn());
24
+
25
+ describe('interleaveTopToBottom', () => {
26
+ const mockVolumeInput = {
27
+ volumeId: 'test-volume-id',
28
+ };
29
+
30
+ const mockVolume = {
31
+ metadata: {
32
+ SeriesInstanceUID: 'test-series-uid',
33
+ },
34
+ getImageLoadRequests: jest.fn(),
35
+ };
36
+
37
+ const mockImageLoadRequest = {
38
+ imageId: 'test-image-id',
39
+ callLoadImage: jest.fn(),
40
+ additionalDetails: 'test-details',
41
+ imageIdIndex: 0,
42
+ options: { test: 'option' },
43
+ };
44
+
45
+ const mockDisplaySetsInfo = [
46
+ {
47
+ displaySetInstanceUID: 'display-set-1',
48
+ displaySetOptions: {},
49
+ },
50
+ ];
51
+
52
+ const mockMatchDetails = new Map([
53
+ [
54
+ 'viewport-1',
55
+ {
56
+ displaySetsInfo: mockDisplaySetsInfo,
57
+ },
58
+ ],
59
+ ]);
60
+
61
+ const defaultParameters = {
62
+ data: {
63
+ viewportId: 'test-viewport-id',
64
+ volumeInputArray: [mockVolumeInput],
65
+ },
66
+ displaySetsMatchDetails: {},
67
+ viewportMatchDetails: mockMatchDetails,
68
+ };
69
+
70
+ beforeEach(() => {
71
+ jest.clearAllMocks();
72
+ (cache.getVolume as jest.Mock).mockReturnValue(mockVolume);
73
+ mockVolume.getImageLoadRequests.mockReturnValue([mockImageLoadRequest]);
74
+ (zip as jest.Mock).mockImplementation((...args) => args[0]);
75
+ (compact as jest.Mock).mockImplementation(input => input?.filter(Boolean) ?? []);
76
+ (flatten as jest.Mock).mockImplementation(input => input?.flat() ?? []);
77
+ });
78
+
79
+ it('should store viewport and volume input array mapping', () => {
80
+ interleaveTopToBottom(defaultParameters);
81
+
82
+ expect(cache.getVolume).toHaveBeenCalledWith(mockVolumeInput.volumeId);
83
+ });
84
+
85
+ it('should return early when volume is not found', () => {
86
+ (cache.getVolume as jest.Mock).mockReturnValue(null);
87
+
88
+ const result = interleaveTopToBottom(defaultParameters);
89
+
90
+ expect(result).toBeUndefined();
91
+ expect(mockVolume.getImageLoadRequests).not.toHaveBeenCalled();
92
+ });
93
+
94
+ it('should process volume input array and create image load requests', () => {
95
+ const result = interleaveTopToBottom(defaultParameters);
96
+
97
+ expect(cache.getVolume).toHaveBeenCalledWith(mockVolumeInput.volumeId);
98
+ expect(mockVolume.getImageLoadRequests).toHaveBeenCalled();
99
+ expect(zip).toHaveBeenCalled();
100
+ expect(compact).toHaveBeenCalled();
101
+ expect(flatten).toHaveBeenCalled();
102
+ expect(result).toBeInstanceOf(Map);
103
+ });
104
+
105
+ it('should process displaySets without skipLoading option', () => {
106
+ const mockMatchDetailsWithoutSkipLoading = new Map([
107
+ [
108
+ 'viewport-1',
109
+ {
110
+ displaySetsInfo: [
111
+ {
112
+ displaySetInstanceUID: 'display-set-1',
113
+ displaySetOptions: { options: { skipLoading: false } },
114
+ },
115
+ ],
116
+ },
117
+ ],
118
+ ]);
119
+
120
+ const result = interleaveTopToBottom({
121
+ ...defaultParameters,
122
+ viewportMatchDetails: mockMatchDetailsWithoutSkipLoading,
123
+ });
124
+
125
+ expect(result).toBeInstanceOf(Map);
126
+ });
127
+
128
+ it('should return early when viewport volume display set UIDs size does not match', () => {
129
+ const mockMatchDetailsWithDifferentSize = new Map([
130
+ [
131
+ 'viewport-1',
132
+ {
133
+ displaySetsInfo: [
134
+ {
135
+ displaySetInstanceUID: 'display-set-1',
136
+ },
137
+ {
138
+ displaySetInstanceUID: 'display-set-2',
139
+ },
140
+ ],
141
+ },
142
+ ],
143
+ ]);
144
+
145
+ const result = interleaveTopToBottom({
146
+ ...defaultParameters,
147
+ viewportMatchDetails: mockMatchDetailsWithDifferentSize,
148
+ });
149
+
150
+ expect(result).toBeUndefined();
151
+ });
152
+
153
+ it('should handle multiple volume inputs', () => {
154
+ const mockVolumeInput2 = {
155
+ volumeId: 'test-volume-id-2',
156
+ };
157
+
158
+ const mockVolume2 = {
159
+ metadata: {
160
+ SeriesInstanceUID: 'test-series-uid-2',
161
+ },
162
+ getImageLoadRequests: jest.fn().mockReturnValue([mockImageLoadRequest]),
163
+ };
164
+
165
+ (cache.getVolume as jest.Mock)
166
+ .mockReturnValueOnce(mockVolume)
167
+ .mockReturnValueOnce(mockVolume2)
168
+ .mockReturnValueOnce(mockVolume)
169
+ .mockReturnValueOnce(mockVolume2);
170
+
171
+ const mockMatchDetailsWithMultipleVolumes = new Map([
172
+ [
173
+ 'viewport-1',
174
+ {
175
+ displaySetsInfo: [
176
+ { displaySetInstanceUID: 'test-volume-id' },
177
+ { displaySetInstanceUID: 'test-volume-id-2' },
178
+ ],
179
+ },
180
+ ],
181
+ ]);
182
+
183
+ interleaveTopToBottom({
184
+ ...defaultParameters,
185
+ data: {
186
+ ...defaultParameters.data,
187
+ volumeInputArray: [mockVolumeInput, mockVolumeInput2],
188
+ },
189
+ viewportMatchDetails: mockMatchDetailsWithMultipleVolumes,
190
+ });
191
+
192
+ expect(cache.getVolume).toHaveBeenCalledWith(mockVolumeInput.volumeId);
193
+ expect(cache.getVolume).toHaveBeenCalledWith(mockVolumeInput2.volumeId);
194
+ });
195
+
196
+ it('should add requests to imageLoadPoolManager with correct parameters', () => {
197
+ interleaveTopToBottom(defaultParameters);
198
+
199
+ expect(imageLoadPoolManager.addRequest).toHaveBeenCalledWith(
200
+ expect.any(Function),
201
+ Enums.RequestType.Prefetch,
202
+ mockImageLoadRequest.additionalDetails,
203
+ 0
204
+ );
205
+ });
206
+
207
+ it('should bind callLoadImage with correct parameters', () => {
208
+ interleaveTopToBottom(defaultParameters);
209
+
210
+ const addRequestCall = (imageLoadPoolManager.addRequest as jest.Mock).mock.calls[0];
211
+ const boundFunction = addRequestCall[0];
212
+
213
+ boundFunction();
214
+
215
+ expect(mockImageLoadRequest.callLoadImage).toHaveBeenCalledWith(
216
+ mockImageLoadRequest.imageId,
217
+ mockImageLoadRequest.imageIdIndex,
218
+ mockImageLoadRequest.options
219
+ );
220
+ });
221
+
222
+ it('should handle volumes without image load requests', () => {
223
+ mockVolume.getImageLoadRequests.mockReturnValue(null);
224
+
225
+ const result = interleaveTopToBottom(defaultParameters);
226
+
227
+ expect(zip).toHaveBeenCalledWith();
228
+ expect(result).toBeInstanceOf(Map);
229
+ });
230
+
231
+ it('should handle volumes with empty image load requests', () => {
232
+ mockVolume.getImageLoadRequests.mockReturnValue([]);
233
+
234
+ const result = interleaveTopToBottom(defaultParameters);
235
+
236
+ expect(zip).toHaveBeenCalledWith();
237
+ expect(result).toBeInstanceOf(Map);
238
+ });
239
+
240
+ it('should handle volumes with requests without imageId', () => {
241
+ const requestWithoutImageId = {
242
+ callLoadImage: jest.fn(),
243
+ additionalDetails: 'test-details',
244
+ };
245
+
246
+ mockVolume.getImageLoadRequests.mockReturnValue([requestWithoutImageId]);
247
+
248
+ const result = interleaveTopToBottom(defaultParameters);
249
+
250
+ expect(zip).toHaveBeenCalledWith();
251
+ expect(result).toBeInstanceOf(Map);
252
+ });
253
+
254
+ it('should reverse the requests before adding to AllRequests', () => {
255
+ const mockRequests = [
256
+ { imageId: 'image-1', callLoadImage: jest.fn() },
257
+ { imageId: 'image-2', callLoadImage: jest.fn() },
258
+ ];
259
+
260
+ mockVolume.getImageLoadRequests.mockReturnValue(mockRequests);
261
+
262
+ interleaveTopToBottom(defaultParameters);
263
+
264
+ expect(mockVolume.getImageLoadRequests).toHaveBeenCalled();
265
+ });
266
+
267
+ it('should handle duplicate volume IDs by not adding them again', () => {
268
+ const duplicateVolumeInput = {
269
+ volumeId: mockVolumeInput.volumeId,
270
+ };
271
+
272
+ interleaveTopToBottom({
273
+ ...defaultParameters,
274
+ data: {
275
+ ...defaultParameters.data,
276
+ volumeInputArray: [mockVolumeInput, duplicateVolumeInput],
277
+ },
278
+ });
279
+
280
+ expect(cache.getVolume).toHaveBeenCalledTimes(3);
281
+ });
282
+
283
+ it('should clear internal maps after processing', () => {
284
+ const firstResult = interleaveTopToBottom(defaultParameters);
285
+ const secondResult = interleaveTopToBottom(defaultParameters);
286
+
287
+ expect(firstResult).toBeInstanceOf(Map);
288
+ expect(secondResult).toBeInstanceOf(Map);
289
+ });
290
+
291
+ it('should handle multiple match details with different displaySets', () => {
292
+ const mockMultipleMatchDetails = new Map([
293
+ [
294
+ 'viewport-1',
295
+ {
296
+ displaySetsInfo: [{ displaySetInstanceUID: 'display-set-1' }],
297
+ },
298
+ ],
299
+ [
300
+ 'viewport-2',
301
+ {
302
+ displaySetsInfo: [{ displaySetInstanceUID: 'display-set-2' }],
303
+ },
304
+ ],
305
+ ]);
306
+
307
+ const result = interleaveTopToBottom({
308
+ ...defaultParameters,
309
+ viewportMatchDetails: mockMultipleMatchDetails,
310
+ });
311
+
312
+ expect(result).toBeUndefined();
313
+ });
314
+
315
+ it('should handle undefined displaySetOptions', () => {
316
+ const mockMatchDetailsWithUndefinedOptions = new Map([
317
+ [
318
+ 'viewport-1',
319
+ {
320
+ displaySetsInfo: [
321
+ {
322
+ displaySetInstanceUID: 'display-set-1',
323
+ displaySetOptions: undefined,
324
+ },
325
+ ],
326
+ },
327
+ ],
328
+ ]);
329
+
330
+ const result = interleaveTopToBottom({
331
+ ...defaultParameters,
332
+ viewportMatchDetails: mockMatchDetailsWithUndefinedOptions,
333
+ });
334
+
335
+ expect(result).toBeInstanceOf(Map);
336
+ });
337
+
338
+ it('should handle displaySetOptions without options property', () => {
339
+ const mockMatchDetailsWithoutOptionsProperty = new Map([
340
+ [
341
+ 'viewport-1',
342
+ {
343
+ displaySetsInfo: [
344
+ {
345
+ displaySetInstanceUID: 'display-set-1',
346
+ displaySetOptions: { someOtherProperty: 'value' },
347
+ },
348
+ ],
349
+ },
350
+ ],
351
+ ]);
352
+
353
+ const result = interleaveTopToBottom({
354
+ ...defaultParameters,
355
+ viewportMatchDetails: mockMatchDetailsWithoutOptionsProperty,
356
+ });
357
+
358
+ expect(result).toBeInstanceOf(Map);
359
+ });
360
+
361
+ it('should handle empty match details', () => {
362
+ const emptyMatchDetails = new Map();
363
+
364
+ const result = interleaveTopToBottom({
365
+ ...defaultParameters,
366
+ viewportMatchDetails: emptyMatchDetails,
367
+ });
368
+
369
+ expect(result).toBeUndefined();
370
+ });
371
+
372
+ it('should handle empty volumeInputArray', () => {
373
+ const result = interleaveTopToBottom({
374
+ ...defaultParameters,
375
+ data: {
376
+ ...defaultParameters.data,
377
+ volumeInputArray: [],
378
+ },
379
+ });
380
+
381
+ expect(result).toBeUndefined();
382
+ });
383
+
384
+ it('should handle interleavedRequests processing correctly', () => {
385
+ const mockRequest1 = { imageId: 'image-1', callLoadImage: jest.fn() };
386
+ const mockRequest2 = { imageId: 'image-2', callLoadImage: jest.fn() };
387
+
388
+ mockVolume.getImageLoadRequests.mockReturnValue([mockRequest1, mockRequest2]);
389
+ (compact as jest.Mock).mockReturnValue([mockRequest1, mockRequest2]);
390
+ (flatten as jest.Mock).mockReturnValue([mockRequest1, mockRequest2]);
391
+
392
+ interleaveTopToBottom(defaultParameters);
393
+
394
+ expect(imageLoadPoolManager.addRequest).toHaveBeenCalledTimes(2);
395
+ });
396
+
397
+ it('should return copy of viewport volume input array map', () => {
398
+ const result = interleaveTopToBottom(defaultParameters);
399
+
400
+ expect(result.has(defaultParameters.data.viewportId)).toBe(true);
401
+ expect(result.get(defaultParameters.data.viewportId)).toEqual(
402
+ defaultParameters.data.volumeInputArray
403
+ );
404
+ });
405
+
406
+ it('should process different viewport IDs separately', () => {
407
+ const firstResult = interleaveTopToBottom({
408
+ ...defaultParameters,
409
+ data: {
410
+ viewportId: 'viewport-1',
411
+ volumeInputArray: [mockVolumeInput],
412
+ },
413
+ });
414
+
415
+ const secondResult = interleaveTopToBottom({
416
+ ...defaultParameters,
417
+ data: {
418
+ viewportId: 'viewport-2',
419
+ volumeInputArray: [mockVolumeInput],
420
+ },
421
+ });
422
+
423
+ expect(firstResult.has('viewport-1')).toBe(true);
424
+ expect(secondResult.has('viewport-2')).toBe(true);
425
+ });
426
+
427
+ it('should handle requests with missing properties gracefully', () => {
428
+ const incompleteRequest = {
429
+ imageId: 'test-image-id',
430
+ callLoadImage: jest.fn(),
431
+ };
432
+
433
+ mockVolume.getImageLoadRequests.mockReturnValue([incompleteRequest]);
434
+ (compact as jest.Mock).mockReturnValue([incompleteRequest]);
435
+ (flatten as jest.Mock).mockReturnValue([incompleteRequest]);
436
+
437
+ interleaveTopToBottom(defaultParameters);
438
+
439
+ expect(imageLoadPoolManager.addRequest).toHaveBeenCalledWith(
440
+ expect.any(Function),
441
+ Enums.RequestType.Prefetch,
442
+ undefined,
443
+ 0
444
+ );
445
+ });
446
+
447
+ it('should handle multiple volumes with same requests', () => {
448
+ const mockVolume2 = {
449
+ metadata: { SeriesInstanceUID: 'test-series-uid-2' },
450
+ getImageLoadRequests: jest.fn().mockReturnValue([mockImageLoadRequest]),
451
+ };
452
+
453
+ const mockVolumeInput2 = { volumeId: 'test-volume-id-2' };
454
+
455
+ (cache.getVolume as jest.Mock)
456
+ .mockReturnValueOnce(mockVolume)
457
+ .mockReturnValueOnce(mockVolume2)
458
+ .mockReturnValueOnce(mockVolume)
459
+ .mockReturnValueOnce(mockVolume2);
460
+
461
+ const mockMatchDetailsWithBothVolumes = new Map([
462
+ [
463
+ 'viewport-1',
464
+ {
465
+ displaySetsInfo: [
466
+ { displaySetInstanceUID: 'test-volume-id' },
467
+ { displaySetInstanceUID: 'test-volume-id-2' },
468
+ ],
469
+ },
470
+ ],
471
+ ]);
472
+
473
+ (compact as jest.Mock).mockReturnValue([mockImageLoadRequest]);
474
+ (flatten as jest.Mock).mockReturnValue([mockImageLoadRequest]);
475
+
476
+ interleaveTopToBottom({
477
+ ...defaultParameters,
478
+ data: {
479
+ ...defaultParameters.data,
480
+ volumeInputArray: [mockVolumeInput, mockVolumeInput2],
481
+ },
482
+ viewportMatchDetails: mockMatchDetailsWithBothVolumes,
483
+ });
484
+
485
+ expect(imageLoadPoolManager.addRequest).toHaveBeenCalledTimes(2);
486
+ });
487
+ });
@@ -0,0 +1,132 @@
1
+ import { cache, imageLoadPoolManager, Enums } from '@cornerstonejs/core';
2
+ import zip from 'lodash.zip';
3
+ import compact from 'lodash.compact';
4
+ import flatten from 'lodash.flatten';
5
+
6
+ // Map of volumeId and SeriesInstanceId
7
+ const volumeIdMapsToLoad = new Map<string, string>();
8
+ const viewportIdVolumeInputArrayMap = new Map<string, unknown[]>();
9
+
10
+ /**
11
+ * This function caches the volumeIds until all the volumes inside the
12
+ * hanging protocol are initialized. Then it goes through the imageIds
13
+ * of the volumes, and interleave them, in order for the volumes to be loaded
14
+ * together from middle to the start and the end.
15
+ * @param {Object} {viewportData, displaySetMatchDetails}
16
+ * @returns
17
+ */
18
+ export default function interleaveTopToBottom({
19
+ data: { viewportId, volumeInputArray },
20
+ displaySetsMatchDetails,
21
+ viewportMatchDetails: matchDetails,
22
+ }) {
23
+ viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
24
+
25
+ // Based on the volumeInputs store the volumeIds and SeriesInstanceIds
26
+ // to keep track of the volumes being loaded
27
+ for (const volumeInput of volumeInputArray) {
28
+ const { volumeId } = volumeInput;
29
+ const volume = cache.getVolume(volumeId);
30
+
31
+ if (!volume) {
32
+ return;
33
+ }
34
+
35
+ // if the volumeUID is not in the volumeUIDs array, add it
36
+ if (!volumeIdMapsToLoad.has(volumeId)) {
37
+ const { metadata } = volume;
38
+ volumeIdMapsToLoad.set(volumeId, metadata.SeriesInstanceUID);
39
+ }
40
+ }
41
+
42
+ /**
43
+ * The following is checking if all the viewports that were matched in the HP has been
44
+ * successfully created their cornerstone viewport or not. Todo: This can be
45
+ * improved by not checking it, and as soon as the matched DisplaySets have their
46
+ * volume loaded, we start the loading, but that comes at the cost of viewports
47
+ * not being created yet (e.g., in a 10 viewport ptCT fusion, when one ct viewport and one
48
+ * pt viewport are created we have a guarantee that the volumes are created in the cache
49
+ * but the rest of the viewports (fusion, mip etc.) are not created yet. So
50
+ * we can't initiate setting the volumes for those viewports. One solution can be
51
+ * to add an event when a viewport is created (not enabled element event) and then
52
+ * listen to it and as the other viewports are created we can set the volumes for them
53
+ * since volumes are already started loading.
54
+ */
55
+ const uniqueViewportVolumeDisplaySetUIDs = new Set();
56
+ viewportIdVolumeInputArrayMap.forEach((volumeInputArray, viewportId) => {
57
+ volumeInputArray.forEach(volumeInput => {
58
+ const { volumeId } = volumeInput;
59
+ uniqueViewportVolumeDisplaySetUIDs.add(volumeId);
60
+ });
61
+ });
62
+
63
+ const uniqueMatchedDisplaySetUIDs = new Set();
64
+
65
+ matchDetails.forEach(matchDetail => {
66
+ const { displaySetsInfo } = matchDetail;
67
+ displaySetsInfo.forEach(({ displaySetInstanceUID }) => {
68
+ uniqueMatchedDisplaySetUIDs.add(displaySetInstanceUID);
69
+ });
70
+ });
71
+
72
+ if (uniqueViewportVolumeDisplaySetUIDs.size !== uniqueMatchedDisplaySetUIDs.size) {
73
+ return;
74
+ }
75
+
76
+ const volumeIds = Array.from(volumeIdMapsToLoad.keys()).slice();
77
+ // get volumes from cache
78
+ const volumes = volumeIds.map(volumeId => {
79
+ return cache.getVolume(volumeId);
80
+ });
81
+
82
+ // iterate over all volumes, and get their imageIds, and interleave
83
+ // the imageIds and save them in AllRequests for later use
84
+ const AllRequests = [];
85
+ volumes.forEach(volume => {
86
+ const requests = volume.getImageLoadRequests?.() ?? [];
87
+
88
+ if (!requests?.[0]?.imageId) {
89
+ return;
90
+ }
91
+
92
+ // reverse the requests
93
+ AllRequests.push(requests.reverse());
94
+ });
95
+
96
+ // flatten the AllRequests array, which will result in a list of all the
97
+ // imageIds for all the volumes but interleaved
98
+ const interleavedRequests = compact(flatten(zip(...AllRequests)));
99
+
100
+ // set the finalRequests to the imageLoadPoolManager
101
+ const finalRequests = [];
102
+ interleavedRequests.forEach(request => {
103
+ const { imageId } = request;
104
+
105
+ AllRequests.forEach(volumeRequests => {
106
+ const volumeImageIdRequest = volumeRequests.find(req => req.imageId === imageId);
107
+ if (volumeImageIdRequest) {
108
+ finalRequests.push(volumeImageIdRequest);
109
+ }
110
+ });
111
+ });
112
+
113
+ const requestType = Enums.RequestType.Prefetch;
114
+ const priority = 0;
115
+
116
+ finalRequests.forEach(({ callLoadImage, additionalDetails, imageId, imageIdIndex, options }) => {
117
+ const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
118
+
119
+ imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
120
+ });
121
+
122
+ // clear the volumeIdMapsToLoad
123
+ volumeIdMapsToLoad.clear();
124
+
125
+ // copy the viewportIdVolumeInputArrayMap
126
+ const viewportIdVolumeInputArrayMapCopy = new Map(viewportIdVolumeInputArrayMap);
127
+
128
+ // reset the viewportIdVolumeInputArrayMap
129
+ viewportIdVolumeInputArrayMap.clear();
130
+
131
+ return viewportIdVolumeInputArrayMapCopy;
132
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Checks whether two viewports share at least one common display set.
3
+ *
4
+ * This method checks to see if the source and target share a display set.
5
+ * It performs an O(n * m) comparison between the display sets of each viewport.
6
+ * Since each viewport typically contains only a small number of display sets (≤ 5),
7
+ * the computational cost is negligible.
8
+ *
9
+ * @param sourceDisplaySetUIDs - Array of displaySetInstanceUID from the source viewport.
10
+ * @param targetDisplaySetUIDs - Array of displaySetInstanceUID from the target viewport.
11
+ * @returns true if at least one display set is common; false otherwise.
12
+ */
13
+ export function isAnyDisplaySetCommon(
14
+ sourceDisplaySetUIDs: string[],
15
+ targetDisplaySetUIDs: string[]
16
+ ): boolean {
17
+ return sourceDisplaySetUIDs.some(uid => targetDisplaySetUIDs.includes(uid));
18
+ }