From c09311d3b7df05fcd00a9f36a7233e9d7e5589d0 Mon Sep 17 00:00:00 2001 From: Ibrahim <93064150+IbrahimCSAE@users.noreply.github.com> Date: Sat, 27 Apr 2024 21:50:28 -0400 Subject: [PATCH] fix(bugs): fix patient header for doc, track ball rotate resize observer and add segmentation button not being enabled on viewport data change (#4068) --- extensions/cornerstone-dicom-seg/package.json | 4 +- .../src/panels/PanelSegmentation.tsx | 31 +++++-- extensions/cornerstone-dicom-sr/package.json | 6 +- .../cornerstone-dynamic-volume/package.json | 6 +- extensions/cornerstone/package.json | 10 +-- extensions/measurement-tracking/package.json | 4 +- platform/app/package.json | 2 +- platform/core/package.json | 2 +- .../HeaderPatientInfo/HeaderPatientInfo.tsx | 10 +-- yarn.lock | 89 +++++++++++++------ 10 files changed, 107 insertions(+), 57 deletions(-) diff --git a/extensions/cornerstone-dicom-seg/package.json b/extensions/cornerstone-dicom-seg/package.json index c4fd1efbbe8..93d80e71fe8 100644 --- a/extensions/cornerstone-dicom-seg/package.json +++ b/extensions/cornerstone-dicom-seg/package.json @@ -46,8 +46,8 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/adapters": "^1.70.12", - "@cornerstonejs/core": "^1.70.12", + "@cornerstonejs/adapters": "^1.70.13", + "@cornerstonejs/core": "^1.70.13", "@kitware/vtk.js": "30.3.3", "react-color": "^2.19.3" } diff --git a/extensions/cornerstone-dicom-seg/src/panels/PanelSegmentation.tsx b/extensions/cornerstone-dicom-seg/src/panels/PanelSegmentation.tsx index ba10362faa8..9dd15e8f29f 100644 --- a/extensions/cornerstone-dicom-seg/src/panels/PanelSegmentation.tsx +++ b/extensions/cornerstone-dicom-seg/src/panels/PanelSegmentation.tsx @@ -18,8 +18,13 @@ export default function PanelSegmentation({ extensionManager, configuration, }) { - const { segmentationService, viewportGridService, uiDialogService, displaySetService } = - servicesManager.services; + const { + segmentationService, + viewportGridService, + uiDialogService, + displaySetService, + cornerstoneViewportService, + } = servicesManager.services; const { t } = useTranslation('PanelSegmentation'); @@ -82,21 +87,33 @@ export default function PanelSegmentation({ // Handle initial state handleActiveViewportChange(); - const changed = viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED; + const changedGrid = viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED; const ready = viewportGridService.EVENTS.VIEWPORTS_READY; - const subs = []; - [ready, changed].forEach(evt => { + const subsGrid = []; + [ready, changedGrid].forEach(evt => { const { unsubscribe } = viewportGridService.subscribe(evt, ({ viewportId }) => { handleActiveViewportChange(viewportId); }); - subs.push(unsubscribe); + subsGrid.push(unsubscribe); + }); + + const changedData = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED; + + const subsData = []; + [changedData].forEach(evt => { + const { unsubscribe } = cornerstoneViewportService.subscribe(evt, () => { + handleActiveViewportChange(); + }); + + subsData.push(unsubscribe); }); // Clean up return () => { - subs.forEach(unsub => unsub()); + subsGrid.forEach(unsub => unsub()); + subsData.forEach(unsub => unsub()); }; }, []); diff --git a/extensions/cornerstone-dicom-sr/package.json b/extensions/cornerstone-dicom-sr/package.json index 51898f77760..2bcda428e30 100644 --- a/extensions/cornerstone-dicom-sr/package.json +++ b/extensions/cornerstone-dicom-sr/package.json @@ -46,9 +46,9 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/adapters": "^1.70.12", - "@cornerstonejs/core": "^1.70.12", - "@cornerstonejs/tools": "^1.70.12", + "@cornerstonejs/adapters": "^1.70.13", + "@cornerstonejs/core": "^1.70.13", + "@cornerstonejs/tools": "^1.70.13", "classnames": "^2.3.2" } } diff --git a/extensions/cornerstone-dynamic-volume/package.json b/extensions/cornerstone-dynamic-volume/package.json index f94a80519e7..0ea486509dd 100644 --- a/extensions/cornerstone-dynamic-volume/package.json +++ b/extensions/cornerstone-dynamic-volume/package.json @@ -42,9 +42,9 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/core": "^1.70.12", - "@cornerstonejs/streaming-image-volume-loader": "^1.70.12", - "@cornerstonejs/tools": "^1.70.12", + "@cornerstonejs/core": "^1.70.13", + "@cornerstonejs/streaming-image-volume-loader": "^1.70.13", + "@cornerstonejs/tools": "^1.70.13", "classnames": "^2.3.2" } } diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index f0872861c5b..f8f503445b5 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -38,7 +38,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.2", - "@cornerstonejs/dicom-image-loader": "^1.70.12", + "@cornerstonejs/dicom-image-loader": "^1.70.13", "@icr/polyseg-wasm": "^0.4.0", "@ohif/core": "3.8.0-beta.91", "@ohif/ui": "3.8.0-beta.91", @@ -55,10 +55,10 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/adapters": "^1.70.12", - "@cornerstonejs/core": "^1.70.12", - "@cornerstonejs/streaming-image-volume-loader": "^1.70.12", - "@cornerstonejs/tools": "^1.70.12", + "@cornerstonejs/adapters": "^1.70.13", + "@cornerstonejs/core": "^1.70.13", + "@cornerstonejs/streaming-image-volume-loader": "^1.70.13", + "@cornerstonejs/tools": "^1.70.13", "@icr/polyseg-wasm": "^0.4.0", "@kitware/vtk.js": "30.3.3", "html2canvas": "^1.4.1", diff --git a/extensions/measurement-tracking/package.json b/extensions/measurement-tracking/package.json index c7d046579bb..445a88c472d 100644 --- a/extensions/measurement-tracking/package.json +++ b/extensions/measurement-tracking/package.json @@ -32,8 +32,8 @@ "start": "yarn run dev" }, "peerDependencies": { - "@cornerstonejs/core": "^1.70.12", - "@cornerstonejs/tools": "^1.70.12", + "@cornerstonejs/core": "^1.70.13", + "@cornerstonejs/tools": "^1.70.13", "@ohif/core": "3.8.0-beta.91", "@ohif/extension-cornerstone-dicom-sr": "3.8.0-beta.91", "@ohif/ui": "3.8.0-beta.91", diff --git a/platform/app/package.json b/platform/app/package.json index c50120d2f4b..3360e8fc828 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -54,7 +54,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/dicom-image-loader": "^1.70.12", + "@cornerstonejs/dicom-image-loader": "^1.70.13", "@emotion/serialize": "^1.1.3", "@ohif/core": "3.8.0-beta.91", "@ohif/extension-cornerstone": "3.8.0-beta.91", diff --git a/platform/core/package.json b/platform/core/package.json index a6c0b8ffda6..faa3dee62e1 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -37,7 +37,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.2", - "@cornerstonejs/dicom-image-loader": "^1.70.12", + "@cornerstonejs/dicom-image-loader": "^1.70.13", "@ohif/ui": "3.8.0-beta.91", "cornerstone-math": "0.1.9", "dicom-parser": "^1.8.21" diff --git a/platform/ui/src/components/HeaderPatientInfo/HeaderPatientInfo.tsx b/platform/ui/src/components/HeaderPatientInfo/HeaderPatientInfo.tsx index 8c545d89899..e2940f31dc0 100644 --- a/platform/ui/src/components/HeaderPatientInfo/HeaderPatientInfo.tsx +++ b/platform/ui/src/components/HeaderPatientInfo/HeaderPatientInfo.tsx @@ -47,12 +47,12 @@ function usePatientInfo(servicesManager) { return; } setPatientInfo({ - PatientID: instance.PatientID || '', - PatientName: instance.PatientName ? formatPN(instance.PatientName.Alphabetic) : '', - PatientSex: instance.PatientSex || '', - PatientDOB: formatDate(instance.PatientBirthDate) || '', + PatientID: instance.PatientID || null, + PatientName: instance.PatientName ? formatPN(instance.PatientName.Alphabetic) : null, + PatientSex: instance.PatientSex || null, + PatientDOB: formatDate(instance.PatientBirthDate) || null, }); - checkMixedPatients(instance.PatientID || ''); + checkMixedPatients(instance.PatientID || null); }; useEffect(() => { diff --git a/yarn.lock b/yarn.lock index faa8436acc0..58add28698e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1497,13 +1497,13 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cornerstonejs/adapters@^1.70.12": - version "1.70.12" - resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.70.12.tgz#6556cb511840a6d10cc8eabbf7c408a5e07f3d33" - integrity sha512-XeBCpgW8S7WgTbFqq5oH3S4P5reVD9hXF10yPnEVpSdXygEFuFz4CG00RgVUEt7OT2gBNS18AZSLUqpZajmvlA== +"@cornerstonejs/adapters@^1.70.13": + version "1.70.13" + resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.70.13.tgz#195023f5600272f6ee70090b3c61060d13b9cec7" + integrity sha512-PSitPx/A5aP0VhVTC72trwf3CfVGAXYvcAfAvuk3WzSONhCJ6cg5Xsxpl0NtEt7prsT3u60Bgr94Ea+9VJVdog== dependencies: "@babel/runtime-corejs2" "^7.17.8" - "@cornerstonejs/tools" "^1.70.12" + "@cornerstonejs/tools" "^1.70.13" buffer "^6.0.3" dcmjs "^0.29.8" gl-matrix "^3.4.3" @@ -1550,10 +1550,10 @@ resolved "https://registry.yarnpkg.com/@cornerstonejs/codec-openjph/-/codec-openjph-2.4.5.tgz#8690b61a86fa53ef38a70eee9d665a79229517c0" integrity sha512-MZCUy8VG0VG5Nl1l58+g+kH3LujAzLYTfJqkwpWI2gjSrGXnP6lgwyy4GmPRZWVoS40/B1LDNALK905cNWm+sg== -"@cornerstonejs/core@^1.70.12": - version "1.70.12" - resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.70.12.tgz#51bbb966603439bec84aced69a664d04b13f7071" - integrity sha512-rGnmpEuLUruc9TcHpFBlEuCJPxufb0r9I5wbhh4VUhSUcyVgRA5gyImuny2pt8W4yhN3DCLE9LpNX9dah1/O0A== +"@cornerstonejs/core@^1.70.13": + version "1.70.13" + resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.70.13.tgz#a1976588b93461e2350866ecd761660ee1b74c8d" + integrity sha512-Bi+ErK6rHNx46CVQiUiw/00ipOWdy7EdyC4U0S30oiLE1Jz1PegIniVDogleXtO1jDkTkNnuWnPCoNhpUgNNuQ== dependencies: "@kitware/vtk.js" "30.3.3" comlink "^4.4.1" @@ -1561,34 +1561,34 @@ gl-matrix "^3.4.3" lodash.clonedeep "4.5.0" -"@cornerstonejs/dicom-image-loader@^1.70.12": - version "1.70.12" - resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.70.12.tgz#376b2ac1d6e36f1aaf2e2acd0f90f3b5d1a510b3" - integrity sha512-OBcP+QqhBHim9LsPrhBg9w5SkkY88YYgnI1elw2PzOu2thMm7Em2CgHDf0VlrNEvStovkvaqFdo6sawP3QD5HA== +"@cornerstonejs/dicom-image-loader@^1.70.13": + version "1.70.13" + resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.70.13.tgz#cf2aea8b6e538b6f005106ef6401869abde226d2" + integrity sha512-PXe9/xmv5vq1raREL9qsD3Ci68pWwCpjVxmyIigpV7lOdtziivvMVNyNSDZCjexBpbsB5a0fKcZG4jl82Jz1HA== dependencies: "@cornerstonejs/codec-charls" "^1.2.3" "@cornerstonejs/codec-libjpeg-turbo-8bit" "^1.2.2" "@cornerstonejs/codec-openjpeg" "^1.2.2" "@cornerstonejs/codec-openjph" "^2.4.5" - "@cornerstonejs/core" "^1.70.12" + "@cornerstonejs/core" "^1.70.13" dicom-parser "^1.8.9" pako "^2.0.4" uuid "^9.0.0" -"@cornerstonejs/streaming-image-volume-loader@^1.70.12": - version "1.70.12" - resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.70.12.tgz#f3ca840ec003db4fd7b336568627a39c5462244c" - integrity sha512-U6lUOfUduZKl2VeAikcAw5sDUrZoWiCCS4c4dI67lPZLdIREdbJYHf+cG8EovsaN0nvm1gGvYfD5R47TojQUyw== +"@cornerstonejs/streaming-image-volume-loader@^1.70.13": + version "1.70.13" + resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.70.13.tgz#77a3751ddc5ab17cff050007c7e3d7e0b8c58c13" + integrity sha512-Pd90y2JFbQ4LriRkkYXXvD3mhIWyiVdGDznhrJN/8ZC+4m5XusOlvOk2Ia/85e+WAgIUlHyDCgOuzewG8of+6w== dependencies: - "@cornerstonejs/core" "^1.70.12" + "@cornerstonejs/core" "^1.70.13" comlink "^4.4.1" -"@cornerstonejs/tools@^1.70.12": - version "1.70.12" - resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.70.12.tgz#6f1c7c82bf5b84f10588222564d270ffb2cfca7a" - integrity sha512-UKWoA/dLvhH5F1KnR/dZ454OL6m8npubGYse0f6BEfushqvN+INNKgj9zwPLXvfgyibwaz1SC6iIduUvIQMudg== +"@cornerstonejs/tools@^1.70.13": + version "1.70.13" + resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.70.13.tgz#fca6abc331841a2ac1a4403b5522cdcc6cacc708" + integrity sha512-Eza/4A2p51YPqZbvP6HwZC0yJCkogsda39aB+Eh5VTPQSqHn+VCBmZ9U9Qi9+0cpaye53A5OhjXAOoR6pZlqRQ== dependencies: - "@cornerstonejs/core" "^1.70.12" + "@cornerstonejs/core" "^1.70.13" "@icr/polyseg-wasm" "0.4.0" "@types/offscreencanvas" "2019.7.3" comlink "^4.4.1" @@ -2086,7 +2086,7 @@ "@docusaurus/theme-search-algolia" "2.4.3" "@docusaurus/types" "2.4.3" -"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2": +"@docusaurus/react-loadable@5.5.2": version "5.5.2" resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== @@ -17743,6 +17743,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1: dependencies: "@babel/runtime" "^7.10.3" +"react-loadable@npm:@docusaurus/react-loadable@5.5.2": + version "5.5.2" + resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" + integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== + dependencies: + "@types/react" "*" + prop-types "^15.6.2" + react-modal@3.11.2: version "3.11.2" resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.11.2.tgz#bad911976d4add31aa30dba8a41d11e21c4ac8a4" @@ -19533,7 +19541,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -19551,6 +19559,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -19646,7 +19663,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -19674,6 +19691,13 @@ strip-ansi@^5.1.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.0, strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -21717,7 +21741,7 @@ worker-loader@3.0.8, worker-loader@^3.0.8: loader-utils "^2.0.0" schema-utils "^3.0.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -21743,6 +21767,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"