You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted here, this repo says to support dataypes 2,4,16 but does not. This can be observed with dragging and dropping the images of different datatypes from the niivue float32 (fslmean.nii.gz) and niivue-demo-images int16 (CT_Philips.nii.gz).
The solution is to add .buffer to read the bytes rather than convert them:
case processedImage.DT_UNSIGNED_CHAR:
processedImage.img = new Uint8Array(imageBytes);
break;
case processedImage.DT_SIGNED_SHORT:
processedImage.img = new Int16Array(imageBytes.buffer);
break;
case processedImage.DT_FLOAT:
processedImage.img = new Float32Array(imageBytes.buffer);
break;
case processedImage.DT_DOUBLE:
throw "datatype " + processedImage.hdr.datatypeCode + " not supported";
case processedImage.DT_RGB:
processedImage.img = new Uint8Array(imageBytes.buffer);
break;
case processedImage.DT_UINT16:
processedImage.img = new Uint16Array(imageBytes.buffer);
break;
case processedImage.DT_RGBA32:
processedImage.img = new Uint8Array(imageBytes.buffer);
break;
default:
throw "datatype " + processedImage.hdr.datatypeCode + " not supported";
}
The text was updated successfully, but these errors were encountered:
As noted here, this repo
says to support dataypes 2,4,16
but does not. This can be observed with dragging and dropping the images of different datatypes from the niivue float32 (fslmean.nii.gz) and niivue-demo-images int16 (CT_Philips.nii.gz).The solution is to add
.buffer
to read the bytes rather than convert them:The text was updated successfully, but these errors were encountered: