Skip to content

Commit

Permalink
fix: byteLength calculation (#314)
Browse files Browse the repository at this point in the history
Previously calculated using array length. This was  incorrect for any image not storing data as 1 byte/pixel.
  • Loading branch information
JamesAPetts authored Apr 28, 2020
1 parent 138fa2c commit ed03af7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/imageLoader/createImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function createImage(imageId, pixelData, transferSyntax, options) {
maxPixelValue: imageFrame.largestPixelValue,
rowPixelSpacing: imagePlaneModule.rowPixelSpacing,
rows: imageFrame.rows,
sizeInBytes: imageFrame.pixelData.length,
sizeInBytes: imageFrame.pixelData.byteLength,
slope: modalityLutModule.rescaleSlope
? modalityLutModule.rescaleSlope
: 1,
Expand Down

0 comments on commit ed03af7

Please sign in to comment.