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.6.0.tar.gz (614.7 kB view details)

Uploaded Source

Built Distributions

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

fabio-0.6.0-cp36-cp36m-win_amd64.whl (599.3 kB view details)

Uploaded CPython 3.6mWindows x86-64

fabio-0.6.0-cp36-cp36m-manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.6m

fabio-0.6.0-cp36-cp36m-macosx_10_6_intel.whl (1.3 MB view details)

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

fabio-0.6.0-cp35-cp35m-win_amd64.whl (599.8 kB view details)

Uploaded CPython 3.5mWindows x86-64

fabio-0.6.0-cp35-cp35m-manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.5m

fabio-0.6.0-cp35-cp35m-macosx_10_6_intel.whl (1.3 MB view details)

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

fabio-0.6.0-cp34-cp34m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

fabio-0.6.0-cp27-cp27m-win_amd64.whl (622.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

fabio-0.6.0-cp27-cp27m-manylinux1_x86_64.whl (1.7 MB view details)

Uploaded CPython 2.7m

fabio-0.6.0-cp27-cp27m-macosx_10_13_intel.whl (1.3 MB view details)

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

fabio-0.6.0-cp27-cp27m-macosx_10_7_x86_64.whl (996.9 kB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: fabio-0.6.0.tar.gz
  • Upload date:
  • Size: 614.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio-0.6.0.tar.gz
Algorithm Hash digest
SHA256 926b6f7ae7fc611b5972f22e2b111a30fa1a9aaa2dc71895f458d642f16142cc
MD5 9bcb1b2874d11a11ce4eb0a902ac4747
BLAKE2b-256 f5f8ca0592558013921818fb162cdaba082a395895989c4be18c43c00652eec2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 734e57ca6f7f14444a348f5169739316cd11c27381aefa4ac94fda547889c8ff
MD5 d582381a84d987f62aa0415ec6681c51
BLAKE2b-256 4281e6a6d584757eab08f03eccff71f9770752e1add9a09348db2e77a09b743a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1f4a7f06de7f4dd1b7502f8d5310b1dfa718844c304f251301baeb236ed0b09e
MD5 66ad3789e70616f36bd356569656cd22
BLAKE2b-256 2445ac9d2cf05880402959297b16d34a4a6722157da8cec7976943fea1529179

See more details on using hashes here.

File details

Details for the file fabio-0.6.0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for fabio-0.6.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 2f17397ff63f60f3272a10261badfb92aad1de0e71bc8b0322d9ee52a09c3b12
MD5 aee327ee2d5f984e0d07bc8ceb88ef7f
BLAKE2b-256 f307272cd306512f5c5aca2af13466ef217b840462ee0308d0e673162ca0de19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 f7d614df297f1426dc861b7ba97991515641953f3c2c08890316ea0107845199
MD5 df1b82cf4f8a709192f847e661e7033b
BLAKE2b-256 7e769cf608681b5a87246f0303692f10df1ad6cb6e23c6992da94db1a729b6bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4a797236fe709f6f14b9ea5aa6616ce699a87752e35a87ae568e15e07f6f1b72
MD5 c88c5d37994e758773e950258d875d79
BLAKE2b-256 36bee360b549339f046d813ed39d66db339be5ab0767f3cf1874c3a3fb02751a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 5183a2f9b27832972c5271ad5a1f6970e0567b73beb1fdb16db2d6a985e1a124
MD5 2e41635bec78c0ee3f136f02984c0023
BLAKE2b-256 4e0cf607ffe884b3f273ee48a1bb18451b3fb69d6e508d3e772efeb98433fb5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 75a128cbaecf628f83239947bbd38f4ac41b29b3c6dadeca3b41dc38ff8f35f0
MD5 1ec0a1a5265fb44f0ac4084c2f5ba2e9
BLAKE2b-256 fe71d791bf746873b7170002fde570911aae262b42a3bf6e4f661794b37821c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 61e614b69730caeaa1ce3f1cf5018f26b12b3af9d7822a45ee37bf242072bff0
MD5 08854f669f6b9e536cea1a45c29d5c1e
BLAKE2b-256 260816915dc6bf11b550bc49218585c8f30f87d9540bf3cb96a7a4f4cff9aaa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 737aef6a06dd910b06a18f6c7b08645a07f35a5b9743b3d0371e2c3e6680f193
MD5 7182b0b05634b300b22e6254c4c1a9ff
BLAKE2b-256 8ffa53ef7cf16c4da137f9c2501254a9949423e60c3ba1e7185ec111e936a1ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bbb613980e92acc43e9dc9ba3786445d45053b913bae67602b78265abbe16c74
MD5 5f22393cfdf7f2ca9604fb847a91961a
BLAKE2b-256 6329553e11dadcb9942574cd4f265e13a8db4e948ea5192af4d6ab38f450c728

See more details on using hashes here.

File details

Details for the file fabio-0.6.0-cp27-cp27m-macosx_10_13_intel.whl.

File metadata

File hashes

Hashes for fabio-0.6.0-cp27-cp27m-macosx_10_13_intel.whl
Algorithm Hash digest
SHA256 4111050d53ce2cfc7e4dad5fe24231e30eb592b3e4da5d095f30976a463bf5ee
MD5 823232e6605538656de58fd716ea75dd
BLAKE2b-256 4fc4db804e89c5b21a71da1fd666320b6a09088bb47af56bcf0820e8a7660247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.6.0-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f165d1302bf9fb92e4db67efd562ac143ee78e22d6ea97c99cc7f85f6f462c5e
MD5 262c42ddca7b924a257e084cca1a6d00
BLAKE2b-256 8a27550e3b84b141e5e1caf9be3ae8a3c04d07e17c26a2d24efd913e40c66410

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