fabio.fabioimage.fabioimage

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

# Class fabioimage

source code

    object --+
             |
            fabioimage

Known Subclasses:
  - fit2dmaskimage.fit2dmaskimage
  - , tifimage.tifimage
  - , kcdimage.kcdimage
  - , brukerimage.brukerimage
  - , cbfimage.cbfimage
  - , edfimage.edfimage
  - , GEimage.GEimage
  - , xsdimage.xsdimage
  - , binaryimage.binaryimage
  - , OXDimage.OXDimage
  - , mar345image.mar345image
  - , dm3image.dm3image
  - , adscimage.adscimage
  - , GEimage_old.GEimage
  - , pnmimage.pnmimage
  - , fit2dspreadsheetimage.fit2dspreadsheetimage
  - , HiPiCimage.HiPiCimage

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
getclassname(self) Retrieves the name of the class | source code
getframe(self, num) returns the file numbered 'num' in the series as a fabioimage | source code
previous(self) returns the previous file in the series as a fabioimage | source code
next(self) returns the next file in the series as a fabioimage | source code
toPIL16(self, filename=None) Convert to Python Imaging Library 16 bit greyscale image | source code
getheader(self) returns self.header | source code
getmax(self) Find max value in self.data, caching for the future | source code
getmin(self) Find min value in self.data, caching for the future | 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
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
getmean(self) return the mean | source code
getstddev(self) return the standard deviation | source code
add(self, other) Add another Image - warning, does not clip to 16 bit images by default | source code
resetvals(self) Reset cache - call on changing data | source code
rebin(self, x_rebin_fact, y_rebin_fact, keep_I=True) Rebin the data and adjust dims | source code
write(self, fname) To be overwritten - write the file | source code
save(self, fname) wrapper for write | source code
readheader(self, filename) Call the _readheader function... | source code
_readheader(self, fik_obj) Must be overridden in classes | source code
update_header(self, **kwds) update the header entries by default pass in a dict of key, values. | source code
read(self, filename, frame=None) To be overridden - fill in self.header and self.data | source code
load(self, *arg, **kwarg) Wrapper for read | source code
readROI(self, filename, frame=None, coords=None) Method reading Region of Interest. | 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
_compressed_stream(self, fname, system_uncompress, python_uncompress, mode=`'``rb``'`) Try to transparently handle gzip / bzip without always getting python performance | source code
convert(self, dest) Convert a fabioimage object into another fabioimage object (with possible conversions) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods | [hide private]
checkHeader(header=None) Empty for fabioimage but may be populated by others classes |
checkData(data=None) Empty for fabioimage but may be populated by others classes, especially for format accepting only integers |

Class Variables | [hide private]
| _need_a_seek_to_read = `False`
| _need_a_real_file = `False`

Properties | [hide private]
| classname Retrieves the name of the class
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, data=None, header=None) (Constructor) | source code
Set up initial values Overrides: object.__init__

### getclassname(self) | source code
Retrieves the name of the class Returns: the name of the class

### toPIL16(self, filename=None) | source code
Convert to Python Imaging Library 16 bit greyscale image FIXME - this should be handled by the libraries now

### 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 ?

### readROI(self, filename, frame=None, coords=None) | source code
Method reading Region of Interest. This implementation is the trivial one, just doing read and crop

### _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 ?

### convert(self, dest) | source code
Convert a fabioimage object into another fabioimage object (with possible conversions) Parameters: `dest` - destination type "EDF", "edfimage" or the class itself

Property Details | [hide private]

### classname Retrieves the name of the class Get Method: getclassname(self) - Retrieves the name of the class