Image IO for fable
Project description
Main websites:
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for fabio-0.10.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c41ea5e28186e54e87036efdf2c79e3ebed9d84b5cf8d6c7ae14fb5799ba4df |
|
MD5 | 452ac7687cf1b3f6752b278670f0847c |
|
BLAKE2b-256 | d3ee7d5fc0e94a03e435c74e31999e37b7ebde8b546cb24661a83d12615f7f5a |
Hashes for fabio-0.10.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5cde5a2369fe7bc162673c7b5eba6c57e16d3c6c0547b7edbfab8b3faceb1ca |
|
MD5 | 78e6dc517bc71262fde3ede83a93c18e |
|
BLAKE2b-256 | 89907b5feae9c79393799adda0f7497e1f779d35f7074e034c9b11d49c492215 |
Hashes for fabio-0.10.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a28403b01b74470fccb134997379435d57da23dad58647f46583f39776b934d |
|
MD5 | ca79dde679012296154b68da5b900110 |
|
BLAKE2b-256 | 263d5e4c8f476a3f5f084c7b5878ea63d2c00d7583d2318b97ba3d97edfe7653 |
Hashes for fabio-0.10.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d34a529a3110ddbc4cc55e94079217aabf18a299a8148b06a62e8fcef049d425 |
|
MD5 | b609f2ffc7d768354e9bf261b2a112df |
|
BLAKE2b-256 | ef3ca6dc063d12267d789b43d40375a20a4ec25a0e9ce631a6de157c2653f671 |
Hashes for fabio-0.10.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc4cc86b39b40dd35b3c0219dfc19f09ed563033ce600452d2a52f9f89a4919 |
|
MD5 | 1ce398d0cf35d96da31c7f0cf632df50 |
|
BLAKE2b-256 | aa7a003ccd1cd00467b961ee2777f1e2469839d9d451ff8bb51a152707b1aa6d |
Hashes for fabio-0.10.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18ef3078e8040459a97a2cff45b4ccb98438462053c1bd3b4356f8acd40eacfe |
|
MD5 | 32702522317e01d330cf7af6b88d85b2 |
|
BLAKE2b-256 | 45b98b3341531bfaafe69e442b342e83f25ec1765d15faf0fc4643b756a9cd9e |
Hashes for fabio-0.10.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f01e593ab25ad3c6435c363739df4b4f43242a326d94ad2635e4f31338e1a5b |
|
MD5 | 075132e774cf71d85b02cf68702fc2b1 |
|
BLAKE2b-256 | 664612928408a4f930bf21897eceb918cb07307cce50468a40818cdc808da320 |
Hashes for fabio-0.10.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3767189152de53ab7c6d1ba8bc86cb01e2c0ea426cdae7ea76e17d5fd965237c |
|
MD5 | ec5eca66165a18f75f7f93d91ae35b09 |
|
BLAKE2b-256 | d818e51de97419f7443445b5012c63ebfec2b1bf8895dab2cc2d94ea7109db5d |
Hashes for fabio-0.10.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b96a55de77cde7dc27baca5ece330f0075b380e41d3860a689f29f875a2186ad |
|
MD5 | a0fa9e22bef25c233ddb053e061c8eac |
|
BLAKE2b-256 | f70f0a16e68d54c093cb44b81413c53e64eb68770d77545dfa2b52bcd1e47518 |
Hashes for fabio-0.10.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eb00c62cebeddcc42cb97daf96428d2ae48760064b8065d363b2ff0f629da8b |
|
MD5 | 02b8f4f51fc3093fa929c11dae7ee9d1 |
|
BLAKE2b-256 | 8e640778e436abc5908576606c783e25b58b99476026560676b910be4275b7a5 |
Hashes for fabio-0.10.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7520d8563e7d7de533338e114fd14286168358a01b17834bed813a9c7e779bbc |
|
MD5 | f8d0853cf863b8ba78ef96cf7d06b49d |
|
BLAKE2b-256 | e8b2de921db6a17c4b318e475e9ae0fa1b2be41ed10fb18636d05a5db87e5993 |
Hashes for fabio-0.10.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e7f03b3ee47020a24d742aafdb5b7bfd06ec6be641cb5a365b108afe5d90c3f |
|
MD5 | bf4638ccae02e9f1986c3b59f051309d |
|
BLAKE2b-256 | 4acf11085b6a71c8dba5824eb9c5b660f89ad5dbf97953c35031bcf20e4dc315 |
Hashes for fabio-0.10.2-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237169aff4b4da7cf6a098bf13375463b93154c9e8c1ba33e89b85ec333fcb19 |
|
MD5 | a955f7411ddc3800298c1d3cbe3c4759 |
|
BLAKE2b-256 | e243cc044bbe6ae53bca0b713c0e019cafe3acbbf641c3f908057c79d9037e93 |
Hashes for fabio-0.10.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3e16683cd782f27a7a48f94820a39353e3970448b5875ffc4a89922c45b7e2 |
|
MD5 | 1ffdf17e0bdcf81b5bdf346ec61f1b53 |
|
BLAKE2b-256 | c9afd191aad5c73ba787de16e70c0b761ee04eeec33b38f9fc0a6f484399b766 |
Hashes for fabio-0.10.2-cp35-cp35m-macosx_10_9_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80f730984aefa7bc38453f614dda01dd29b27efb7391eaf64b724d452334308b |
|
MD5 | e4474c4a00988930f4018117f8db8940 |
|
BLAKE2b-256 | 57ae514411a5d14b7a6cde3b533b967215614443492b08d81689212c2e665f14 |
Hashes for fabio-0.10.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83cbc292db4f85203ee57e98db755d60fa1b349065ae51fe3f0b9c77006b7482 |
|
MD5 | 1bf1cbe9d780559f6c144c8e24845787 |
|
BLAKE2b-256 | 648b1e5244c3dd3ca953ad11a4adaaf4500c71951f8de4a05a64faba0106b270 |
Hashes for fabio-0.10.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbebf109c5e85091ce4b683fe0eeb68839d24c41ee82dca6111f1247c9671fa6 |
|
MD5 | fb5a1f85c2fe37f2596072899a2473a9 |
|
BLAKE2b-256 | 97160a4b046d04efccdbeee993d962374ac771da85dcec20a3bb59c4de119c20 |