xtk / X

The X Toolkit
http://www.goXTK.com
Other
786 stars 263 forks source link

RAW NRRD cannot be displayed #227

Closed RhinoBlindado closed 2 years ago

RhinoBlindado commented 2 years ago

I think I've found a bug in the NRRD parser or maybe is it the files I'm using?,

I've been trying to load NRRDs with a RAW encoding, when it's time to render it gives me this error: Uncaught RangeError: buffer length for Int16Array should be a multiple of 2 in the library at xtk_edge.js:270.

However if I try to open this file in 3DSlicer it works perfectly, in fact, the NRRD was created by 3DSlicer itself; if I instead compress the same NRRD file within 3DSlicer, it loads and displays correctly.

From what I've been seeing, the array buffer is indeed an even number.

If this is a problem with the file, how could it be fixed? Since the NRRD is quite big (300MB), I'll provide it if needed.

RhinoBlindado commented 2 years ago

I've fixed it myself, it's on this pull request.