Skip to main content

Image IO for fable

Project description

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

Debian/Ubuntu packages, and wheels are available for windows, linux and MacOSX from the silx repository:

Documentation is available at PythonHosted, Continuous documentation at ReadTheDocs and Nightly build documentation at silx.

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.

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

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.9.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.9.0-cp37-cp37m-win_amd64.whl (679.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

fabio-0.9.0-cp37-cp37m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.7m

fabio-0.9.0-cp37-cp37m-macosx_10_6_intel.whl (1.1 MB view details)

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

fabio-0.9.0-cp36-cp36m-win_amd64.whl (678.7 kB view details)

Uploaded CPython 3.6mWindows x86-64

fabio-0.9.0-cp36-cp36m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.6m

fabio-0.9.0-cp36-cp36m-macosx_10_6_intel.whl (1.1 MB view details)

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

fabio-0.9.0-cp35-cp35m-win_amd64.whl (672.7 kB view details)

Uploaded CPython 3.5mWindows x86-64

fabio-0.9.0-cp35-cp35m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.5m

fabio-0.9.0-cp35-cp35m-macosx_10_6_intel.whl (1.1 MB view details)

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

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

Uploaded CPython 3.4m

fabio-0.9.0-cp27-cp27mu-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 2.7mu

fabio-0.9.0-cp27-cp27m-win_amd64.whl (689.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

fabio-0.9.0-cp27-cp27m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 2.7m

fabio-0.9.0-cp27-cp27m-macosx_10_6_intel.whl (1.1 MB view details)

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

File details

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

File metadata

  • Download URL: fabio-0.9.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e8f357e24a7c128d9f9c01981de14fd092c9a4adf9896251402ca4d2fa382d1e
MD5 06dea46845afb8f883d4c4e4df5f6440
BLAKE2b-256 c895e995426701a9e3a4cb251367d8a02c696e7e2bff2b96b476c97b4b2c37e1

See more details on using hashes here.

File details

Details for the file fabio-0.9.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: fabio-0.9.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 679.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 33931119703a20b2a9b691c16b43711fb1a90628b09c9c426e8bcad2c4780f47
MD5 1e00f3ee272dcdf26b52d78332cebe5c
BLAKE2b-256 cf66393c6d4aa6df92c293a9710cc9c408370f1a114200aec25a7ae2f0bcabcb

See more details on using hashes here.

File details

Details for the file fabio-0.9.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: fabio-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b8e98041adfdc2d091abc4e84f79de944c70a2146bcba73fa62730fbb46aa6db
MD5 0ae48345a85655d0ea8326f385834fbe
BLAKE2b-256 2c1aca0ec0fe8ccc5930d5b03ea0a6b1ac118dfc3795a553d7a49e4045301daa

See more details on using hashes here.

File details

Details for the file fabio-0.9.0-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

  • Download URL: fabio-0.9.0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 0fefbc50129e67575ec88cbc207be00b9943038bcc0c62e186ebd54702218027
MD5 3c45f9bae1c46b912d14756d872ae99f
BLAKE2b-256 49baf8d37fdabda3ea80fdbde5cc1503bfba10ec38e4ea7eec70cd1eb98a2391

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 678.7 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 dead0e28bb78b1b4c1bd82ff016af58128d241c878bbb7c673a7ba00941142d7
MD5 4d6b5eaf8832ca349933288bd8e3b9a7
BLAKE2b-256 417d7862fb833e4e9b8c86101b7823777411f5600af8fd7adf5d7b3e5138e6cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 abaf71498b19791a7aacb368d070002cdba3f63a624517eeb9b5671cbd2acd10
MD5 9d6d4b8c25745411988b09c4ee1ae061
BLAKE2b-256 a3dc7d465a1a44ef7163205e44abe35cad4d0adc75730883b613d4b38165d1a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 7cd77621e08016bae39524b8c2040d535dc07d81b25e632b8c996f43f9885437
MD5 3b3339d700a4e149c8c5c55cf244a3f7
BLAKE2b-256 fe30a63c3047c9904c4dd8402cc39ad47904363ea204c3091708a459429015ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 672.7 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 76efcc5d150681d965f2f0d8d29af1176245ff11d1fddb33079e28df069cbda2
MD5 6beb7c47349ffe76aee7e936985796ac
BLAKE2b-256 4dfc3ce3a5181a79f8be7a464e20a1394e0bea58208cce49d243fcb2040c9931

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 217cd8dcd43be3543af4c357f303d418d742592c64ff5a54f85293da718ebef4
MD5 d0ad5e990ac26209b3fe6a4d70c700ac
BLAKE2b-256 5206e8e0259b2d797d1be4c0411e8849014b03838deb7b0af1c6cf90b752a811

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.5m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 9de4e5dab3a813479110870010a5c14c5e4fa5963a919ebf0af689508f51b466
MD5 0d1f917f5d1019629fd199ceb5faf484
BLAKE2b-256 4e0c345c8ec600ad316ca3c7107e6aea99fc8ecd8f0879e2d815804d6e541944

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b74e20cafb69eb95423262bc84ddc5f50777ecefe9644931fefb1523522c358
MD5 be6a7ef26421e94ff3268530ce68e271
BLAKE2b-256 cade1559efb63bd04ab6ebe2b815f558189d476112736f6ff0e536927358d6ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 164570828d01ce075aa7883926adb50e0747394593038d0bf1adc517fad6a8a7
MD5 31695e507ab737221fc79720d9e1336f
BLAKE2b-256 c4ebb79e3672708ed92b95c306fd49c9b315b51b997f244ef0be762c1825d8a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 689.1 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 f5b0d0d3a7bb84e55bce29512c8e1932d6f95e61e8fbfdf5e9dd81a13200956a
MD5 2667b28962c78c257a5674212972e039
BLAKE2b-256 156c5f393a65dde0133cdea8aef5f4f7130bbe8b008f956808197a96a82483ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 16eacc01c96da8c0fa0dcc957f5b573fa79398636aca91f7278b66fbeb78c18e
MD5 fa6fb9f331cefceb6a4bac195619bed4
BLAKE2b-256 8b2f5a14ec53b3045d1ea7dbe29dd543121800e46c998b9d3791ade904148f03

See more details on using hashes here.

File details

Details for the file fabio-0.9.0-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

  • Download URL: fabio-0.9.0-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 2.7m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.5.3

File hashes

Hashes for fabio-0.9.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f342b64b6f484ba942c2b4781d722f320d22ac3440ed4df465a57f63543ce176
MD5 a1d11a0e1b0e6ab959380e20e88100f9
BLAKE2b-256 6de2de554f7c7180f7f5cbe9c79750a198cfd01c8c1761e5ab1003ae97190034

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