Skip to content

Commit

Permalink
fix: Pixel data array was the wrong length for color images (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
swederik committed Jun 24, 2022
1 parent cf7ffdd commit e42419d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/RenderingEngine/StackViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,15 +1200,15 @@ class StackViewport extends Viewport implements IStackViewport {
let pixelArray;
switch (bitsAllocated) {
case 8:
pixelArray = new Uint8Array(numVoxels);
pixelArray = new Uint8Array(numVoxels * numComps);
break;

case 16:
pixelArray = new Float32Array(numVoxels);
pixelArray = new Float32Array(numVoxels * numComps);

break;
case 24:
pixelArray = new Uint8Array(numVoxels * 3);
pixelArray = new Uint8Array(numVoxels * 3 * numComps);

break;
default:
Expand Down

0 comments on commit e42419d

Please sign in to comment.