perf(memory): add 16 bit texture via configuration - reduces memory by half (#3662)

Co-authored-by: Ouwen Huang <ouwen.huang@duke.edu>
This commit is contained in:
AlirezaandOuwen Huang authored and GitHub committed 2023-09-22 09:31:45 -04:00
1 parent 034a6d7696
commit 2bd3b26a6a
10 files changed
+254 -36

No files matched your search

+3 -3
View File
@@ -44,9 +44,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.13.2",
"@cornerstonejs/core": "^1.13.2",
"@cornerstonejs/tools": "^1.13.2",
"@cornerstonejs/adapters": "^1.16.5",
"@cornerstonejs/core": "^1.16.5",
"@cornerstonejs/tools": "^1.16.5",
"classnames": "^2.3.2"
}
}
+5 -5
View File
@@ -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.13.2",
"@cornerstonejs/dicom-image-loader": "^1.16.5",
"@ohif/core": "3.7.0-beta.78",
"@ohif/ui": "3.7.0-beta.78",
"dcmjs": "^0.29.6",
@@ -52,10 +52,10 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.13.2",
"@cornerstonejs/core": "^1.13.2",
"@cornerstonejs/streaming-image-volume-loader": "^1.13.2",
"@cornerstonejs/tools": "^1.13.2",
"@cornerstonejs/adapters": "^1.16.5",
"@cornerstonejs/core": "^1.16.5",
"@cornerstonejs/streaming-image-volume-loader": "^1.16.5",
"@cornerstonejs/tools": "^1.16.5",
"@kitware/vtk.js": "27.3.1",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
+20 -1
View File
@@ -12,6 +12,7 @@ import {
imageLoadPoolManager,
Settings,
utilities as csUtilities,
Enums as csEnums,
} from '@cornerstonejs/core';
import { Enums, utilities, ReferenceLinesTool } from '@cornerstonejs/tools';
import { cornerstoneStreamingImageVolumeLoader } from '@cornerstonejs/streaming-image-volume-loader';
@@ -41,10 +42,28 @@ export default async function init({
configuration,
appConfig,
}: Types.Extensions.ExtensionParams): Promise<void> {
await cs3DInit();
await cs3DInit({
rendering: {
preferSizeOverAccuracy: Boolean(appConfig.use16BitDataType),
useNorm16Texture: Boolean(appConfig.use16BitDataType),
},
});
// For debugging e2e tests that are failing on CI
cornerstone.setUseCPURendering(Boolean(appConfig.useCPURendering));
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);
}
cornerstone.setConfiguration({
...cornerstone.getConfiguration(),
rendering: {
@@ -49,6 +49,7 @@ export default function initWADOImageLoader(
// Until the default is set to true (which is the case for cornerstone3D),
// we should set this flag to false.
convertFloatPixelDataToInt: false,
use16BitDataType: Boolean(appConfig.use16BitDataType),
},
beforeSend: function (xhr) {
//TODO should be removed in the future and request emitted by DicomWebDataSource
+2 -2
View File
@@ -30,8 +30,8 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@cornerstonejs/core": "^1.13.2",
"@cornerstonejs/tools": "^1.13.2",
"@cornerstonejs/core": "^1.16.5",
"@cornerstonejs/tools": "^1.16.5",
"@ohif/core": "3.7.0-beta.78",
"@ohif/extension-cornerstone-dicom-sr": "3.7.0-beta.78",
"@ohif/ui": "3.7.0-beta.78",