Skip to main content

Image IO for fable

Project description

FabIO
=====
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:

>>> 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 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
* 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.2.2.orig.tar.gz (390.8 kB view details)

Uploaded Source

fabio-0.2.2.zip (1.7 MB view details)

Uploaded Source

fabio-0.2.2.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.2.2-cp27-none-win_amd64.whl (607.0 kB view details)

Uploaded CPython 2.7Windows x86-64

fabio-0.2.2-cp27-none-win32.whl (533.3 kB view details)

Uploaded CPython 2.7Windows x86

fabio-0.2.2-cp27-none-macosx_10_10_intel.whl (752.5 kB view details)

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

fabio-0.2.2-cp27-none-macosx_10_6_intel.whl (868.5 kB view details)

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

File details

Details for the file fabio_0.2.2.orig.tar.gz.

File metadata

  • Download URL: fabio_0.2.2.orig.tar.gz
  • Upload date:
  • Size: 390.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio_0.2.2.orig.tar.gz
Algorithm Hash digest
SHA256 81134b9bee73eac574dedec974e7d222338c87d78cde2fd978e3914fc3570f4e
MD5 570dc8e813acb17ca1a66bd8eb91f522
BLAKE2b-256 976ff86782efd3cbc9be50164cca23b94cd95a401c77ba2a87db664c889ab2b8

See more details on using hashes here.

File details

Details for the file fabio-0.2.2.zip.

File metadata

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

File hashes

Hashes for fabio-0.2.2.zip
Algorithm Hash digest
SHA256 a78e41e5be9e710245982862c232699cf94fdf564d260ea9f4041e5b60799567
MD5 7691c6376ee7b078e1a8b5471f58febf
BLAKE2b-256 c5bccd90d09ae90a9ac17e999a8cec71e0c62f631d745dbc01f65d2ee0a0fa98

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fabio-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3258f28152b720a6d42cc6b591be6caff9326b6a2ffa80e7559137d770291b80
MD5 6e3c30d55b4cbe108e8770b19889ab45
BLAKE2b-256 cf74a476efe2ebb70d17549f298acde594326a029db4d6c87bef98c2c0428a1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabio-0.2.2-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 f9a714ed735e75fba3b97ca8a785bfe0dba0443b9b969d19dabb0c022a8ca297
MD5 9487d364dc36f94eaac4ca4fade4504e
BLAKE2b-256 7351e75afcd40d2cdc20c4bc6d27c3299702b6fa7bbd357b2f3534b3bc854598

See more details on using hashes here.

File details

Details for the file fabio-0.2.2-cp27-none-win32.whl.

File metadata

  • Download URL: fabio-0.2.2-cp27-none-win32.whl
  • Upload date:
  • Size: 533.3 kB
  • Tags: CPython 2.7, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabio-0.2.2-cp27-none-win32.whl
Algorithm Hash digest
SHA256 b1e4c314b1ba3e64d1c0b050e7497ddcbabc0507dec5534b306f4bdc6c9bd20c
MD5 d1c225403f3e406b6bedd0e8d4aa8e0f
BLAKE2b-256 7b7408582d719c525378d7f8161fa26c18743082de859fbec5c246a5070012cc

See more details on using hashes here.

File details

Details for the file fabio-0.2.2-cp27-none-macosx_10_10_intel.whl.

File metadata

File hashes

Hashes for fabio-0.2.2-cp27-none-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 4040735fe8c6ec56243d16ce3c6a29dfe67379cff475812d14cdb7ffff8026ce
MD5 0bf5e7d04883fb23749f571eff1700c3
BLAKE2b-256 e544790d9f4bf2b7a1d47552fc9bccd8be6fbfbbdbb4ea5c092663a3310e14e0

See more details on using hashes here.

File details

Details for the file fabio-0.2.2-cp27-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for fabio-0.2.2-cp27-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 6b35d8b13c182d972a17396fee8338c3320246bdd3e5c28075a1df8274e59649
MD5 7496d3062a336d8030409baa6ab18d36
BLAKE2b-256 3675421b2dc3a7a1f3f02a8613680ebda80b1fddbbce6864fe123845350c8d0a

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