Skip to main content

Image IO for fable

Project description

FabIO: Fable Input/Output library
=================================

Main websites:

* http://fable.sf.net
* https://github.com/silx-kit/fabio


|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 20 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)

Getting FabIO
-------------

FabIO is available from `PyPI <https://pypi.python.org/pypi/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:

Documentation is available at `PythonHosted <http://pythonhosted.org/fabio/>`_,
Continuous documentation at `ReadTheDocs <http://fabio.readthedocs.io>`_ and
Nightly build documentation at `silx <http://www.silx.org/doc/fabio/>`_.

Citation:
---------
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>`_

Transparent handling of compressed files
----------------------------------------
Fabio is expected to handle gzip and bzip2 compressed files transparently.
Following a query about the performance of reading compressed data, some
benchmarking details have been collected at fabio_compressed_speed.
This means that when your python was configured and built you needed the
bzip and gzip modules to be present (eg libbz2-dev package for ubuntu)
Using fabio in your own python programs
Example::

>>> import fabio
>>> obj = fabio.edfimage("mydata0000.edf")
>>> obj.data.shape
(2048, 2048)
>>> obj.header["Omega"]
23.5


Design Specifications
---------------------
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:

* data -> 2D array
* header -> ordered dictionary
* rows, columns, dim1, dim2 -> data.shape (properties determined on the fly)
* header_keys -> property for list(header.keys()), formerly used to retain the order of the header
* bytecode -> data.typecode() (property)
* m, minval, maxval, stddev -> image statistics, could add others, eg roi[slice]

Class methods (functions):
..........................

* integrate_area() -> return sum(self.data) within slice
* rebin(fact) -> rebins data, adjusts dims
* toPIL16() -> returns a PILimage
* getheader() -> returns self.header
* resetvals() -> resets the statistics
* getmean() -> (computes) returns self.m
* getmin() -> (computes) returns self.minval
* getmax() -> (computes) returns self.maxval
* getstddev() -> (computes) returns self.stddev
* read() -> read image from file [or stream, or shared memory]
* write() -> write image to file [or stream, or shared memory]
* readheader() -> read only the header [much faster for scanning files]

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:

* possibility for using on-the-fly external compression - i.e. if files are stored as something as .gz, .bz2 etc could decompress them, using an external compression mechanism (if available). This is present in fabian but requires that images are edfs.


Known file formats
------------------

* Bruker:

+ BrukerImage
+ Bruker100Image
+ KcdImage: Nonius KappaCCD diffractometer

* Mar Research:

+ MarccdImage (fileformat derived from Tiff)
+ Mar345Image imaging plate with PCK compression

* Dectris:

+ CbfImage (implements a fast byte offset de/compression scheme in python/cython)
+ PilatusImage (fileformat derived from Tiff)
* EigerImage (derived from HDF5/NeXus format)

* ESRF:

+ EdfImage: The ESRF data Format
+ XsdImage: XML serialized image from EDNA
+ Fit2dImage: Fit2d binary format
+ Fit2dmaskImage: Fit2d Mask format
+ Fit2dSpreadsheetImage: Fit2d ascii tables (spread-sheet)

* ADSC:

+ AdscImage

* GE detector at APS

+ GEimage

* PNM

+ PnmImage

* Tiff

+ TifImage
+ TiffIO from PyMca

* D3M

+ D3mImage

* Hamamatsu

+ HiPiCImage

* Oxford Diffraction Sapphire 3

+ OXDimage uncompressed
+ OXDimage with TY1 byte offset compression
+ OXDimage with TY5 byte offset compression (experimental)

* Nonius -> now owned by Bruker

* HDF5: generic format for stack of images
+ Hdf5Image
+ EigerImage

* Raw Binary without compression

Installation
------------

Please see doc/source/INSTALL.rst

Changelog
---------

Please see doc/source/Changelog.rst

.. |Build Status| image:: https://travis-ci.org/kif/fabio.svg?branch=master
:target: https://travis-ci.org/kif/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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabio-0.4.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fabio-0.4.0-cp36-cp36m-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.6m

fabio-0.4.0-cp35-cp35m-win_amd64.whl (725.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

fabio-0.4.0-cp35-cp35m-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.5m

fabio-0.4.0-cp35-cp35m-macosx_10_6_intel.whl (998.9 kB view details)

Uploaded CPython 3.5mmacOS 10.6+ Intel (x86-64, i386)

fabio-0.4.0-cp34-cp34m-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.4m

fabio-0.4.0-cp27-none-macosx_10_11_intel.whl (985.7 kB view details)

Uploaded CPython 2.7macOS 10.11+ Intel (x86-64, i386)

fabio-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 2.7mu

fabio-0.4.0-cp27-cp27m-win_amd64.whl (736.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

fabio-0.4.0-cp27-cp27m-win32.whl (829.2 kB view details)

Uploaded CPython 2.7mWindows x86

fabio-0.4.0-cp27-cp27m-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 2.7m

File details

Details for the file fabio-0.4.0.tar.gz.

File metadata

  • Download URL: fabio-0.4.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1b260a2d12ded7d09329d223a098cb7c5cf2626fdc9e3a7b6bdd303e3af61099
MD5 146804f6aad9d75b49257cc123d6d5c6
BLAKE2b-256 a2c6684095aa079cadd9e3f68f95084cccd7601f744782086b14a516b166f37a

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 079ed4d0c5b9a7bf466627240007bb95980194674c470ccf1a8bd36cbfe65012
MD5 581d0f8aee17122f04ace1efc23bf391
BLAKE2b-256 c0a4b9de29f0b721cb7d1ab801fa738f01c904486e431048748bad7baf0c6abb

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 156bcb7cf1e9443b67d43ada4d1929902bbaeb51a1da306e22ba71fb20a48a90
MD5 fe5e42c216cafa54072a5f735797876e
BLAKE2b-256 40f4baeaf85d779ac341cb2379e37484148ad4194e62810feea0484ccaa3a0f7

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea20b039aa394d825131327a07292d989bcca34ba7f7d91949988cba2a91e22d
MD5 80ba4e43ba0a673eee1bc8810b94404a
BLAKE2b-256 3fcb841dc884941540e7cfe29de92b8888f29e2572be9aac35330a88961dcd7e

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 b29db0186da67bf2ca7a127e9cb0884073f28cf7688844892620f4b17b631e27
MD5 70c27694e5fea43bb57a75c205a7579b
BLAKE2b-256 02cf74dac28d110752347845c89d5f185be22e011afb69d4ba89d590b4d6cb3d

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 be83318c95f7806c0fe6e50c127730da6971cbe44dd0557c645b40d9cd86f62c
MD5 1f02635b08cc40e341afbad4e93ec03d
BLAKE2b-256 f67d0cd9b4f3eaf464b32c33f2f0ff29a2f9002e267c8151e88517173d3061b0

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp27-none-macosx_10_11_intel.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp27-none-macosx_10_11_intel.whl
Algorithm Hash digest
SHA256 383b0deb566968f2d1618cff31961e3ba02aae3e2584c09ba083502d2879ea37
MD5 90619ec463fecd4d26149746e2274474
BLAKE2b-256 ec75802927299dfb84b2ea5da1e163d635fd7d3ca2ea41a0b038b2cfb0091209

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1a8e554e1a6d17f6e3d1201036e579bad3c8f4d38a79375b42e3af6cc97c3ff7
MD5 caa2ae7493b2f3315bc383b09e7672f1
BLAKE2b-256 192fddbe8932308220d24e60dcdf2aebf30c40f8b26a4921802f602c3dbd5f62

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ea474523618f51e40fc9558d815fa26564d76dfd0cd33098f33af77e7b603c5b
MD5 f5213a1ff5da332444b1b9f50a67e145
BLAKE2b-256 9d7b00b1cc4748f730b1c9958eb3386f7441242695e567be4d3202c784a7b004

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 f38f49434adc1f223d570aa0c2ce6f68a55204afd872722a0c59283ac894a7c1
MD5 2db2ba54d745d5b7976440b6d4c7ee14
BLAKE2b-256 11ca15ab25191cd4c622a1fb07ab1649b88ce168edd6259e157240758e792456

See more details on using hashes here.

File details

Details for the file fabio-0.4.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.4.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a8ff29431d0d1bcf574d19a6c80743d6aa39b08dc2ec504a7a83f29ece9878e6
MD5 e7488a980ee1f9d3ef3a8cd0928bcca3
BLAKE2b-256 d92698cecb312452ed7541932c188dd7ad2b7ff28f799f3afa44f0a47831ace5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page