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 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.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.10.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.10.0-cp38-cp38-win_amd64.whl (706.1 kB view details)

Uploaded CPython 3.8Windows x86-64

fabio-0.10.0-cp38-cp38-manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8

fabio-0.10.0-cp38-cp38-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8

fabio-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

fabio-0.10.0-cp37-cp37m-win_amd64.whl (697.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

fabio-0.10.0-cp37-cp37m-manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.7m

fabio-0.10.0-cp37-cp37m-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.7m

fabio-0.10.0-cp37-cp37m-macosx_10_6_intel.whl (1.6 MB view details)

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

fabio-0.10.0-cp36-cp36m-win_amd64.whl (697.3 kB view details)

Uploaded CPython 3.6mWindows x86-64

fabio-0.10.0-cp36-cp36m-manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.6m

fabio-0.10.0-cp36-cp36m-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.6m

fabio-0.10.0-cp36-cp36m-macosx_10_6_intel.whl (1.5 MB view details)

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

fabio-0.10.0-cp35-cp35m-manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m

fabio-0.10.0-cp35-cp35m-macosx_10_6_intel.whl (1.5 MB view details)

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

File details

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

File metadata

  • Download URL: fabio-0.10.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0.tar.gz
Algorithm Hash digest
SHA256 d3a21a20e6763f934e5eb51fe91bb96f171c109442898659daab3a7c69fff6b0
MD5 6e2eb11d6116bea8e99b992ba8db6883
BLAKE2b-256 de8d89c9a81354e94fff7fadd9d1e0ec7b35d6a5eb0203fded844cb0d92c451e

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 706.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 071d17cfa08c6961120f01a0e24c1e63b180428f7a25b3ae49fbb610622ad5c2
MD5 a63f1cd117143d9f1ee89540c135637c
BLAKE2b-256 2b17259118acaf494a32cbc441d4f227877d938e483da51f2db47b701efb6b91

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4aa999c9b3de405ba9c175555bedb2e5c269eeb1d3f7940ba3d91158710f2b93
MD5 0a2cf41f5f00b28482c882a459caf3fe
BLAKE2b-256 221e5470c20acdd4af4adc49431d610b70b30d20e7df488ad3e3496e381fe7b7

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 087a4cbaf71a241bb149b62467d7878a1c91a2adbf10a84574dd18fb25db2c3e
MD5 d71e307233c2957559fb5a12cb4556e3
BLAKE2b-256 b4606deef641171d466cf981c42d1fe36fece8785eddaed5411668299859a109

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e28a7827c9d6fb91acf8ecb31c996ef6334e5afbc6d10e814b5b7f3c4a33f9b8
MD5 8ac567867a7a97b66c6bb48aa093960b
BLAKE2b-256 13f526224df0dd550a3cf4e69aa4a85430429113d69571140f7a5770ebf587cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 697.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d0130b7a2f78af4c3d890e515955ccfa32d7728839a390f44ff9e360b158719e
MD5 34bcf758b8e6efc0b9abbd05bbc9796d
BLAKE2b-256 833064832fc54e07bae71c733b73be68487d00a1cbe40e2210068c4862dce9d7

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93bfaa3ae25b9e9e6e2962ba5d93ccd6ed28120513d092cdf221c3c33e0dbb4d
MD5 f3de999efc0e3ded226dcb95f9f399c6
BLAKE2b-256 7f8914208f45180ed12828e39799aec63eb98d61264837a76ac8475a78c8eacd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6001d1c83c9f7457dc521b4d3fd2364ca07d5948896950662ef8bf65f2be1e05
MD5 1f19a361c2e966520d67837fdf8d0b47
BLAKE2b-256 74e050d3ba6f80329cba5ca7cf17d9067ee458f4f0c4c1e936fb97e5cf4c3d82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 aaead321e14d9440fc5154ef03e34034a697e7028a59bb1927bb36da4bed9e70
MD5 f9b208e325a41fb60d8b12f4b5dfd7ff
BLAKE2b-256 edf2b8e92e55a8287335ae2ecc8a8b6c18dbae5ce23abcd7813ef2783c3c5b6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 697.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cd6b7429ecf4405a79f97d37549340c6d1b9db2faa65446934122b1bec71b357
MD5 7e5c0a9a73557dbab3176fc797374cd9
BLAKE2b-256 b57db3b4da27a7b218a0c1e3c165a5df17f15e53c6b031b9fc431cbe77912304

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 882d8531a21957e414766a66130a6645d461aa5b5e8befeac7c5556d7e43c432
MD5 72fdb48b80e15917bd2096c7d9b7940e
BLAKE2b-256 16718416b74f4441a8186fcee4d6b42a952b93a377d0405568a7df8c55019aff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0a53e5ab1150e91dde14017da8d7cd8bca40aa6d59a936ba0907452316c3e51a
MD5 3ca1f3f56b6c3c7814de57147604822a
BLAKE2b-256 3a75305711bfc999449cb23f9d8ce0a273dbdf57306e9622331c0e2e2d5d3b0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 5201976826e6dd1e3a380503c03725155f28f60687e41da05557ac6ccd13536a
MD5 2fb6db5f14080910969230924b92bb02
BLAKE2b-256 1348edf84b256fa6a5d8ec673771f6e3c462af64e69ff56302575311ae3bf324

See more details on using hashes here.

File details

Details for the file fabio-0.10.0-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: fabio-0.10.0-cp35-cp35m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 416cd654a07cd3dae1dfd407cc68819d6dea069b1f9c565a652448877d7d1a46
MD5 b3c8098d754e14f77e0ddf4b7e86a28a
BLAKE2b-256 1889cfebab4589c06ed53806f964f434463091b987d8c5ff04be3bb184804a8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.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/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 01292c8fcaffa628618e1b703cf4e6f9155498e25e96d10bf9cf4c967ed8bb84
MD5 49b46b06df31ea42f9aac35e6dc7c376
BLAKE2b-256 e63e6c1869a133d8067e216c21db27c5b789d69cd98c296b7cbd0a8609a98bc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.10.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.5m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fabio-0.10.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 27c9cd06896d927fa13243cc9185143174d892ee04c0566251404eba223db444
MD5 d247f6ed2fe082d3472712078a804e06
BLAKE2b-256 60e329625235288d1a0ce626ae2cbd8b0ef36f211aea25d8dd318fab5cf79050

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