Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Raw encoded NRRDs parse correctly #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RhinoBlindado
Copy link

The original code used an ArrayBuffer to get the voxel data, this worked fine for gzip/gz encoded files because when the voxel data was decompressed, it returned a new ArrayBuffer of just the voxel data, so just using _data = _data.buffer; worked fine.

When a raw file was detected, it also grabbed the ArrayBuffer of the sliced data, but, it turns that this variable is a subarray of the whole file as seen in var _data = _bytes.subarray(_data_start);.

Problem is, trying to get the buffer from a sliced subarray returns the whole original buffer, not a sliced one; so this was fixed by using the same offset to only get the buffer data of the voxels like so: _data = _data.buffer.slice(_data_start);

Changes:

	- When a raw encoded NRRD is parsed now it correctly uses
	only the voxel data to render the volume, as previously it
	was using the whole buffer data to try and render it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant