From b2d203ce8cb603a6400de73d7bc3a4160cd5cea8 Mon Sep 17 00:00:00 2001 From: Alireza Date: Thu, 13 Jul 2023 14:49:40 -0400 Subject: [PATCH] fix(color volume): take into account number of components for the volume length --- .../src/cornerstoneStreamingImageVolumeLoader.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/streaming-image-volume-loader/src/cornerstoneStreamingImageVolumeLoader.ts b/packages/streaming-image-volume-loader/src/cornerstoneStreamingImageVolumeLoader.ts index a5d968b65d..26fbf086b6 100644 --- a/packages/streaming-image-volume-loader/src/cornerstoneStreamingImageVolumeLoader.ts +++ b/packages/streaming-image-volume-loader/src/cornerstoneStreamingImageVolumeLoader.ts @@ -169,11 +169,11 @@ function cornerstoneStreamingImageVolumeLoader( '8 Bit signed images are not yet supported by this plugin.' ); } - sizeInBytes = length; + sizeInBytes = length * numComponents; handleCache(sizeInBytes); scalarData = useSharedArrayBuffer - ? createUint8SharedArray(length) - : new Uint8Array(length); + ? createUint8SharedArray(length * numComponents) + : new Uint8Array(length * numComponents); break; case 16: