Hi Chris,
I'm testing out HTJ2K with your library and I'm getting the following error when trying to encode a Tomo image.
exception RangeError: offset is out of bounds
at Uint8Array.set ()
at encodePixelData (C:\work\code\sandbox\pocs\DICOMHTJ2K\encodePixelData.js:36:16)
at openjphjs.onRuntimeInitialized (C:\work\code\sandbox\pocs\DICOMHTJ2K\index.js:61:28)
It looks like the WASM code when getting the decoded buffer is calculating it smaller than expected.
I added some debug statements and here is the output from encodePixelData.js
Image Frame Data
{
width: 1990,
height: 3380,
bitsPerSample: 16,
componentCount: 1,
isSigned: false,
isUsingColorTransform: false
}
exception RangeError: offset is out of bounds
at Uint8Array.set ()
at encodePixelData (C:\work\code\sandbox\pocs\DICOMHTJ2K\encodePixelData.js:36:16)
at openjphjs.onRuntimeInitialized (C:\work\code\sandbox\pocs\DICOMHTJ2K\index.js:61:28)
It seems like the WASM code is rounding down when calculating the bytesPerPixel in "HTJ2KEncoder.hpp". Any thoughts?
Thanks!!
Hi Chris,
I'm testing out HTJ2K with your library and I'm getting the following error when trying to encode a Tomo image.
exception RangeError: offset is out of bounds
at Uint8Array.set ()
at encodePixelData (C:\work\code\sandbox\pocs\DICOMHTJ2K\encodePixelData.js:36:16)
at openjphjs.onRuntimeInitialized (C:\work\code\sandbox\pocs\DICOMHTJ2K\index.js:61:28)
It looks like the WASM code when getting the decoded buffer is calculating it smaller than expected.
I added some debug statements and here is the output from encodePixelData.js
Image Frame Data
{
width: 1990,
height: 3380,
bitsPerSample: 16,
componentCount: 1,
isSigned: false,
isUsingColorTransform: false
}
exception RangeError: offset is out of bounds
at Uint8Array.set ()
at encodePixelData (C:\work\code\sandbox\pocs\DICOMHTJ2K\encodePixelData.js:36:16)
at openjphjs.onRuntimeInitialized (C:\work\code\sandbox\pocs\DICOMHTJ2K\index.js:61:28)
It seems like the WASM code is rounding down when calculating the bytesPerPixel in "HTJ2KEncoder.hpp". Any thoughts?
Thanks!!