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.0b0.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.0b0-cp37-cp37m-win_amd64.whl (668.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7m

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

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

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

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

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

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5m

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

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

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

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

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

File details

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

File metadata

  • Download URL: fabio-0.9.0b0.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.0b0.tar.gz
Algorithm Hash digest
SHA256 92b4f48dc774c65c5612abdc9236f27d2b9c9a4785bfa5cd7069e3bfbb8b4950
MD5 09ee30c876f75176d79b2bed3dfb7f5d
BLAKE2b-256 c4935880aa958732177ce3e0ecf170935a347698bb17304d0828f23f5474faf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 668.6 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.0b0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6ccdb97ef558284f4e2f672e04ec02fddd9ede853d11ee5a52f00fc3a6806bb3
MD5 49f13f81403c867ed529c94543a61696
BLAKE2b-256 42ad7f30713ce1b7445217902d2d5068e0ae2dc4c6a4e2c517db4a7150c333a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-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.0b0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4d951a811c93a68fb723f072db12f52064d3c598a20819ab332509d1477f4ce6
MD5 d77ae0012deee4b92e95589ed484d513
BLAKE2b-256 bd7990a79a7bdbd3a2775c986991f62daa0405b8cfe264761eb58a81fde27ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.0b0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 833a2be4bd83fa7375f05c71950a973744c46319f660e7bc3c8a5b6c3df451b0
MD5 283f5cc4f85e72b81efbad895a049f4e
BLAKE2b-256 0e5b331210a225c33fa23eab80c782453c958acee1a43256b02b898192816840

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 668.2 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.0b0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 82d15b4a8ddb0470a422f0178eb118aecf1d2ee01e0a22a17bba2a90026eb19c
MD5 31379dc403db69769f4f8284cbc799a3
BLAKE2b-256 fe3fb53efd9107fd182695e77c203021539b2e0641977a5afb3a54510bcc7cff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-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.0b0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cc4bc97062f5099c59d62b50b213cd39b0a2b2fb8bce4039dee9532c56731ae5
MD5 a5853526fa0284a3345930547b565a69
BLAKE2b-256 deaa2ddd56f87e92a60e07805eb4526dc6e11ebd3085f631c6aa86045d43a050

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.0b0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 911cf2c026d837315a9342b926c3403f8d9c0e51af0c43b311ef12d38aef87a3
MD5 e5edec105b90c965b3742228a1e8bc70
BLAKE2b-256 bf1d90dd24dd8953ad6940e7de95afe308f8e1efcf459d4531e170a32d6e7f22

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 662.2 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.0b0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d29376cd1e4380e1bcd098641b8b86568cc1e19642bc8942f27b2bfc69620e1c
MD5 36f2a371f5ced4dc36c0d04853c31461
BLAKE2b-256 9ce3aba14937efe1832120bc9f72511c28162708943368ae52b2364db6814e1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-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.0b0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 aec343cd3d0dcf62f789f557ce0d5d7dd3fe3aa217b052f18b475b7bdcb6bcb5
MD5 4fdc0a18a2826dde72d8e05f551a4919
BLAKE2b-256 89904b6e1f61a69367449dd21af150140a01623994b984a9fba8e38104e4555b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.0b0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 93ac4ffe343a2823e26be10e577a5a267ac0549cab63579489a6dd04ace9b8ac
MD5 6eb5a5294a7fe55dd3ab332ce9c2d6ac
BLAKE2b-256 ec97b39706802b3763164ee5d23e8f93edfd0a9e2b7a13a7a3f02d9ab8296044

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-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.0b0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dda55a4ff507775b646598eda8094913cce760d8896a98a8f67794561f130207
MD5 3429277599492a4faff062555f33207c
BLAKE2b-256 8f66c6b256312cfd467cfa87550c294db044aace0b1c76ce4056175861af08b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.7 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.0b0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b04c27fa37745e309ff82ee5ab49ced320ebcb9a6b6092fd85894264c55ad6a1
MD5 6b15e0494fdfa3c47bd021f6a583f393
BLAKE2b-256 5f3daa5e52d3fe770c243dfb9ef4e4bd50af94e0a2de684955e1c7b3264fd5e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 678.6 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.0b0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2d9b9bc1660debf34d39a166898566366ba50dc6334f57f65ce6a8fe1a18edb8
MD5 6d4e7612942b16da7a54e8bf43143f5f
BLAKE2b-256 2ba34976ae4dfd9b41f5bfdc2de4756a98124299281ef9bd8ec9d3657123ca49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-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.0b0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 30d0fff8e2505f2036c64088911dc417a32f2c975ef2c036c0ce6316e6d26b72
MD5 48bee0a3fda889f523d89d525196b814
BLAKE2b-256 00bedd12490b5fff88bc2e0bb74b75c6e797fa413646215892e2c9b2a9e67745

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.9.0b0-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.0b0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d50f09097d33096a377c91554ee2945c95e75bfdd46216d69ae8f00c21eae144
MD5 976dc4106d04bef8af38b27ac6c4c0c5
BLAKE2b-256 22651c9b9f445e8640788f4cc1127451360dec6f71c0b928d409d2cfc7e1b75a

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