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/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


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.5.0.tar.gz (1.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.5.0-cp36-cp36m-win_amd64.whl (507.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

fabio-0.5.0-cp36-cp36m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m

fabio-0.5.0-cp36-cp36m-macosx_10_7_x86_64.whl (939.9 kB view details)

Uploaded CPython 3.6mmacOS 10.7+ x86-64

fabio-0.5.0-cp35-cp35m-win_amd64.whl (507.1 kB view details)

Uploaded CPython 3.5mWindows x86-64

fabio-0.5.0-cp35-cp35m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.5m

fabio-0.5.0-cp35-cp35m-macosx_10_7_x86_64.whl (949.9 kB view details)

Uploaded CPython 3.5mmacOS 10.7+ x86-64

fabio-0.5.0-cp35-cp35m-macosx_10_6_intel.whl (1.2 MB view details)

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

fabio-0.5.0-cp34-cp34m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.4m

fabio-0.5.0-cp27-cp27mu-manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 2.7mu

fabio-0.5.0-cp27-cp27m-win_amd64.whl (523.9 kB view details)

Uploaded CPython 2.7mWindows x86-64

fabio-0.5.0-cp27-cp27m-manylinux1_x86_64.whl (1.5 MB view details)

Uploaded CPython 2.7m

fabio-0.5.0-cp27-cp27m-macosx_10_11_intel.whl (1.2 MB view details)

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

fabio-0.5.0-cp27-cp27m-macosx_10_7_x86_64.whl (973.1 kB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fabio-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2241624ddcf9d82d61dd1d44a802678a784162f2e47c13e7eb1d9a1483c3383d
MD5 c8af0e3498d99def572bf1b57c098899
BLAKE2b-256 32904116b69f7cacfb1b11bb7e3ede93e1772b63c45efc0553b6c339e6028824

See more details on using hashes here.

File details

Details for the file fabio-0.5.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e1499cf18fb6b8699801c96e14d9e357a9634902aae00538f1c998eb60b6cab7
MD5 b6bef53a8eafaea60b0c7bf490b63d8a
BLAKE2b-256 fa67d1ee9c1424031b121f6647ceac1f140e5b213ffc6641e4548275121c4f43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 91ff205c4bad66807e2fe5ff490e9932c85054df863243fc4deae7b790edce43
MD5 0b3f9484e1bc61d408422e29ca62e8ac
BLAKE2b-256 1c3a1fc31a1c156a67a6f0688567e859037d8496a603edf31ed3d1514adbb66d

See more details on using hashes here.

File details

Details for the file fabio-0.5.0-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.5.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fcfc3f854119f6813d94c2e4fb918593ffc1b860763fb3a0e572136590adfed6
MD5 ed7ab579f99604370274e8554ec84d15
BLAKE2b-256 d98abb6b9ee0279aba1aba4d2b7867e468f2cede441f0237bbe0ab69eef7a3b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9fd9a63607176bae8bc5397570c72cc86730440024649a39b0bc008b5d70e660
MD5 6ddbe0de4317fd6c9ddc9de2a085167e
BLAKE2b-256 5a16126a4e9dc0d81a1eb52a40d63a0e782171364b14bc5a04b77f8377c0f0bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a3f60296403fdf878338336b13b538197d10a905d917736e54f6ae8a09a11c92
MD5 3a9c230a8eedc607e92532381b3b3ee2
BLAKE2b-256 b4226beef00f5048cdd04a4555411a3593acb2a0a389ebc84497802861b1237e

See more details on using hashes here.

File details

Details for the file fabio-0.5.0-cp35-cp35m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.5.0-cp35-cp35m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5ab679e87696f238e5daa63211177f61f94e7d1c825da88ee88c6309b69519d3
MD5 e1363349b2cc03c1c02eca460ebfa72f
BLAKE2b-256 5b5afdf8ba53b5188567333d9e8750225eb983380b95c683a6d122e4fdc19579

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 286c53f17e4a7a4026b82d68acf75ea17774f35d84afc8678c61ef8ba34d26b6
MD5 3895bd714699081da68c4dd9d1ff43d4
BLAKE2b-256 bf1dd048d3d720ec3e79bf3ab539932461d379149e9054fd26d65ce075ac2e2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e42fff25bc1e9992703597484a14f3b9eaddced25e7490a611220df36a8d95c7
MD5 c95a40d2797483ac728251d66b346d06
BLAKE2b-256 e5eec7cbbbd7b2f197b23cf83c59cd54a91380d251dd465d4f1c28753a21f598

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 86b8ba1b1d2f8ce141fdb064a1a0a2594e4c3b129e02abb8938c2969f9c17a82
MD5 165f2ce0adee9bcf3281d3ed418c0195
BLAKE2b-256 89ef0ea6529faa53441d944b75bbafff28ddd6a0cf5024a4bc2cd3d8eb31b485

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 aa1af094bd538641580b412cc77155590845552aae3eb4fdaa75b8a0e3ff097a
MD5 8f645efbfb1393ed968ffa57bb1e58f1
BLAKE2b-256 4fc475b0ff7f3b8ade1df5e974bf6e1e715ee0415c67ae62be86f7caa3b739b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.5.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d40532a143573006914cb3647e9fa5e18f2e3b97bbe254cd359637d6c5a46bf9
MD5 6ced92c88f13294e97660495680dfc62
BLAKE2b-256 6eba2470dbf1a70adc6a295240f7991f4f5cd69ac83ecdcd8caa8372972eaa30

See more details on using hashes here.

File details

Details for the file fabio-0.5.0-cp27-cp27m-macosx_10_11_intel.whl.

File metadata

File hashes

Hashes for fabio-0.5.0-cp27-cp27m-macosx_10_11_intel.whl
Algorithm Hash digest
SHA256 953596f0d13447e5f4922811438a803fd7cd1892d2bd8f854218eb93c0cc16ef
MD5 8d2fb03c90f9683487c8eae182c8294e
BLAKE2b-256 c66c13380d59578fcd8b999b6bf7d1c84bad57d03238e3da604978e41633b842

See more details on using hashes here.

File details

Details for the file fabio-0.5.0-cp27-cp27m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for fabio-0.5.0-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 0a21c87ef688d01c16805275e6a81b3acb472be817ba77a2371f42cdad9f13b3
MD5 791a122c56bc62102acab667f0256599
BLAKE2b-256 184fd241e629d27e399ae749f7ee3c53740d4f491f4012120a230d95d4400f39

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