Slicer.util.array: format, grayscale and RGB

Hello,

I am using the Python console to create a script that handles my imported image as an array thanks to:
image = slicer.util.array('T2IMAGE')

The image is in an ‘nrrd’ format, and it’s a T2 weighted MR acquisition. When I use the above clause, I get a 4x256x256 array (dimensions are correct: there are 4 slices with a 256x256 resolution), but I do not understand the values themselves.

I have noticed that the minimum value is 0 and the maximum value is 32767 (using image.max() and image.min()). How does Slicer reads ‘nrrd’ files?

In addition to that doubt, I have the following issue: the image is supposed to be a grayscale image, but I need to change the value of some pixels to a color . Hence, is there a way to handle that grayscale image as an RGB?

Thank you very much for any suggestion.
Kind regards,

Virginia

This behavior is probably incorrect. Most likely the software that created this nrrd image used incorrect byte ordering (endianness). How did you create the nrrd file?

When you segment a volume by “painting” voxels you don’t change voxels of the original volume node but you modify segmentation node overlaid on the original volume, using Segment Editor module.