fix(config): support more values for the useSharedArrayBuffer (#3688)
This commit is contained in:
1 parent
c9c57b04d3
commit
1129c155d2
22 files changed
+144
-133
No files matched your search
@@ -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",
|
||||
|
||||
@@ -43,15 +43,17 @@ export default async function init({
|
||||
appConfig,
|
||||
}: Types.Extensions.ExtensionParams): Promise<void> {
|
||||
// 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;
|
||||
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);
|
||||
}
|
||||
|
||||
await cs3DInit({
|
||||
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user