From 2f7866c58d27f95b88028a70a462c8c211c086ab Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 10:37:58 -0400 Subject: [PATCH 1/9] fix(config): support more values for the useSharedArrayBuffer --- .../src/getSopClassHandlerModule.js | 3 ++- extensions/cornerstone/src/init.tsx | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/extensions/cornerstone-dicom-seg/src/getSopClassHandlerModule.js b/extensions/cornerstone-dicom-seg/src/getSopClassHandlerModule.js index 6f7f06e4bdd..7548d492ea8 100644 --- a/extensions/cornerstone-dicom-seg/src/getSopClassHandlerModule.js +++ b/extensions/cornerstone-dicom-seg/src/getSopClassHandlerModule.js @@ -57,7 +57,8 @@ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager) const referencedSeriesSequence = instance.ReferencedSeriesSequence; if (!referencedSeriesSequence) { - throw new Error('ReferencedSeriesSequence is missing for the SEG'); + console.error('ReferencedSeriesSequence is missing for the SEG'); + return; } const referencedSeries = referencedSeriesSequence[0] || referencedSeriesSequence; diff --git a/extensions/cornerstone/src/init.tsx b/extensions/cornerstone/src/init.tsx index fdd184fa7a4..3482d3cf515 100644 --- a/extensions/cornerstone/src/init.tsx +++ b/extensions/cornerstone/src/init.tsx @@ -43,15 +43,15 @@ export default async function init({ appConfig, }: Types.Extensions.ExtensionParams): Promise { // Note: this should run first before initializing the cornerstone - switch (appConfig.useSharedArrayBuffer) { - case 'AUTO': - cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO); - break; - case 'FALSE': - cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE); - break; - default: - cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE); + // DO NOT CHANGE THE ORDER + const value = appConfig.useSharedArrayBuffer; + + if (value === 'AUTO') { + cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO); + } else if (value === 'FALSE' || value === false) { + cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE); + } else { + cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE); } await cs3DInit({ From b26e9b96dd314de8fe39e7cb381225e51a1f0794 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 11:20:25 -0400 Subject: [PATCH 2/9] try to fix e2e tests --- platform/app/cypress/support/commands.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js index 70a5cfe814f..69413d5894e 100644 --- a/platform/app/cypress/support/commands.js +++ b/platform/app/cypress/support/commands.js @@ -153,10 +153,14 @@ Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => { const [x2, y2] = secondClick; // First click - performClick('@viewportAlias', x1, y1); + cy.get('@viewportAlias').then(() => { + performClick('@viewportAlias', x1, y1); + }); // Second click - performClick('@viewportAlias', x2, y2); + cy.get('@viewportAlias').then(() => { + performClick('@viewportAlias', x2, y2); + }); cy.wait(1000); }); From 30e9fc030bddc633634a94e394102213db2cbe32 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 12:47:27 -0400 Subject: [PATCH 3/9] try to fix e2e tests --- platform/app/cypress/support/commands.js | 41 ++++++------------------ 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js index 69413d5894e..c2261fd3aba 100644 --- a/platform/app/cypress/support/commands.js +++ b/platform/app/cypress/support/commands.js @@ -135,36 +135,6 @@ Cypress.Commands.add('drag', { prevSubject: 'element' }, (...args) => DragSimulator.simulate(...args) ); -/** - * Command to perform two clicks into two different positions. Each position must be [x, y]. - * The positions are considering the element as reference, therefore, top-left of the element will be (0, 0). - * - * @param {*} viewport - Selector for viewport we would like to interact with - * @param {number[]} firstClick - Click position [x, y] - * @param {number[]} secondClick - Click position [x, y] - */ -Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => { - const performClick = (alias, x, y) => { - cy.get(alias).as(`axu-${alias}`).click(x, y, { force: true, multiple: true }).wait(1000); - }; - - cy.get(viewport).as('viewportAlias'); - const [x1, y1] = firstClick; - const [x2, y2] = secondClick; - - // First click - cy.get('@viewportAlias').then(() => { - performClick('@viewportAlias', x1, y1); - }); - - // Second click - cy.get('@viewportAlias').then(() => { - performClick('@viewportAlias', x2, y2); - }); - - cy.wait(1000); -}); - /** * Command to perform three clicks into three different positions. Each position must be [x, y]. * The positions are considering the element as reference, therefore, top-left of the element will be (0, 0). @@ -284,7 +254,16 @@ Cypress.Commands.add( cy.get('@lengthButton').should('have.class', 'active'); - cy.addLine('.cornerstone-canvas', firstClick, secondClick); + cy.get('@viewport').then($viewport => { + const [x1, y1] = firstClick; + const [x2, y2] = secondClick; + + cy.wrap($viewport) + .click(x1, y1, { force: true }) + .wait(1000) + .click(x2, y2, { force: true }) + .wait(1000); + }); } ); From 6e1c6b4f734dcb58e36c4cf8b888e5a7229d615c Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 12:51:02 -0400 Subject: [PATCH 4/9] update cs3d --- extensions/cornerstone-dicom-seg/package.json | 2 +- extensions/cornerstone-dicom-sr/package.json | 6 +- extensions/cornerstone/package.json | 10 +-- extensions/measurement-tracking/package.json | 4 +- platform/app/package.json | 2 +- platform/core/package.json | 2 +- yarn.lock | 65 +++++++------------ 7 files changed, 36 insertions(+), 55 deletions(-) diff --git a/extensions/cornerstone-dicom-seg/package.json b/extensions/cornerstone-dicom-seg/package.json index 474c316557c..38c13aff140 100644 --- a/extensions/cornerstone-dicom-seg/package.json +++ b/extensions/cornerstone-dicom-seg/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/tools": "^1.16.4", + "@cornerstonejs/tools": "^1.19.3", "react-color": "^2.19.3" } } diff --git a/extensions/cornerstone-dicom-sr/package.json b/extensions/cornerstone-dicom-sr/package.json index 0b01d2c4cfc..a3cac14003d 100644 --- a/extensions/cornerstone-dicom-sr/package.json +++ b/extensions/cornerstone-dicom-sr/package.json @@ -44,9 +44,9 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/adapters": "^1.16.5", - "@cornerstonejs/core": "^1.16.5", - "@cornerstonejs/tools": "^1.16.5", + "@cornerstonejs/adapters": "^1.19.3", + "@cornerstonejs/core": "^1.19.3", + "@cornerstonejs/tools": "^1.19.3", "classnames": "^2.3.2" } } diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index 8cefd786fdb..d1c8f5df8ae 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -36,7 +36,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.16.5", + "@cornerstonejs/dicom-image-loader": "^1.19.3", "@ohif/core": "3.7.0-beta.87", "@ohif/ui": "3.7.0-beta.87", "dcmjs": "^0.29.6", @@ -52,10 +52,10 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "@cornerstonejs/adapters": "^1.16.5", - "@cornerstonejs/core": "^1.16.5", - "@cornerstonejs/streaming-image-volume-loader": "^1.16.5", - "@cornerstonejs/tools": "^1.16.5", + "@cornerstonejs/adapters": "^1.19.3", + "@cornerstonejs/core": "^1.19.3", + "@cornerstonejs/streaming-image-volume-loader": "^1.19.3", + "@cornerstonejs/tools": "^1.19.3", "@kitware/vtk.js": "27.3.1", "html2canvas": "^1.4.1", "lodash.debounce": "4.0.8", diff --git a/extensions/measurement-tracking/package.json b/extensions/measurement-tracking/package.json index a880d43da06..70cbfb4f562 100644 --- a/extensions/measurement-tracking/package.json +++ b/extensions/measurement-tracking/package.json @@ -30,8 +30,8 @@ "start": "yarn run dev" }, "peerDependencies": { - "@cornerstonejs/core": "^1.16.5", - "@cornerstonejs/tools": "^1.16.5", + "@cornerstonejs/core": "^1.19.3", + "@cornerstonejs/tools": "^1.19.3", "@ohif/core": "3.7.0-beta.87", "@ohif/extension-cornerstone-dicom-sr": "3.7.0-beta.87", "@ohif/ui": "3.7.0-beta.87", diff --git a/platform/app/package.json b/platform/app/package.json index cfb48378c8e..27af1c35454 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -50,7 +50,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.16.5", + "@cornerstonejs/dicom-image-loader": "^1.19.3", "@ohif/core": "3.7.0-beta.87", "@ohif/extension-cornerstone": "3.7.0-beta.87", "@ohif/extension-cornerstone-dicom-rt": "3.7.0-beta.87", diff --git a/platform/core/package.json b/platform/core/package.json index a5a3476c332..ca98681cda6 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -35,7 +35,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.16.5", + "@cornerstonejs/dicom-image-loader": "^1.19.3", "@ohif/ui": "3.7.0-beta.87", "cornerstone-math": "0.1.9", "dicom-parser": "^1.8.21" diff --git a/yarn.lock b/yarn.lock index 90dfc70cdfc..34001a5459c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1482,10 +1482,10 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cornerstonejs/adapters@^1.16.5": - version "1.16.5" - resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.16.5.tgz#cb50044ff7a3c26bdf98bda9c13dadbde4580018" - integrity sha512-wHDpCwWvo70kzAzxR6zGLUv55D3D52QDmLOAZLHMbeMSVHnKCepefU8mF1z7D2MLnOeyzB9rXGAZyqnK/1VVXA== +"@cornerstonejs/adapters@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-1.19.3.tgz#4480d16bb92346ee63a4737b5dd2b8699b8c79a0" + integrity sha512-aDJLYZ1FaT5LwSr1ZBS2br/bF9Tl5wHOoPBt6MOGP9mMUA+OaEqd4tY4C04tDOqLOBFUfTcI0+NxrpovQ+sLYw== dependencies: "@babel/runtime-corejs2" "^7.17.8" buffer "^6.0.3" @@ -1534,62 +1534,43 @@ resolved "https://registry.yarnpkg.com/@cornerstonejs/codec-openjph/-/codec-openjph-2.4.2.tgz#e96721d56f6ec96f7f95c16321d88cc8467d8d81" integrity sha512-lgdvBvvNezleY+4pIe2ceUsJzlZe/0PipdeubQ3vZZOz3xxtHHMR1XFCl4fgd8gosR8COHuD7h6q+MwgrwBsng== -"@cornerstonejs/core@^1.16.5": - version "1.16.5" - resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.16.5.tgz#c83a49c5c63ea384f71fe45a977fb9c47c5d7445" - integrity sha512-uW+wKsdEDshVCo0A4XcYR4G3zxrGQf2xPuTL4G7jpRmASQGAMYgKQJ/0xOlgyJjlKgvkiXb6qrwbfZH0U9S0vA== +"@cornerstonejs/core@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.19.3.tgz#30d6360b6bda821c62daf20e0e752e0af7d4c604" + integrity sha512-NJt41RALQXnEbutGALwhvNg6iNoypkTRVYFRdDsMTwTzu03ODSZnVPCZVdgBjiIJS1wb9WknCC49p/opV712qQ== dependencies: "@kitware/vtk.js" "27.3.1" detect-gpu "^5.0.22" gl-matrix "^3.4.3" lodash.clonedeep "4.5.0" -"@cornerstonejs/core@^1.16.6": - version "1.16.6" - resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-1.16.6.tgz#a216fc655f3c4b110196e63dcf129e02839d0890" - integrity sha512-ysd+t2N2KVk88TLYg0Nx174uYd47wQRBdFQZ4ApHhI/IHq5lY/qrP8prrtLR/DEtyLyUERIxDyGFRr+lEBZpxg== - dependencies: - "@kitware/vtk.js" "27.3.1" - detect-gpu "^5.0.22" - gl-matrix "^3.4.3" - lodash.clonedeep "4.5.0" - -"@cornerstonejs/dicom-image-loader@^1.16.5": - version "1.16.5" - resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.16.5.tgz#23ca3e27e29b88cd05840c777578b37de60e5b87" - integrity sha512-PfYU9LujMeyr3rnAjJsgbMU77x/BDAVDR/8XDFLRPbxoeCvdfGLeIR0bbiO6ajvgTutjr9sbYQwtdmQiGnqmCg== +"@cornerstonejs/dicom-image-loader@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@cornerstonejs/dicom-image-loader/-/dicom-image-loader-1.19.3.tgz#f6dce05099fe21abe31f35d6b159d785cd0f360b" + integrity sha512-ouJtxCZaAxfS/hN3i4DdeszEw/VMTtKve43eGK9bL/+/eyhJegsVkrDPJEJyHjtGOK9tjbnxkg1PlpVeNgWJbg== 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.2" - "@cornerstonejs/core" "^1.16.5" + "@cornerstonejs/core" "^1.19.3" dicom-parser "^1.8.9" pako "^2.0.4" uuid "^9.0.0" -"@cornerstonejs/streaming-image-volume-loader@^1.16.5": - version "1.16.5" - resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.16.5.tgz#9af370be2409e932caf1ff47fba9cfcf1b671065" - integrity sha512-98NsgeBPaEPMJnCsYKLDvGydREBh4Gue62o4AwcMyMOmH3tVC1neeMPzRNh0YTHHkQJJfjT5vD18+vYP86hnUw== - dependencies: - "@cornerstonejs/core" "^1.16.5" - -"@cornerstonejs/tools@^1.16.4": - version "1.16.6" - resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.16.6.tgz#0debc17fb9830288bff263bbf3a34cb940b726c2" - integrity sha512-qLjtEC0OGW+bpvvKXQPQs8TEE/ze+NIiBbg1qBSXo2vm7O3YO1DRWbWthJMVL7tIWYuVxZx5OsAI2WOkydQUOA== +"@cornerstonejs/streaming-image-volume-loader@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-1.19.3.tgz#8895690efbbcc8cad8cee8b1be8c06be1e420830" + integrity sha512-tGXzeD8CuRNoGvWU+vZsDvU7GA5jy+AimHbPPr5kLM02Ghygrch98BXjW2tA6Cu9PGABE64KxtsZmMayw0nOLg== dependencies: - "@cornerstonejs/core" "^1.16.6" - lodash.clonedeep "4.5.0" - lodash.get "^4.4.2" + "@cornerstonejs/core" "^1.19.3" -"@cornerstonejs/tools@^1.16.5": - version "1.16.5" - resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.16.5.tgz#79948216521c591a02f395e2130d72e0b9347eca" - integrity sha512-zUDBB6P13O1HZDiEyIGCORmAN1Ih9Z8QpjE0iM3hATdWUmHFs/2mBvHre/Wjh+BkNdtNTJ6s9pmbmz0CRVScUQ== +"@cornerstonejs/tools@^1.19.3": + version "1.19.3" + resolved "https://registry.yarnpkg.com/@cornerstonejs/tools/-/tools-1.19.3.tgz#d5f8f02adcdc4e5627b6565b4c60c642032a95c4" + integrity sha512-YcxrP6D5SR7epS+gmLZNK+K2yyFMshgPqHBf6PxS0nKq8jhYT6KHFjT0SBBRh+EJNrYCIYgy0D10PPSTg+kmVw== dependencies: - "@cornerstonejs/core" "^1.16.5" + "@cornerstonejs/core" "^1.19.3" lodash.clonedeep "4.5.0" lodash.get "^4.4.2" From 850271ce631af67ffc0cc3c80d1761369dce833e Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 13:34:36 -0400 Subject: [PATCH 5/9] fix the ui for floating point brush size --- .../src/panels/SegmentationToolbox.tsx | 12 ++++++------ .../src/components/AdvancedToolbox/ToolSettings.tsx | 4 ++-- .../ui/src/components/InputNumber/InputNumber.tsx | 3 ++- .../ui/src/components/InputRange/InputRange.tsx | 13 ++++++++----- platform/ui/src/utils/getMaxDigits.ts | 8 +++++++- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx b/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx index 674ae3d2e69..4be0ed1b3bc 100644 --- a/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx +++ b/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx @@ -249,8 +249,8 @@ function SegmentationToolbox({ servicesManager, extensionManager }) { name: 'Radius (mm)', id: 'brush-radius', type: 'range', - min: 0.01, - max: 100, + min: 0.5, + max: 99.5, value: state.Brush.brushSize, step: 0.5, onChange: value => onBrushSizeChange(value, 'Brush'), @@ -281,8 +281,8 @@ function SegmentationToolbox({ servicesManager, extensionManager }) { name: 'Radius (mm)', type: 'range', id: 'eraser-radius', - min: 0.01, - max: 100, + min: 0.5, + max: 99.5, value: state.Eraser.brushSize, step: 0.5, onChange: value => onBrushSizeChange(value, 'Eraser'), @@ -337,8 +337,8 @@ function SegmentationToolbox({ servicesManager, extensionManager }) { name: 'Radius (mm)', id: 'threshold-radius', type: 'range', - min: 0.01, - max: 100, + min: 0.5, + max: 99.5, value: state.ThresholdBrush.brushSize, step: 0.5, onChange: value => onBrushSizeChange(value, 'ThresholdBrush'), diff --git a/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx b/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx index 3184e5bb06d..14a5c5a5c70 100644 --- a/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx +++ b/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx @@ -35,7 +35,7 @@ function ToolSettings({ options }) { className="flex items-center" key={option.id} > -
{option.name}
+
{option.name}
option.onChange(e)} allowNumberEdit={true} showAdjustmentArrows={false} - inputClassName="ml-2 w-4/5" + inputClassName="ml-1 w-4/5" />
diff --git a/platform/ui/src/components/InputNumber/InputNumber.tsx b/platform/ui/src/components/InputNumber/InputNumber.tsx index e1fe0cc0a9a..ae43bc25643 100644 --- a/platform/ui/src/components/InputNumber/InputNumber.tsx +++ b/platform/ui/src/components/InputNumber/InputNumber.tsx @@ -48,6 +48,7 @@ const InputNumber: React.FC<{ const inputWidth = Math.max(maxDigits * 10, showAdjustmentArrows ? 20 : 28); const arrowWidth = showAdjustmentArrows ? 20 : 0; const containerWidth = `${inputWidth + arrowWidth}px`; + const decimalPlaces = Number.isInteger(step) ? 0 : step.toString().split('.')[1].length; useEffect(() => { setNumberValue(value); @@ -101,7 +102,7 @@ const InputNumber: React.FC<{
= ({ const handleChange = useCallback( e => { const val = Number(e.target.value); - setRangeValue(val); - onChange(val); + const roundedVal = Math.round(val / step) * step; + setRangeValue(roundedVal); + onChange(roundedVal); }, - [onChange] + [onChange, step] ); const rangeValuePercentage = ((rangeValue - minValue) / (maxValue - minValue)) * 100; @@ -92,8 +93,10 @@ const InputRange: React.FC = ({ e.preventDefault(); }} > -
- {showLabel && labelPosition === 'left' && LabelOrEditableNumber} +
+ {showLabel && labelPosition === 'left' && ( +
{LabelOrEditableNumber}
+ )}
{ - const integerDigits = maxValue.toString().length; + if (step <= 0) { + throw new Error('Step should be greater than zero'); + } + + // Get the number of integer digits for maxValue + const integerDigits = maxValue.toString().split('.')[0].length; const decimalDigits = step % 1 === 0 ? 0 : step.toString().split('.')[1].length; + return integerDigits + (decimalDigits ? decimalDigits + 1 : 0); }; From b7b677e8da1fcc6052cbf784d28e678dcfb1888a Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 16:22:22 -0400 Subject: [PATCH 6/9] fix input number on focus and blue --- platform/docs/docs/resources.md | 11 ++++++++++- .../src/components/InputNumber/InputNumber.tsx | 18 +++++++++++++++--- .../__stories__/inputNumber.stories.mdx | 8 ++++---- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/platform/docs/docs/resources.md b/platform/docs/docs/resources.md index b08ffe5b2fb..9ff2e7a9d8c 100644 --- a/platform/docs/docs/resources.md +++ b/platform/docs/docs/resources.md @@ -10,13 +10,22 @@ conferences and "hackathons". In this page, we will provide the presentations and other resources that we have provided to the community in the past: ## 2023 + +### ITCR 2023 Conference | September 11-13, 2023 + +Dr. Gordon Harris presented an update on OHIF in [NCI Informatics Technology for Cancer Research Annual Meeting](https://www.itcr2023.org/). You can find the slides and poster here: +[[Slides]](https://docs.google.com/presentation/d/1R38s95db_yZj0WoYdlUbaWGZsWVb3H-3u_hXBZXiTaE/edit?usp=sharing)[[Poster]](https://ohif-assets.s3.us-east-2.amazonaws.com/presentations/OHIF-ITCR-2023-FINAL-PRINT.pdf) + + + + ### SIIM 2023 Tech Tools Webinar | April 12th, 2023 Free, Open Source Tools for Research: MONAI and OHIF Viewer [[Slides](https://docs.google.com/presentation/d/1afJ5Y9Tzukgn7eAbaO1oiCtN7XvIimFdmZP-HcOUofA/edit?usp=sharing)][[Video](https://www.youtube.com/watch?v=lo8J5w5jUJI)] -### [NA-MIC Project Week 38th 2023 - Remote] +### NA-MIC Project Week 38th 2023 - Remote We participated in the 38th Project Week with three projects around OHIF. [[Website](https://projectweek.na-mic.org/PW38_2023_GranCanaria/)] diff --git a/platform/ui/src/components/InputNumber/InputNumber.tsx b/platform/ui/src/components/InputNumber/InputNumber.tsx index ae43bc25643..b3d9bbec563 100644 --- a/platform/ui/src/components/InputNumber/InputNumber.tsx +++ b/platform/ui/src/components/InputNumber/InputNumber.tsx @@ -43,6 +43,7 @@ const InputNumber: React.FC<{ showAdjustmentArrows = true, }) => { const [numberValue, setNumberValue] = useState(value); + const [isFocused, setIsFocused] = useState(false); const maxDigits = getMaxDigits(maxValue, step); const inputWidth = Math.max(maxDigits * 10, showAdjustmentArrows ? 20 : 28); @@ -82,8 +83,17 @@ const InputNumber: React.FC<{ onChange(newValue); }; - const increment = () => updateValue(numberValue + step); - const decrement = () => updateValue(numberValue - step); + const handleFocus = () => { + setIsFocused(true); + }; + + const handleBlur = () => { + setIsFocused(false); + setNumberValue(parseFloat(numberValue).toFixed(decimalPlaces)); + }; + + const increment = () => updateValue(parseFloat(numberValue) + step); + const decrement = () => updateValue(parseFloat(numberValue) - step); return (
@@ -102,8 +112,10 @@ const InputNumber: React.FC<{
console.log('input range change'), From 0672002c0db33debff6dad4c7b914729cb1abc9a Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 16:32:57 -0400 Subject: [PATCH 7/9] fix docs --- extensions/cornerstone/src/init.tsx | 11 +++++++++-- platform/docs/docs/deployment/cors.md | 5 +++++ platform/docs/docs/faq.md | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/extensions/cornerstone/src/init.tsx b/extensions/cornerstone/src/init.tsx index 3482d3cf515..5aaffd23cac 100644 --- a/extensions/cornerstone/src/init.tsx +++ b/extensions/cornerstone/src/init.tsx @@ -45,11 +45,13 @@ export default async function init({ // Note: this should run first before initializing the cornerstone // DO NOT CHANGE THE ORDER const value = appConfig.useSharedArrayBuffer; + let sharedArrayBufferDisabled = false; if (value === 'AUTO') { cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO); } else if (value === 'FALSE' || value === false) { cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE); + sharedArrayBufferDisabled = true; } else { cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE); } @@ -99,10 +101,15 @@ export default async function init({ window.extensionManager = extensionManager; window.commandsManager = commandsManager; - if (appConfig.showWarningMessageForCrossOrigin && !window.crossOriginIsolated) { + if ( + appConfig.showWarningMessageForCrossOrigin && + !window.crossOriginIsolated && + !sharedArrayBufferDisabled + ) { uiNotificationService.show({ title: 'Cross Origin Isolation', - message: 'Cross Origin Isolation is not enabled, volume rendering will not work (e.g., MPR)', + message: + 'Cross Origin Isolation is not enabled, read more about it here: https://docs.ohif.org/faq/', type: 'warning', }); } diff --git a/platform/docs/docs/deployment/cors.md b/platform/docs/docs/deployment/cors.md index 7cfb7558ccd..53aa3f06d1e 100644 --- a/platform/docs/docs/deployment/cors.md +++ b/platform/docs/docs/deployment/cors.md @@ -12,9 +12,14 @@ In particular, three of OHIF’s features depend on these configurations: - [XMLHttpRequests to fetch data from data sources](#cors-in-ohif) + ## SharedArrayBuffer A `SharedArrayBuffer` is a JavaScript object that is similar to an `ArrayBuffer` but can be shared between web workers and the window that spawned them via the `postMessage` API. See [SharedArrayBuffer in MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) for more information. +:::tip +To turn off Shared Array Buffer completely, just set `useSharedArrayBuffer` to `false` in the [OHIF configuration](../configuration/configurationFiles.md). But keep in mind that you won't get the performance boost that Shared Array Buffer offers for decoding and rendering big volumes when web workers write to the same memory space. +::: + ### Security Requirements In order to use `SharedArrayBuffer` objects in the browser, the following security conditions must be met: diff --git a/platform/docs/docs/faq.md b/platform/docs/docs/faq.md index ff859fc69d3..0a84d3898c0 100644 --- a/platform/docs/docs/faq.md +++ b/platform/docs/docs/faq.md @@ -29,6 +29,9 @@ If you have resources and would like to fund the development of a feature, please [contact us](https://www.ohif.org) or work with community members that offer [consulting services][commercial-support]. +### Cross Origin Isolation +If you encounter a warning while running OHIF indicating that your application is not cross-origin isolated, it implies that volume rendering, such as MPR, will not function properly since they depend on Shared Array Buffers. To resolve this issue, we recommend referring to our comprehensive guide on Cross Origin Isolation available at [./deployment/cors.md](./deployment/cors.md). + ### Who should I contact about Academic Collaborations? [Gordon J. Harris](https://www.dfhcc.harvard.edu/insider/member-detail/member/gordon-j-harris-phd/) From 872ed7f835c6239324d4134b1834a74fc815c98e Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 2 Oct 2023 16:39:13 -0400 Subject: [PATCH 8/9] typo --- platform/docs/docs/configuration/configurationFiles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/docs/docs/configuration/configurationFiles.md b/platform/docs/docs/configuration/configurationFiles.md index 2b6f14498c2..9141cc108e5 100644 --- a/platform/docs/docs/configuration/configurationFiles.md +++ b/platform/docs/docs/configuration/configurationFiles.md @@ -122,7 +122,7 @@ Here are a list of some options available: decoding. Defaults to minimum of `navigator.hardwareConcurrency` and what is specified by `maxNumberOfWebWorkers`. Some windows machines require smaller values. - `acceptHeader` : accept header to request specific dicom transfer syntax ex : [ 'multipart/related; type=image/jls; q=1', 'multipart/related; type=application/octet-stream; q=0.1' ] -- `requestTransferSyntaxUID` : Request a specific Tansfer syntax from dicom web server ex: 1.2.840.10008.1.2.4.80 (applied only if acceptHeader is not set) +- `requestTransferSyntaxUID` : Request a specific Transfer syntax from dicom web server ex: 1.2.840.10008.1.2.4.80 (applied only if acceptHeader is not set) - `omitQuotationForMultipartRequest`: Some servers (e.g., .NET) require the `multipart/related` request to be sent without quotation marks. Defaults to `false`. If your server doesn't require this, then setting this flag to `true` might improve performance (by removing the need for preflight requests). Also note that if auth headers are used, a preflight request is required. - `maxNumRequests`: The maximum number of requests to allow in parallel. It is an object with keys of `interaction`, `thumbnail`, and `prefetch`. You can specify a specific number for each type. From b117027c782f9cd81292888165ff20b6b6f70514 Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 3 Oct 2023 09:56:39 -0400 Subject: [PATCH 9/9] apply review comments --- .../MicroscopyPanel/MicroscopyPanel.tsx | 2 +- platform/core/src/types/index.ts | 30 +++++++++---------- platform/docs/docs/deployment/cors.md | 2 +- platform/docs/docs/faq.md | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.tsx b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.tsx index c57df827a69..119f116e069 100644 --- a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.tsx +++ b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.tsx @@ -213,7 +213,7 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) { } onSaveComplete({ title: 'SR Saved', - meassage: 'Measurements downloaded successfully', + message: 'Measurements downloaded successfully', type: 'success', }); } else { diff --git a/platform/core/src/types/index.ts b/platform/core/src/types/index.ts index d2a39b83b99..5c4496efb04 100644 --- a/platform/core/src/types/index.ts +++ b/platform/core/src/types/index.ts @@ -1,23 +1,23 @@ -import * as Extensions from '../extensions/ExtensionManager'; -import * as HangingProtocol from './HangingProtocol'; -import Services from './Services'; -import Hotkey from '../classes/Hotkey'; -import { DataSourceDefinition } from './DataSource'; -import { +import type * as Extensions from '../extensions/ExtensionManager'; +import type * as HangingProtocol from './HangingProtocol'; +import type Services from './Services'; +import type Hotkey from '../classes/Hotkey'; +import type { DataSourceDefinition } from './DataSource'; +import type { BaseDataSourceConfigurationAPI, BaseDataSourceConfigurationAPIItem, } from './DataSourceConfigurationAPI'; -export * from '../services/CustomizationService/types'; +export type * from '../services/CustomizationService/types'; // Separate out some generic types -export * from './AppConfig'; -export * from './Consumer'; -export * from './Command'; -export * from './DisplaySet'; -export * from './StudyMetadata'; -export * from './PanelModule'; -export * from './IPubSub'; -export * from './Color'; +export type * from './AppConfig'; +export type * from './Consumer'; +export type * from './Command'; +export type * from './DisplaySet'; +export type * from './StudyMetadata'; +export type * from './PanelModule'; +export type * from './IPubSub'; +export type * from './Color'; /** * Export the types used within the various services and managers, but diff --git a/platform/docs/docs/deployment/cors.md b/platform/docs/docs/deployment/cors.md index 53aa3f06d1e..bd88d0d1daa 100644 --- a/platform/docs/docs/deployment/cors.md +++ b/platform/docs/docs/deployment/cors.md @@ -17,7 +17,7 @@ In particular, three of OHIF’s features depend on these configurations: A `SharedArrayBuffer` is a JavaScript object that is similar to an `ArrayBuffer` but can be shared between web workers and the window that spawned them via the `postMessage` API. See [SharedArrayBuffer in MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) for more information. :::tip -To turn off Shared Array Buffer completely, just set `useSharedArrayBuffer` to `false` in the [OHIF configuration](../configuration/configurationFiles.md). But keep in mind that you won't get the performance boost that Shared Array Buffer offers for decoding and rendering big volumes when web workers write to the same memory space. +To turn off Shared Array Buffer completely, just set `useSharedArrayBuffer` to `false` in the [OHIF configuration](../configuration/configurationFiles.md). But keep in mind that you will not get the performance boost that Shared Array Buffer offers for decoding and rendering big volumes where web workers write to the same memory space. ::: ### Security Requirements diff --git a/platform/docs/docs/faq.md b/platform/docs/docs/faq.md index 0a84d3898c0..01d42ee9510 100644 --- a/platform/docs/docs/faq.md +++ b/platform/docs/docs/faq.md @@ -29,7 +29,7 @@ If you have resources and would like to fund the development of a feature, please [contact us](https://www.ohif.org) or work with community members that offer [consulting services][commercial-support]. -### Cross Origin Isolation +### Why do I keep seeing a Cross Origin Isolation warning If you encounter a warning while running OHIF indicating that your application is not cross-origin isolated, it implies that volume rendering, such as MPR, will not function properly since they depend on Shared Array Buffers. To resolve this issue, we recommend referring to our comprehensive guide on Cross Origin Isolation available at [./deployment/cors.md](./deployment/cors.md). ### Who should I contact about Academic Collaborations?