Main websites:
|Build Status| |Appveyor Status|
FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python. FabIO support images detectors from a dozen of companies (including Mar, Dectris, ADSC, Hamamatsu, Oxford, ...), for a total of 30 different file formats (like CBF, EDF, TIFF, ...) and offers an unified interface to their headers (as a Python dictionary) and datasets (as a numpy ndarray of integers or floats)
.. contents:: :depth: 1
FabIO is available from PyPI <https://pypi.python.org/pypi/fabio>
_:
pip install fabio
Debian/Ubuntu packages <http://www.silx.org/pub/debian/binary/>
, and
wheels <http://www.silx.org/pub/wheelhouse/>
are available
for Windows, Linux and MacOSX from the silx repository.
See the installation instructions <http://www.silx.org/doc/fabio/latest/install.html>
_ for more information.
Open an image .............
import fabio obj = fabio.open("mydata0000.edf") obj.data.shape (2048, 2048) obj.header["Omega"] 23.5 obj.data array([...])
Save an image (ex: EDF) .......................
import fabio obj = fabio.edfimage.EdfImage(data=[...]) obj.write("mydata0000.edf")
See the latest release documentation <http://www.silx.org/doc/fabio/latest/>
_ for further details.
Documentation of previous versions are available on silx <http://www.silx.org/doc/fabio/>
_.
See http://www.silx.org/doc/fabio/latest/Changelog.html
The general philosophy of the library is described in:
FabIO: easy access to two-dimensional X-ray detector images in Python; E. B. Knudsen, H. O. Sørensen, J. P. Wright, G. Goret and J. Kieffer Journal of Applied Crystallography, Volume 46, Part 2, pages 537-539. <http://dx.doi.org/10.1107/S0021889813000150>
_
For FabIO to handle gzip and bzip2 compressed files transparently, bzip
and gzip
modules must be present when installing/building Python (e.g. libbz2-dev
package for Ubuntu).
Benchmarking details have been collected at http://www.silx.org/doc/fabio/latest/performances.html.
ADSC:
Bruker:
D3M
Dectris:
h5py
)ESRF:
General Electrics
Hamamatsu
HDF5: generic format for stack of images based on h5py
JPEG image format:
Mar Research:
MPA multiwire
Medical Research Council file format for 3D electron density and 2D images
Nonius -> now owned by Bruker
Numpy: generic reader for 2D arrays saved
Oxford Diffraction Sapphire 3
Pixirad Imaging
PNM
Princeton Instrument SPE
Raw Binary without compression
Rigaku
Tiff
Name: .....
FabIO = Fable Input/Output
Idea: .....
Have a base class for all our 2D diffraction greyscale images. This consists of a 2D array (numpy ndarray) and a python dictionary (actually an ordered dict) of header information in (string key, string value) pairs.
Class FabioImage ................
Needs a name which will not to be confused with an RGB color image.
Class attributes, often exposed as properties:
Class methods (functions):
Each individual file format would then inherit all the functionality of this class and just make new read and write methods.
There are also fileseries related methods (next(), previous(), ...) which returns a FabioImage instance of the next/previous frame in a fileserie
Other feature:
.. |Build Status| image:: https://travis-ci.org/silx-kit/fabio.svg?branch=master :target: https://travis-ci.org/silx-kit/fabio .. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/4k6lol1vq30qhf66/branch/master?svg=true :target: https://ci.appveyor.com/project/ESRF/fabio/branch/master