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.8.0.tar.gz (618.3 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.8.0-cp37-cp37m-win_amd64.whl (610.7 kB view details)

Uploaded CPython 3.7mWindows x86-64

fabio-0.8.0-cp37-cp37m-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m

fabio-0.8.0-cp37-cp37m-macosx_10_6_intel.whl (951.9 kB view details)

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

fabio-0.8.0-cp36-cp36m-win_amd64.whl (610.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

fabio-0.8.0-cp36-cp36m-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6m

fabio-0.8.0-cp36-cp36m-macosx_10_6_intel.whl (951.3 kB view details)

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

fabio-0.8.0-cp35-cp35m-win_amd64.whl (604.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

fabio-0.8.0-cp35-cp35m-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5m

fabio-0.8.0-cp35-cp35m-macosx_10_6_intel.whl (944.8 kB view details)

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

fabio-0.8.0-cp34-cp34m-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.4m

fabio-0.8.0-cp27-cp27mu-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7mu

fabio-0.8.0-cp27-cp27m-win_amd64.whl (624.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

fabio-0.8.0-cp27-cp27m-manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7m

fabio-0.8.0-cp27-cp27m-macosx_10_6_intel.whl (984.0 kB view details)

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

File details

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

File metadata

  • Download URL: fabio-0.8.0.tar.gz
  • Upload date:
  • Size: 618.3 kB
  • Tags: Source
  • 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.8.0.tar.gz
Algorithm Hash digest
SHA256 98dfa804e6ea3220a1a642ea7d3218f5a1fbd612dd53492ce2ead51cd52ff71e
MD5 6ec3c6b5b27fc638673ef5b10269d6a8
BLAKE2b-256 c6f7128b1e5517d002770c73f5e0fb58fe6038a58ce5cce762910435bbd281c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 610.7 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.8.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1a9e379479630d00f609100e1ea2b46e7543a60e118286f5ce8163b3a7f7311e
MD5 1589ff1b062f792a655e426da5715ff8
BLAKE2b-256 f2e448066a4087ad8d958b1f967b7576c9397df31764fff013e3cad074b8fe75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m
  • 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.8.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3580b59bf818cf0e9d14be2950c825b0c3a0ff4d0092e58bf4439b1944ad746f
MD5 f9fc3fca77b98a28b7229b6f147aaba7
BLAKE2b-256 c3121188465168ea40e68c63f4901ef48b551003ba0ff328135fc65358e127c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 951.9 kB
  • Tags: CPython 3.7m, macOS 10.6+ Intel (x86-64, i386)
  • 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.8.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 6325810f28f77d7f2100600382f5802de881062de54f2f707255baae8953fffe
MD5 b83422a26d1a0f5b2125aadd3b2f6c23
BLAKE2b-256 466a31e11773f2e75ac30b8cd2a5040b07b9d8e053bcfc4427a25c0d12861748

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 610.6 kB
  • Tags: CPython 3.6m, 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.8.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b090172b8baa2dfa49ae9d41f2ef643292bdba7ab69700506999be4959af04a9
MD5 1a4656d80e6a28880342b2087f736adf
BLAKE2b-256 69bc8de4d196c0efe3e3b83cfe83fd2770ea4777a0480bbb7e7b7b734332e653

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.6m
  • 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.8.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b308950a23a2f2085b4bd26733ce809747c97dfd4fb01738c26729607ccb16dc
MD5 e48c8de10f021b4edb109788e50367e1
BLAKE2b-256 f65b45a159f412264b76e036fbc51a9c43b7364b7901450217b8fda2a3837ac3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 951.3 kB
  • Tags: CPython 3.6m, macOS 10.6+ Intel (x86-64, i386)
  • 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.8.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 6ae1d870d0b2f0e0a5cfc5e4178aff46c67a40a345eb7b44a0a7c566b5d78e61
MD5 86f3c0b4b79ed14edf6c5bd1549e15ed
BLAKE2b-256 9853cb049222cf696e83bc2edaabee93cc57ee4c99f9d252e4e7859170aa2ce0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 604.0 kB
  • Tags: CPython 3.5m, 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.8.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a6a2478d47c6e7e223cf63d0c117761954f455ebebec6eb9c2fa9e784b8726fc
MD5 829e9accde1eba2f09b2ebaeedc6b58f
BLAKE2b-256 261f41eff0edc3740592f7948b02a2d9e09ade6ff4c5a3e1033eeb8a3031457f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.5m
  • 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.8.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7ba4582985ed77fe8797fd2ad1db347ed870228d0ba6bccbfbe4196eb094f55f
MD5 f304398f415bb7c766ca188241663aa2
BLAKE2b-256 a3863efec836f4585e5ef6f807b62c6fd660b3e9b9034eefdb210bba6b3a3105

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 944.8 kB
  • Tags: CPython 3.5m, macOS 10.6+ Intel (x86-64, i386)
  • 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.8.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 84ea209d1f6a46530f0016609316f6a295daf5f67123a2425c7f7661fd1b08c3
MD5 ad62fa69d811da080c372da50e36e99b
BLAKE2b-256 ec79a2779215f9cfddbf7a9abec7030170e476141bb50fc74d396a30ac5f4c41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.4m
  • 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.8.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a046862bf19429ba2c23629134e2bd0086da3d763279e3ef3df9cf4e144b72e8
MD5 e0b2922ace66292fc673b22ea7acdf14
BLAKE2b-256 d5d2c7f578c1ab539c742916aa42f2aa010c93520a5e05271e2a18c8b31a32af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 2.7mu
  • 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.8.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3880589252283664e26be522e5654f690114ea0a90a1304ce18921bdb8c4198d
MD5 f0d55642449f61c91d538ef5f0497e60
BLAKE2b-256 ca09e9628194cbda7da4aff23462ee8b6262d50168b175f47c29a208f275820d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 624.5 kB
  • Tags: CPython 2.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.8.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 f2f1ba652797c4e2050b9a99becab4ceff31f1b8569eb637f54be490e6acfc69
MD5 1aa09e1acf29732c22ca0254cda64cdd
BLAKE2b-256 11387eb0e581224114691ea287ea1776a4557a623aeb28c6544fedb631d86183

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 2.7m
  • 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.8.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dbb6d474411858eb6b6aab1b6e7ce5bcdf67b4129f4abaeb1e8a78cc272075a7
MD5 3e113add1dcd337da4db04ea007b26cf
BLAKE2b-256 926a443f597b1fbc876f76c077c73645d40d85d0bffe76111e25b11dfd7339b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.8.0-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 984.0 kB
  • Tags: CPython 2.7m, macOS 10.6+ Intel (x86-64, i386)
  • 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.8.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 6318375dfde96561af6f7be51bc693af080745f2e875837fa69a2c95070409fb
MD5 16c0d139f0ad3ad938b7a129e7230ab7
BLAKE2b-256 bbfbe18c112d855c94c4ee9891a061795d9a5f62328b5368b80c3cc2366a23ef

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