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.7.0.tar.gz (618.6 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.7.0-cp37-cp37m-win_amd64.whl (603.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

fabio-0.7.0-cp36-cp36m-win_amd64.whl (598.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

fabio-0.7.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.7.0-cp35-cp35m-win_amd64.whl (600.9 kB view details)

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5m

fabio-0.7.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.7.0-cp34-cp34m-manylinux1_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

fabio-0.7.0-cp27-cp27m-win_amd64.whl (623.2 kB view details)

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

fabio-0.7.0-cp27-cp27m-macosx_10_6_intel.whl (1.3 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for fabio-0.7.0.tar.gz
Algorithm Hash digest
SHA256 92cc59af110025b4cb8ee31a634579cda7536b88756c2b27d37193a846eadf4b
MD5 f83e05cfa2b2653855f1cc68bad1a3f8
BLAKE2b-256 ade616e3e7d835061f695a9f66cdb1598824500a490d0ebda2d525334b7cc3f2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fabio-0.7.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a50dfefdc738a84834a03602e42eecdf2a8115e43d080fe427ae2de6e7f4c314
MD5 8fdd190787cc2d19f6e006d1b855b001
BLAKE2b-256 e91987d749ddde7b4cd66e4b11aaf1ac1c8acd9c752c442b498c44a67175bcf8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d5a3a9f6dff96540c03db3ca80f788ed6b66d82a07ee57256eb0a5acf5407113
MD5 7c15208a6fed3c0175a7f2f96d757af1
BLAKE2b-256 2b9a25c347726b07717bc1fdd9c7c38df6cdfd8f37cd4be66c3ff0df9f524836

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5fc7c5f89ce1a5dcf813a98b6a1ce6cfb147adfa9eacc1aebc439095be366446
MD5 25c3f0cd460117a35e4f7489bbd4ef72
BLAKE2b-256 222b405ec32311920ab975bc044f153792458bf8a5cc65dbe59595daf18a9dad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 16fa295a065ff805d61fcf8ef2e90711ae209b997f1757459cd8ab3c76b7e5bc
MD5 8bb84de9f79fbd3d0cc69c9ee358e844
BLAKE2b-256 b151c5420423b0815d427b7dbf6a80b57408f13f5e75cfad0ac18fde0e3c4078

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c504e5b0154e77e001df7b8aeceb657333e668b4439b06c6d08dcff0fd9f4a81
MD5 21f02e75b7431bf5fa23c97ec7899754
BLAKE2b-256 2ea2b4b2048200cdb85e64f6840cd9d0080f0d6798c7ba0636338c4c82c1b9f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 eccc9675efb99eca9bee006204c707df6b85ec947085dc4a6a8eecdad6d740a4
MD5 b219202bb581e6e4fd579e0caa60b30e
BLAKE2b-256 69852954fe4fa299cca5630d961a7e9996c1d390dd53a4393e0b9ca618faffa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 3434940904ce6f19ba63f144d45c999870d379b3e93142a7cdcfaa2783ef1807
MD5 3cdac6e1c9904b2848f28c649a2f1b6b
BLAKE2b-256 ac33d8a081e98930a97e24277563e7e0803fac41f9aef22232a2fc3c18ce049c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 38516199137d67da191ffbfaca4563defd03eb1b4de7740ef9c9b9ad5bae0e68
MD5 daa8b217d79b9a110227ba6ef1f8ccc8
BLAKE2b-256 63e22bc7db3f40179eec09551171f44adff55adc4d6ad579f969ea3718965ac5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0ba7fbbfc29d40fdeffb05f93957ce88ae681a417698dbe8894592b68c779df1
MD5 197a3c48b1a83ce966be8ef64098ca2b
BLAKE2b-256 bbbeb9102777299ecc54fc9c9b0c090db23218b8341eaf12236ee54b585ef48f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0a21053e83d91657cb33f7620cf1442d42ded0620fc3774f252494316f9f1380
MD5 b21ec3a5026c4e71f7732bbf8c83af9a
BLAKE2b-256 ea75a5c72e499634a47f0525c6beae09695ac8c5c024b93696eb8ccf9af6c124

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 33ec601215ebf0014ab61da414ad40108e8b7c2fc5aa7fb0bc7a045feebb400f
MD5 3ea21c96cf7b22ea6ef29fad54c1236e
BLAKE2b-256 50784b808c41a6c7b7257d820ea3939279c0fdb1a42031261793abc50848c9fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.7.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e6d55f48917536d35250bfc352f2cb6cec41fef1a2f5943899ae8cb24ebc176d
MD5 658dd064e0960bb01593c8461f6d9eb5
BLAKE2b-256 d22eee056be9995b31afcfd668192874a534e065fc7e0be4a503989d483e7518

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