PIL: TIFF images loaded as 16 bit signed integers

Chris Mitchell <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
I'm running into a problem where my image intensities are being loaded
as 16 bit signed integers.  The code I'm using to open the tiff file
is:


im = Image.open(file)
self.pixels = np.array([im.getdata()], np.uint16)

the filetype is a 16bit TIFF, whose intensities load fine into ImageJ.
 I load their intensities into a numpy 16bit array, and for the time
being I've fixed this problem with this code:

np.where(self.pixels<0, -1*self.pixels+(32768+self.pixels),self.pixels)

That basically takes any negative values and compensates for the
rollover.  Does anyone have any idea why PIL is loading my TIFF files
as signed integers?
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.