[Insight-users] pixel type

Silviu D Minut minutsil at cse.msu.edu
Mon, 29 Mar 2004 17:36:24 -0500 (EST)


I'm messing with the ImageReadWrite example and I'm running it on some
image.png that I created with gimp.

The PixelType is set to unsigned short. The output image is a blank
(black) square image (both with xv and with ImageViewer). That's no good.

The image I created was grayscale, so it has 8bpp. I changed the PixelType
to unsigned char and it worked. I understand png supports both char and
short. I assume that the data is stored ultimately as a PixelType * array.
Is that right? Can anybody explain what goes wrong when I have a type
missmatch between the image on disk and the PixelType?

Thanks!