Skip to main content

Laboratory for Fluorescence Dynamics (LFD) file formats

Project description

Lfdfiles is a Python library and console script for reading, writing, converting, and viewing many of the proprietary file formats used to store experimental data and metadata at the Laboratory for Fluorescence Dynamics. For example:

  • SimFCS VPL, VPP, JRN, BIN, INT, CYL, REF, BH, BHZ, B64, I64, Z64, R64

  • FLIMbox FBD, FBF, FBS.XML

  • GLOBALS LIF, ASCII

  • CCP4 MAP

  • Vaa3D RAW

  • Bio-Rad(r) PIC

  • ISS Vista IFLI, IFI

  • FlimFast FLIF

Author:

Christoph Gohlke

License:

BSD 3-Clause

Version:

2024.4.24

DOI:

10.5281/zenodo.8384166

Quickstart

Install the lfdfiles package and all dependencies from the Python Package Index:

python -m pip install -U lfdfiles[all]

Print the console script usage:

python -m lfdfiles --help

The lfdfiles library is type annotated and documented via docstrings.

See Examples for using the programming interface.

Source code and support are available on GitHub.

Requirements

This revision was tested with the following requirements and dependencies (other versions may work):

Revisions

2024.4.24

  • Support NumPy 2.

2024.3.4

  • Fix decoding 32-bit, 16 windows, 4 channels Spartan6 FBD files (#1).

2023.9.26

  • Remove phasor and lifetime methods from VistaIfli (breaking).

  • Rename SimfcsFbd and SimfcsFbf to FlimboxFbd and FlimboxFbf (breaking).

  • Deprecate SimfcsFbd and SimfcsFbf.

  • Support int16 FLIMbox cross correlation phase indices (bins).

  • Add FlimboxFbs class for ISS VistaVision FLIMbox settings.

  • Add decoder for 32-bit, 16 windows, 4 channels FlimboxFbd (untested).

2023.9.16

  • Rewrite VistaIfli based on file format specification (breaking).

  • Define positional and keyword parameters (breaking).

  • SimfcsFbd.asarray returns bins only (breaking).

2023.8.30

  • Fix type hint issues.

  • Add py.typed marker.

2023.8.1

  • Specify encoding of text files.

  • Fix linting issues.

2023.4.20

  • Improve type hints.

  • Drop support for Python 3.8 and numpy < 1.21 (NEP29).

2022.9.29

  • Fix setup.py.

2022.9.20

  • Update metadata.

2022.6.10

  • Fix LfdFileSequence with tifffile 2022.4.22.

  • Add fbd2b64 conversion function and script.

  • Add decoder for 32-bit, 8 windows, 4 channels FLIMbox data from Spartan-6.

  • Convert docstrings to Google style with Sphinx directives.

2022.2.2

  • Add type hints.

  • SimfcsFit.asarray returns dc_ref only; use p_fit for fit params (breaking).

  • Remove additional positional arguments to LfdFile init (breaking).

  • Guess SimfcsBin shape and dtype if not provided (breaking).

  • Use TiffWriter.write instead of deprecated save.

  • Drop support for Python 3.7 and NumPy < 1.19 (NEP29).

2021.7.15

Refer to the CHANGES file for older revisions.

Notes

The API is not stable yet and might change between revisions.

Python <= 3.8 is no longer supported. 32-bit versions are deprecated.

The latest Microsoft Visual C++ Redistributable for Visual Studio 2015-2022 is required on Windows.

Many of the LFD’s file formats are not documented and might change arbitrarily. This implementation is mostly based on reverse engineering existing files. No guarantee can be made as to the correctness of code and documentation.

Experimental data are often stored in plain binary files with metadata available in separate, human readable journal files (.jrn).

Unless specified otherwise, data are stored in little-endian, C contiguous order.

References

The following software is referenced in this module:

  1. SimFCS, a.k.a. Globals for Images, is software for fluorescence image acquisition, analysis, and simulation, developed by Enrico Gratton at UCI.

  2. Globals, a.k.a. Globals for Spectroscopy, is software for the analysis of multiple files from fluorescence spectroscopy, developed by Enrico Gratton at UIUC and UCI.

  3. ImObj is software for image analysis, developed by LFD at UIUC. Implemented on Win16.

  4. FlimFast is software for frequency-domain, full-field, fluorescence lifetime imaging at video rate, developed by Christoph Gohlke at UIUC.

  5. FLImage is software for frequency-domain, full-field, fluorescence lifetime imaging, developed by Christoph Gohlke at UIUC. Implemented in LabVIEW.

  6. FLIez is software for frequency-domain, full-field, fluorescence lifetime imaging, developed by Glen Redford at UIUC.

  7. Flie is software for frequency-domain, full-field, fluorescence lifetime imaging, developed by Peter Schneider at MPIBPC. Implemented on a Sun UltraSPARC.

  8. FLOP is software for frequency-domain, cuvette, fluorescence lifetime measurements, developed by Christoph Gohlke at MPIBPC. Implemented in LabVIEW.

  9. VistaVision is commercial software for instrument control, data acquisition and data processing by ISS Inc (Champaign, IL).

  10. Vaa3D is software for multi-dimensional data visualization and analysis, developed by the Hanchuan Peng group at the Allen Institute.

  11. Voxx is a volume rendering program for 3D microscopy, developed by Jeff Clendenon et al. at the Indiana University.

  12. CCP4, the Collaborative Computational Project No. 4, is software for macromolecular X-Ray crystallography.

Examples

Create a Bio-Rad PIC file from a NumPy array:

>>> data = numpy.arange(1000000).reshape(100, 100, 100).astype('u1')
>>> bioradpic_write('_biorad.pic', data)

Read the volume data from the PIC file as NumPy array, and access metadata:

>>> with BioradPic('_biorad.pic') as f:
...     f.shape
...     f.spacing
...     data = f.asarray()
(100, 100, 100)
(1.0, 1.0, 1.0)

Convert the PIC file to a compressed TIFF file:

>>> with BioradPic('_biorad.pic') as f:
...     f.totiff('_biorad.tif', compression='zlib')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lfdfiles-2024.4.24.tar.gz (311.3 kB view hashes)

Uploaded Source

Built Distributions

lfdfiles-2024.4.24-cp312-cp312-win_arm64.whl (166.4 kB view hashes)

Uploaded CPython 3.12 Windows ARM64

lfdfiles-2024.4.24-cp312-cp312-win_amd64.whl (193.8 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

lfdfiles-2024.4.24-cp312-cp312-win32.whl (166.0 kB view hashes)

Uploaded CPython 3.12 Windows x86

lfdfiles-2024.4.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

lfdfiles-2024.4.24-cp312-cp312-macosx_11_0_arm64.whl (793.8 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

lfdfiles-2024.4.24-cp312-cp312-macosx_10_9_x86_64.whl (811.5 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

lfdfiles-2024.4.24-cp311-cp311-win_arm64.whl (165.2 kB view hashes)

Uploaded CPython 3.11 Windows ARM64

lfdfiles-2024.4.24-cp311-cp311-win_amd64.whl (191.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

lfdfiles-2024.4.24-cp311-cp311-win32.whl (164.1 kB view hashes)

Uploaded CPython 3.11 Windows x86

lfdfiles-2024.4.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

lfdfiles-2024.4.24-cp311-cp311-macosx_11_0_arm64.whl (789.7 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

lfdfiles-2024.4.24-cp311-cp311-macosx_10_9_x86_64.whl (806.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

lfdfiles-2024.4.24-cp310-cp310-win_amd64.whl (190.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

lfdfiles-2024.4.24-cp310-cp310-win32.whl (163.8 kB view hashes)

Uploaded CPython 3.10 Windows x86

lfdfiles-2024.4.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

lfdfiles-2024.4.24-cp310-cp310-macosx_11_0_arm64.whl (790.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

lfdfiles-2024.4.24-cp310-cp310-macosx_10_9_x86_64.whl (806.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

lfdfiles-2024.4.24-cp39-cp39-win_amd64.whl (191.4 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

lfdfiles-2024.4.24-cp39-cp39-win32.whl (164.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

lfdfiles-2024.4.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lfdfiles-2024.4.24-cp39-cp39-macosx_11_0_arm64.whl (790.7 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

lfdfiles-2024.4.24-cp39-cp39-macosx_10_9_x86_64.whl (807.4 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page