| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: fabio |
| 3 |
Version: 2026.6.0 |
| 4 |
Summary: FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python |
| 5 |
Author: Erik Knudsen, Regis Perdreau, Gael Goret, Brian Pauw |
| 6 |
Author-Email: Henning Sorensen <[email protected]>, "Jonathan P. Wright" <[email protected]>, =?utf-8?q?J=C3=A9r=C3=B4me_Kieffer?= <[email protected]>, Valentin Valls <[email protected]> |
| 7 |
License: Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
| 8 |
Upstream-Name: fabio |
| 9 |
Upstream-Contact: Jérôme Kieffer <[email protected]> |
| 10 |
Source: https://github.com/silx-kit/fabio/releases/tag/v0.10.0 |
| 11 |
Files-Excluded: third_party |
| 12 |
|
| 13 |
Files: * |
| 14 |
Copyright: 2007-2009 Henning O. Sorensen & Erik Knudsen |
| 15 |
Center for Fundamental Research: Metal Structures in Four Dimensions |
| 16 |
Risoe National Laboratory |
| 17 |
Frederiksborgvej 399 |
| 18 |
DK-4000 Roskilde |
| 19 |
email:[email protected] |
| 20 |
2009-2026 Jonathan P. Wright, Jerome Kieffer and Gael Goret |
| 21 |
European Synchrotron Radiation Facility |
| 22 |
6 rue Jules Horowitz |
| 23 |
38000 Grenoble, France |
| 24 |
License: MIT |
| 25 |
|
| 26 |
Files: debian/* |
| 27 |
Copyright: 2011 Jerome Kieffer <[email protected]> |
| 28 |
2013-2014 Picca Frederic-Emmanuel <[email protected]> |
| 29 |
License: GPL-2.0+ |
| 30 |
|
| 31 |
Files: fabio/raxisimage.py |
| 32 |
Copyright: 2013-2014 Brian R. Pauw <[email protected]> |
| 33 |
License: MIT |
| 34 |
|
| 35 |
Files: fabio/mpaimage.py |
| 36 |
Copyright: 2017 Jesse Hopkins (CHESS, USA) |
| 37 |
License: MIT |
| 38 |
|
| 39 |
Files: fabio/ext/src/ccp4_pack.c |
| 40 |
fabio/ext/inlcude/ccp4_pack.h |
| 41 |
Copyright: 1995 Jan Pieter Abrahams |
| 42 |
MRC Cambridge (UK) |
| 43 |
2007-2009 Henning O. Sorensen & Erik Knudsen |
| 44 |
Risoe National Laboratory (DK) |
| 45 |
2012-2016 European Synchrotron Radiation Facility (FR) |
| 46 |
License: LGPL-3.0+ |
| 47 |
|
| 48 |
Files: fabio/speimage |
| 49 |
fabio/test/testspeimage |
| 50 |
Copyright: 2016 University Köln, Germany |
| 51 |
License: MIT |
| 52 |
|
| 53 |
Files: src/stdint.h |
| 54 |
Copyright: 2006-2008 Alexander Chemeris |
| 55 |
License: BSD-3 |
| 56 |
|
| 57 |
License: GPL-2.0+ |
| 58 |
This package is free software; you can redistribute it and/or modify |
| 59 |
it under the terms of the GNU General Public License as published by |
| 60 |
the Free Software Foundation; either version 2 of the License, or |
| 61 |
(at your option) any later version. |
| 62 |
. |
| 63 |
This package is distributed in the hope that it will be useful, |
| 64 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 65 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 66 |
GNU General Public License for more details. |
| 67 |
. |
| 68 |
You should have received a copy of the GNU General Public License |
| 69 |
along with this program. If not, see <http://www.gnu.org/licenses/> |
| 70 |
. |
| 71 |
On Debian systems, the complete text of the GNU General |
| 72 |
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". |
| 73 |
|
| 74 |
License: GPL-3.0+ |
| 75 |
This package is free software; you can redistribute it and/or modify |
| 76 |
it under the terms of the GNU General Public License as published by |
| 77 |
the Free Software Foundation; either version 3 of the License, or |
| 78 |
(at your option) any later version. |
| 79 |
. |
| 80 |
This package is distributed in the hope that it will be useful, |
| 81 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 82 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 83 |
GNU General Public License for more details. |
| 84 |
. |
| 85 |
You should have received a copy of the GNU General Public License |
| 86 |
along with this program. If not, see <http://www.gnu.org/licenses/> |
| 87 |
. |
| 88 |
On Debian systems, the complete text of the GNU General |
| 89 |
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". |
| 90 |
|
| 91 |
License: LGPL-3.0+ |
| 92 |
This package is free software; you can redistribute it and/or modify |
| 93 |
it under the terms of the GNU Lesser General Public License as published by |
| 94 |
the Free Software Foundation; either version 3 of the License, or |
| 95 |
(at your option) any later version. |
| 96 |
. |
| 97 |
This package is distributed in the hope that it will be useful, |
| 98 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 99 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 100 |
GNU General Public License for more details. |
| 101 |
. |
| 102 |
You should have received a copy of the GNU Lesser General Public License |
| 103 |
along with this program. If not, see <http://www.gnu.org/licenses/> |
| 104 |
. |
| 105 |
On Debian systems, the complete text of the GNU Lesser General |
| 106 |
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3". |
| 107 |
|
| 108 |
License: BSD-3 |
| 109 |
Redistribution and use in source and binary forms, with or without |
| 110 |
modification, are permitted provided that the following conditions are met: |
| 111 |
. |
| 112 |
1. Redistributions of source code must retain the above copyright notice, |
| 113 |
this list of conditions and the following disclaimer. |
| 114 |
. |
| 115 |
2. Redistributions in binary form must reproduce the above copyright |
| 116 |
notice, this list of conditions and the following disclaimer in the |
| 117 |
documentation and/or other materials provided with the distribution. |
| 118 |
. |
| 119 |
3. The name of the author may be used to endorse or promote products |
| 120 |
derived from this software without specific prior written permission. |
| 121 |
. |
| 122 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 123 |
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 124 |
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
| 125 |
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 126 |
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 127 |
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 128 |
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 129 |
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 130 |
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 131 |
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 132 |
|
| 133 |
License: MIT |
| 134 |
Permission is hereby granted, free of charge, to any person |
| 135 |
obtaining a copy of this software and associated documentation files |
| 136 |
(the "Software"), to deal in the Software without restriction, |
| 137 |
including without limitation the rights to use, copy, modify, merge, |
| 138 |
publish, distribute, sublicense, and/or sell copies of the Software, |
| 139 |
and to permit persons to whom the Software is furnished to do so, |
| 140 |
subject to the following conditions: |
| 141 |
|
| 142 |
The above copyright notice and this permission notice shall be |
| 143 |
included in all copies or substantial portions of the Software. |
| 144 |
|
| 145 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 146 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 147 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 148 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 149 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 150 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 151 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 152 |
OTHER DEALINGS IN THE SOFTWARE. |
| 153 |
|
| 154 |
Classifier: Development Status :: 5 - Production/Stable |
| 155 |
Classifier: Environment :: Console |
| 156 |
Classifier: Intended Audience :: End Users/Desktop |
| 157 |
Classifier: Intended Audience :: Developers |
| 158 |
Classifier: Intended Audience :: Science/Research |
| 159 |
Classifier: License :: OSI Approved :: MIT License |
| 160 |
Classifier: Operating System :: MacOS :: MacOS X |
| 161 |
Classifier: Operating System :: Microsoft :: Windows |
| 162 |
Classifier: Operating System :: POSIX |
| 163 |
Classifier: Programming Language :: C |
| 164 |
Classifier: Programming Language :: Cython |
| 165 |
Classifier: Programming Language :: Python |
| 166 |
Classifier: Programming Language :: Python :: 3 |
| 167 |
Classifier: Programming Language :: Python :: Implementation :: CPython |
| 168 |
Classifier: Topic :: Scientific/Engineering :: Chemistry |
| 169 |
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics |
| 170 |
Classifier: Topic :: Scientific/Engineering :: Physics |
| 171 |
Classifier: Topic :: Scientific/Engineering :: Visualization |
| 172 |
Classifier: Topic :: Software Development :: Libraries :: Python Modules |
| 173 |
Project-URL: homepage, http://www.silx.org |
| 174 |
Project-URL: documentation, http://www.silx.org/doc/fabio/latest/ |
| 175 |
Project-URL: source, https://github.com/silx-kit/fabio |
| 176 |
Project-URL: download, https://github.com/silx-kit/fabio/releases |
| 177 |
Project-URL: tracker, https://github.com/silx-kit/fabio/issues |
| 178 |
Requires-Python: >=3.11 |
| 179 |
Requires-Dist: numpy |
| 180 |
Requires-Dist: h5py |
| 181 |
Requires-Dist: hdf5plugin |
| 182 |
Requires-Dist: lxml |
| 183 |
Requires-Dist: pillow |
| 184 |
Requires-Dist: filelock |
| 185 |
Provides-Extra: gui |
| 186 |
Requires-Dist: qtpy; extra == "gui" |
| 187 |
Requires-Dist: pyside6; extra == "gui" |
| 188 |
Requires-Dist: matplotlib; extra == "gui" |
| 189 |
Requires-Dist: packaging; extra == "gui" |
| 190 |
Provides-Extra: all |
| 191 |
Requires-Dist: qtpy; extra == "all" |
| 192 |
Requires-Dist: pyside6; extra == "all" |
| 193 |
Requires-Dist: matplotlib; extra == "all" |
| 194 |
Requires-Dist: packaging; extra == "all" |
| 195 |
Description-Content-Type: text/x-rst |
| 196 |
|
| 197 |
FabIO: Fable Input/Output library |
| 198 |
================================= |
| 199 |
|
| 200 |
Main websites: |
| 201 |
|
| 202 |
* https://github.com/silx-kit/fabio |
| 203 |
* http://fable.sf.net (historical) |
| 204 |
|
| 205 |
|
| 206 |
|Build Status| |Appveyor Status| |
| 207 |
|
| 208 |
---- |
| 209 |
|
| 210 |
FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python. |
| 211 |
FabIO supports detector images from a dozen companies (including Mar, Dectris, ADSC, Hamamatsu, Oxford, ...), |
| 212 |
for a total of 30 different file formats (like CBF, EDF, TIFF, ...) and offers a unified interface to their |
| 213 |
headers (as a Python dictionary) and datasets (as a numpy ndarray of integers or floats) |
| 214 |
|
| 215 |
|
| 216 |
.. contents:: |
| 217 |
:depth: 1 |
| 218 |
|
| 219 |
Installation |
| 220 |
------------ |
| 221 |
|
| 222 |
FabIO is available from `PyPI <https://pypi.python.org/pypi/fabio>`_: |
| 223 |
|
| 224 |
``pip install fabio`` |
| 225 |
|
| 226 |
|
| 227 |
`Debian/Ubuntu packages <http://www.silx.org/pub/debian/binary/>`_, and |
| 228 |
`wheels <http://www.silx.org/pub/wheelhouse/>`_ are available |
| 229 |
for Windows, Linux and MacOSX from the silx repository. |
| 230 |
|
| 231 |
See the `installation instructions <http://www.silx.org/doc/fabio/latest/install.html>`_ for more information. |
| 232 |
|
| 233 |
Usage |
| 234 |
----- |
| 235 |
|
| 236 |
Open an image |
| 237 |
............. |
| 238 |
|
| 239 |
>>> import fabio |
| 240 |
>>> obj = fabio.open("mydata0000.edf") |
| 241 |
>>> obj.data.shape |
| 242 |
(2048, 2048) |
| 243 |
>>> obj.header["Omega"] |
| 244 |
23.5 |
| 245 |
>>> obj.data |
| 246 |
array([...]) |
| 247 |
|
| 248 |
Save an image (ex: EDF) |
| 249 |
....................... |
| 250 |
|
| 251 |
>>> import fabio |
| 252 |
>>> obj = fabio.edfimage.EdfImage(data=[...]) |
| 253 |
>>> obj.write("mydata0000.edf") |
| 254 |
|
| 255 |
|
| 256 |
Documentation |
| 257 |
------------- |
| 258 |
|
| 259 |
See the `latest release documentation <http://www.silx.org/doc/fabio/latest/>`_ for further details. |
| 260 |
|
| 261 |
Documentation of previous versions is available on `silx <http://www.silx.org/doc/fabio/>`_. |
| 262 |
|
| 263 |
Changelog |
| 264 |
--------- |
| 265 |
|
| 266 |
See http://www.silx.org/doc/fabio/latest/Changelog.html |
| 267 |
|
| 268 |
|
| 269 |
Citation |
| 270 |
-------- |
| 271 |
|
| 272 |
The general philosophy of the library is described in: |
| 273 |
`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>`_ |
| 274 |
|
| 275 |
Transparent handling of compressed files |
| 276 |
---------------------------------------- |
| 277 |
|
| 278 |
For FabIO to handle gzip and bzip2 compressed files transparently, ``bzip`` and ``gzip`` modules must be present when installing/building Python (e.g. ``libbz2-dev`` package for Ubuntu). |
| 279 |
|
| 280 |
Benchmarking details have been collected at http://www.silx.org/doc/fabio/latest/performances.html. |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
Supported file formats |
| 285 |
---------------------- |
| 286 |
|
| 287 |
* ADSC: |
| 288 |
|
| 289 |
+ AdscImage |
| 290 |
|
| 291 |
* Bruker: |
| 292 |
|
| 293 |
+ BrukerImage |
| 294 |
+ Bruker100Image |
| 295 |
+ KcdImage: Nonius KappaCCD diffractometer |
| 296 |
|
| 297 |
* D3M |
| 298 |
|
| 299 |
+ D3mImage |
| 300 |
|
| 301 |
* Dectris: |
| 302 |
|
| 303 |
+ CbfImage (implements a fast byte offset de/compression scheme in Python/Cython) |
| 304 |
+ PilatusImage (file format derived from Tiff) |
| 305 |
+ EigerImage (derived from HDF5/NeXus format, depends on `h5py`) |
| 306 |
|
| 307 |
* ESRF: |
| 308 |
|
| 309 |
+ EdfImage: The ESRF data Format |
| 310 |
+ XsdImage: XML serialized image from EDNA |
| 311 |
+ Fit2dImage: Fit2d binary format |
| 312 |
+ Fit2dmaskImage: Fit2d Mask format |
| 313 |
+ Fit2dSpreadsheetImage: Fit2d ascii tables (spread-sheet) |
| 314 |
+ LimaImage: image stacks written by the LImA acquisition system |
| 315 |
+ SparseImage: single crystal diffractions images written by pyFAI |
| 316 |
|
| 317 |
* General Electric |
| 318 |
|
| 319 |
+ GEimage (including support for variant used at APS) |
| 320 |
|
| 321 |
* Hamamatsu |
| 322 |
|
| 323 |
+ HiPiCImage |
| 324 |
|
| 325 |
* HDF5: generic format for stack of images based on h5py |
| 326 |
|
| 327 |
+ Hdf5Image |
| 328 |
+ EigerImage |
| 329 |
+ LimaImage |
| 330 |
+ SparseImage |
| 331 |
|
| 332 |
* JPEG image format: |
| 333 |
|
| 334 |
+ JPEG using PIL |
| 335 |
+ JPEG 2000 using Glymur |
| 336 |
|
| 337 |
* Mar Research: |
| 338 |
|
| 339 |
+ MarccdImage (file format derived from Tiff) |
| 340 |
+ Mar345Image imaging plate with PCK compression |
| 341 |
|
| 342 |
* MPA multiwire |
| 343 |
|
| 344 |
+ MpaImage |
| 345 |
|
| 346 |
* Medical Research Council file format for 3D electron density and 2D images |
| 347 |
|
| 348 |
+ MrcImage |
| 349 |
|
| 350 |
* Nonius -> now owned by Bruker |
| 351 |
|
| 352 |
+ KcdImage |
| 353 |
|
| 354 |
* Numpy: generic reader for 2D arrays saved |
| 355 |
|
| 356 |
+ NumpyImage |
| 357 |
|
| 358 |
* Oxford Diffraction Sapphire 3 |
| 359 |
|
| 360 |
+ OXDimage uncompressed or with TY1 or TY5 compression scheme |
| 361 |
+ Esperanto format (with bitfield compression) |
| 362 |
|
| 363 |
* Pixirad Imaging |
| 364 |
|
| 365 |
+ PixiImage |
| 366 |
|
| 367 |
* PNM |
| 368 |
|
| 369 |
+ PnmImage |
| 370 |
|
| 371 |
* Princeton Instrument SPE |
| 372 |
|
| 373 |
+ SpeImage |
| 374 |
|
| 375 |
* Raw Binary without compression |
| 376 |
|
| 377 |
* Rigaku |
| 378 |
|
| 379 |
+ RaxisImage |
| 380 |
+ DtrekImage |
| 381 |
|
| 382 |
* Tiff |
| 383 |
|
| 384 |
+ TifImage using either: |
| 385 |
- Pillow (external dependency) |
| 386 |
- TiffIO taken from PyMca |
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
Design Specifications |
| 391 |
--------------------- |
| 392 |
|
| 393 |
Name: |
| 394 |
..... |
| 395 |
|
| 396 |
FabIO = Fable Input/Output |
| 397 |
|
| 398 |
Idea: |
| 399 |
..... |
| 400 |
|
| 401 |
Have a base class for all our 2D diffraction greyscale images. |
| 402 |
This consists of a 2D array (numpy ndarray) |
| 403 |
and a python dictionary (actually an ordered dict) of header information in (string key, string value) pairs. |
| 404 |
|
| 405 |
Class FabioImage |
| 406 |
................ |
| 407 |
|
| 408 |
Needs a name which will not to be confused with an RGB color image. |
| 409 |
|
| 410 |
Class attributes, often exposed as properties: |
| 411 |
|
| 412 |
* data -> 2D array |
| 413 |
* header -> ordered dictionary |
| 414 |
* rows, columns, dim1, dim2 -> data.shape (property) |
| 415 |
* header_keys -> property for list(header.keys()), formerly used to retain the order of the header |
| 416 |
* bytecode -> data.typecode() (property) |
| 417 |
* m, minval, maxval, stddev -> image statistics, could add others, eg roi[slice] |
| 418 |
|
| 419 |
Class methods (functions): |
| 420 |
|
| 421 |
* integrate_area() -> return sum(self.data) within slice |
| 422 |
* rebin(fact) -> rebins data, adjusts dims |
| 423 |
* toPIL16() -> returns a PILimage |
| 424 |
* getheader() -> returns self.header |
| 425 |
* resetvals() -> resets the statistics |
| 426 |
* getmean() -> (computes) returns self.m |
| 427 |
* getmin() -> (computes) returns self.minval |
| 428 |
* getmax() -> (computes) returns self.maxval |
| 429 |
* getstddev() -> (computes) returns self.stddev |
| 430 |
* read() -> read image from file [or stream, or shared memory] |
| 431 |
* write() -> write image to file [or stream, or shared memory] |
| 432 |
* readheader() -> read only the header [much faster for scanning files] |
| 433 |
|
| 434 |
Each individual file format would then inherit all the functionality of this class and just make new read and write methods. |
| 435 |
|
| 436 |
There are also fileseries related methods (next(), previous(), ...) which returns a FabioImage instance of the next/previous frame in a file series |
| 437 |
|
| 438 |
Other features: |
| 439 |
|
| 440 |
* possibility for using on-the-fly external compression - i.e. if files are |
| 441 |
stored as something as .gz, .bz2 etc could decompress them, using an external |
| 442 |
compression mechanism (if available). |
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
.. |Build Status| image:: https://travis-ci.org/silx-kit/fabio.svg?branch=master |
| 447 |
:target: https://travis-ci.org/silx-kit/fabio |
| 448 |
.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/4k6lol1vq30qhf66/branch/master?svg=true |
| 449 |
:target: https://ci.appveyor.com/project/ESRF/fabio/branch/master |