Skip to main content

Image IO for fable

Project description

Main website: http://fable.sf.net

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: https://pypi.python.org/pypi/fabio But also as Debian/Ubuntu packages, and builds are available (windows, linux and MacOSX) from the Fable package at sourceforge: http://sourceforge.net/projects/fable/

Documentation is available at: http://pythonhosted.org//fabio/

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. http://dx.doi.org/10.1107/S0021889813000150

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:

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 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 -> dictionary * rows, columns, dim1, dim2 -> data.shape * header_keys -> header.keys() used to retain the order of the header when writing an image to disk * bytecode -> data.typecode() * 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 return 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 o brukerimage o bruker100image o kcdimage: Nonius KappaCCD diffractometer

  • Mar Research o marccd (fileformat derived from Tiff) o mar345 imaging plate with PCK compression

  • Dectris o cbfimage (implements a fast byte offset decompression scheme in python/cython) o pilatusimage (fileformat derived from Tiff)

  • ESRF o edfimage: The ESRF data Format o xsdimage: XML serialized image from EDNA o fit2dmaskimage: Fit2d Mask format o fit2dspreadsheetimage: Fit2d ascii tables (spread-sheet)

  • ADSC o adscimage

  • GE detector at APS o GEimage

  • PNM o pnmimage

  • Tiff o tifimage

  • D3M o d3mimage

  • Hamamatsu o HiPiCimage

  • Oxford Diffraction Sapphire 3 o OXDimage uncompressed o OXDimage with TY1 byte offset compression o OXDimage with TY5 byte offset compression (experimental)

  • Nonius o KappaCCD

  • 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 Distributions

fabio-0.3.0.zip (1.7 MB view details)

Uploaded Source

fabio-0.3.0.tar.gz (1.5 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.3.0-cp35-none-win_amd64.whl (573.1 kB view details)

Uploaded CPython 3.5Windows x86-64

fabio-0.3.0-cp35-cp35m-macosx_10_6_intel.whl (870.5 kB view details)

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

fabio-0.3.0-cp34-none-win_amd64.whl (574.9 kB view details)

Uploaded CPython 3.4Windows x86-64

fabio-0.3.0-cp27-none-win_amd64.whl (583.0 kB view details)

Uploaded CPython 2.7Windows x86-64

fabio-0.3.0-cp27-none-macosx_10_11_intel.whl (865.0 kB view details)

Uploaded CPython 2.7macOS 10.11+ Intel (x86-64, i386)

File details

Details for the file fabio-0.3.0.zip.

File metadata

  • Download URL: fabio-0.3.0.zip
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio-0.3.0.zip
Algorithm Hash digest
SHA256 7ee2fbfd7ed72d7f0c19f86c2d7588db0e196b5458cc3f6b4cab8cb05c2dc03e
MD5 330656216fe078c293f06082ed40fcf5
BLAKE2b-256 ebaaefc1204e5e7ed66416aad65861a2923dea0466b953ee851533e8ffb082db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fabio-0.3.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio-0.3.0.tar.gz
Algorithm Hash digest
SHA256 477fd1fb2325da12f09fe9d59ebab2d010e94908f6a48b4ff3dc755b21e5aeea
MD5 8c24b5b6d58929809b2bc93ecb13f7fd
BLAKE2b-256 7f8ffea5d205c189cd326e851aec29d8e865db12777c745ebaccdbf494895d21

See more details on using hashes here.

File details

Details for the file fabio-0.3.0-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.3.0-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 7bfb86a4bf90a7d0353eaa8970c008b68e942511a448e2193b888e6fd677a4eb
MD5 facc25b88f59f3a0c8e86a44603f8b25
BLAKE2b-256 bbb33b2490630322666f2306d339959ffb9220b4e12947eb0598a999a067e326

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.3.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 306c49627eade18a35b8ab0a2e90d2ab6713d4f41b7145be09c5766e7bb7fbc3
MD5 9710168d98b56d5eefb19c632a93a141
BLAKE2b-256 21dd36e8bd12a9e2313e5a543d1c4512700b0f570415a911b3ba1bc495d86669

See more details on using hashes here.

File details

Details for the file fabio-0.3.0-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.3.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 ae89b54b93ceead57ff26d12c500a0a5f1d321c1592cd83e58e6c149ff13321a
MD5 3ea59bcc0a0762c766bcbb8e6cfdd36d
BLAKE2b-256 95d582a8f0b22943184cfafc5fd3c142ef75a7f6b93d0336410ed9a6ada459a9

See more details on using hashes here.

File details

Details for the file fabio-0.3.0-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for fabio-0.3.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 6ec468dd55c46ab60276925acbfe82161588b1cf9408df37122fa0f973d55429
MD5 f2e1cd92fbca6cf4521b48025d0578d7
BLAKE2b-256 0409c7fcb2daf950e4228f872b1689125ace886af08beb85447df8d91f10387c

See more details on using hashes here.

File details

Details for the file fabio-0.3.0-cp27-none-macosx_10_11_intel.whl.

File metadata

File hashes

Hashes for fabio-0.3.0-cp27-none-macosx_10_11_intel.whl
Algorithm Hash digest
SHA256 c710d3bf933a61c3adfa49c30b50be1699c6f529571599b4cfa297936075d6e9
MD5 c5064aa851a658a9eeb865ee9bd4619e
BLAKE2b-256 16c09f3780337964b6b74602be2f93e83c932c1ecde2788f78970d2e983edd7f

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