fabio.pnmimage
index
/usr/lib/python2.5/site-packages/fabio/pnmimage.py

Authors: Henning O. Sorensen & Erik Knudsen
         Center for Fundamental Research: Metal Structures in Four Dimensions
         Risoe National Laboratory
         Frederiksborgvej 399
         DK-4000 Roskilde
         email:henning.sorensen@risoe.dk

 
Modules
       
PIL.Image
numpy
fabio.fabioimage

 
Classes
       
fabio.fabioimage.fabioimage
pnmimage

 
class pnmimage(fabio.fabioimage.fabioimage)
     Methods defined here:
P1dec(self, buf, bytecode)
P2dec(self, buf, bytecode)
P3dec(self, buf, bytecode)
P4dec(self, buf, bytecode)
P5dec(self, buf, bytecode)
P6dec(self, buf, bytecode)
P7dec(self, buf, bytecode)
__init__(self)
read(self, fname, verbose=0)
write(filename)

Methods inherited from fabio.fabioimage.fabioimage:
add(self, other)
Add another Image - warnign, does not clip to 16 bit images by default
getheader(self)
returns self.header
getmax(self)
Find max value in self.data, caching for the future
getmean(self)
return the mean
getmin(self)
Find min value in self.data, caching for the future
getstddev(self)
return the standard deviation
integrate_area(self, coords)
Sums up a region of interest 
if len(coords) == 4 -> convert coords to slices
if len(coords) == 2 -> use as slices
floor -> ? removed as unused in the function.
make_slice(self, coords)
Convert a len(4) set of coords into a len(2) 
tuple (pair) of slice objects
the latter are immutable, meaning the roi can be cached
readheader(self, filename)
Call the _readheader function...
rebin(self, x_rebin_fact, y_rebin_fact)
Rebin the data and adjust dims
resetvals(self)
Reset cache - call on changing data
toPIL16(self, filename=None)
Convert to Python Imaging Library 16 bit greyscale image
 
FIXME - this should be handled by the libraries now
TODO  - som objects are over-riding this method, why?
update_header(self, **kwds)
update the header entries
by default pass in a dict of key, values.

 
Data
        HEADERITEMS = ['SUBFORMAT', 'DIMENSIONS', 'MAXVAL']
P7HEADERITEMS = ['WIDTH', 'HEIGHT', 'DEPTH', 'MAXVAL', 'TUPLTYPE', 'ENDHDR']
SUBFORMATS = ['P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7']