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

RGB24 Niftis #14

Open
tpenzkofer opened this issue Apr 4, 2020 · 2 comments
Open

RGB24 Niftis #14

tpenzkofer opened this issue Apr 4, 2020 · 2 comments

Comments

@tpenzkofer
Copy link

Hi, thank you for this great implementation! I tried loading RGB24 (fused axial PET/CT) images using cornerstone-nifti-loader, but apparently the current loading mechanics do not support this image type (128), especially in

function niftiDatatypeCodeToTypedArray(nifti, datatypeCode) {
var _typedArrayConstructo;

var typedArrayConstructorMap = (_typedArrayConstructo = {}, _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_UINT8, Uint8Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_UINT16, Uint16Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_UINT32, Uint32Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_INT8, Int8Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_INT16, Int16Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_INT32, Int32Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_FLOAT32, Float32Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_FLOAT64, Float64Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_RGB, Uint8Array), _defineProperty(_typedArrayConstructo, nifti.NIFTI1.TYPE_RGBA, Uint8Array), _typedArrayConstructo);

return typedArrayConstructorMap[datatypeCode];
}

nifti.NIFTI1.TYPE_RGB24 is not among the supported datatypes. Is there a way to have the loader support RGB24 (datatype=128) .nii files?

Thank you, T

@tpenzkofer
Copy link
Author

tpenzkofer commented Apr 6, 2020

update: added RGB24 as Uint8Array and reordered imageData from 24 bit RGB to 32 bit RGB
, unfortunately the output now looks like this, any ideas how to adjust the slicing?

Screen Shot 2020-04-07 at 01 00 20

@albagarrey
Copy link

@tpenzkofer thanks for the reporting. Could you share how you converted RGB24 as Uint8Array and how you reordered imageData from 24 bit RGB to 32 bit RGB? Thanks a lot!

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

No branches or pull requests

2 participants