Package fabio :: Module fabioimage :: Class fabioimage
[hide private]
[frames] | no frames]

Class fabioimage

source code

object --+
         |
        fabioimage
Known Subclasses:

A common object for images in fable Contains a numpy array (.data) and dict of meta data (.header)

Instance Methods [hide private]
 
__init__(self, data=None, header=None)
Set up initial values
source code
 
_compressed_stream(self, fname, system_uncompress, python_uncompress, mode='rb')
Try to transparently handle gzip / bzip without always getting python performance
source code
 
_open(self, fname, mode='rb')
Try to handle compressed files, streams, shared memory etc Return an object which can be used for "read" and "write" ...
source code
 
_readheader(self, fik_obj)
Must be overridden in classes
source code
 
add(self, other)
Add another Image - warnign, does not clip to 16 bit images by default
source code
 
getframe(self, num)
returns the file numbered 'num' in the series as a fabioimage
source code
 
getheader(self)
returns self.header
source code
 
getmax(self)
Find max value in self.data, caching for the future
source code
 
getmean(self)
return the mean
source code
 
getmin(self)
Find min value in self.data, caching for the future
source code
 
getstddev(self)
return the standard deviation
source code
 
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.
source code
 
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
source code
 
next(self)
returns the next file in the series as a fabioimage
source code
 
previous(self)
returns the previous file in the series as a fabioimage
source code
 
read(self, filename)
To be overridden - fill in self.header and self.data
source code
 
readheader(self, filename)
Call the _readheader function...
source code
 
rebin(self, x_rebin_fact, y_rebin_fact, keep_I=True)
Rebin the data and adjust dims
source code
 
resetvals(self)
Reset cache - call on changing data
source code
 
toPIL16(self, filename=None)
Convert to Python Imaging Library 16 bit greyscale image
source code
 
update_header(self, **kwds)
update the header entries by default pass in a dict of key, values.
source code
 
write(self, fname)
To be overwritten - write the file
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _need_a_real_file = False
  _need_a_seek_to_read = False
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None, header=None)
(Constructor)

source code 

Set up initial values

Overrides: object.__init__

_open(self, fname, mode='rb')

source code 

Try to handle compressed files, streams, shared memory etc Return an object which can be used for "read" and "write" ... FIXME - what about seek ?

rebin(self, x_rebin_fact, y_rebin_fact, keep_I=True)

source code 

Rebin the data and adjust dims

Parameters:
  • x_rebin_fact (int) - x binning factor
  • y_rebin_fact (int) - y binning factor
  • keep_I (boolean) - shall the signal increase ?

toPIL16(self, filename=None)

source code 

Convert to Python Imaging Library 16 bit greyscale image

FIXME - this should be handled by the libraries now