[Paraview] Reading nii RGB images

Philip A Cook cookpa at mail.med.upenn.edu
Mon Sep 26 18:13:35 EDT 2011


Hi all,

I have images with the datatype NIFTI_TYPE_RGB24 (128):

    bitpix = 24
    datatype = 128
    dim[0] = 3
    dim[1] = 192
    dim[2] = 256
    dim[3] = 160

However when I load an image into Paraview, the slices don't show up as RGB. I think the data is being written correctly. To verify this, I took the same binary data (the contents of the nii file minus the 352 byte header), and added a Meta header:

ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 -1 0 0 0 1
Offset = -93 143 -72
CenterOfRotation = 0 0 0
AnatomicalOrientation = RPI
ElementSpacing = 0.976562 0.976562 1
DimSize = 192 256 160
ElementNumberOfChannels = 3
ElementType = MET_UCHAR
ElementDataFile = LOCAL

The resulting image displays correctly as RGB. Unfortunately, the geometry of the image is often confused by the conversion between nii and mha files, so it would be really helpful if I could load RGB .nii images directly. Is there a way to read RGB images in NIfTI-1 format? 

Thanks,


Phil


More information about the ParaView mailing list