-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
At the moment, all 64bit floating point data gets converted to 32bit. The Image.prototype._getFrame function should have the bitpix<0 if condition updated to differentiate between values of -64 and -32.
Specifically, modifying image.coffee such that from line 88 the code reads:
arr = new Uint32Array(buffer)
swapEndian = (value) ->
return ((value & 0xFF) << 24) | ((value & 0xFF00) << 8) | ((value >> 8) & 0xFF00) | ((value >> 24) & 0xFF)
while i--
value = arr[i]
arr[i] = swapEndian(value)
if bitpix == -64
i = arr.length
while i-=2
tmp = arr[i]
arr[i] = arr[i + 1]
arr[i + 1] = tmp
arr = new Float64Array(buffer)
else
# Initialize a Float32 array using the same buffer
arr = new Float32Array(buffer)
Metadata
Metadata
Assignees
Labels
No labels