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:
1 parent
034a6d7696
commit
2bd3b26a6a
10 files changed
+254
-36
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user