PyFLI (pyfli-lib): A Unified Open-Source Python Library for FLIM Analysis and Fluorescence Lifetime Imaging
PyFLI is an open-source Python library for Fluorescence Lifetime Imaging (FLI/FLIM) analysis. It loads TCSPC, SPAD and ICCD data from different manufacturers through one interface, for both microscopy (FLIM) and macroscopic imaging (MFLI), and provides:
- Traditional analysis: NLSF and MLE lifetime fitting, RLD, Laguerre deconvolution and phasor plot analysis, on CPU or GPU.
- Advanced analysis: FLIM Deep-learning inference, and compressed-sensing reconstruction for single-pixel hyperspectral FLI.
- Advanced statistical analysis:
- Precision limits: CRLB-derived bounds for fitted parameters, computed from the Poisson Fisher information matrix (Cramér-Rao lower bound, CRLB).
- Photon economy: coefficient of variation of lifetime estimates as a function of photon count.
- Error analysis: per-pixel error against simulated ground truth, and goodness-of-fit with Poisson deviance.
- Method comparison: results from every fitting method binned and compared across factors such as photon count, plus mono- vs. bi-exponential model classification.
- Distribution tests: classical and multivariate tests that compare simulated and experimental data.
- Cross-software benchmarking: import results processed in other software and compare them with PyFLI.
- A standardized platform for FLIM deep learning: a complete pipeline for training, running and benchmarking FLIM deep-learning models. It includes a detector-aware simulator that generates labeled training data with known ground truth, and a common benchmark that compares networks against analytical methods.
Supported Data Acquisition Methods
The platform provides native support for several high-end imaging systems:
- ICCD: Intensified Charge-Coupled Device cameras for fast-gated, wide-field imaging.
- SPAD: High-speed SPAD (Single-Photon Avalanche Diode) architectures for high-resolution photon counting.
- TCSPC: Standardized processing for Time-Correlated Single Photon Counting microscopy data.
Data Processing & Analysis
PyFLI (pyfli-lib) implements standard analytical methods to extract lifetime information:
- Non-linear Least Squares Fitting (NLSF): Robust mathematical approach for exponential decay modeling.
- Phasor Plot Analysis: Graphical, model-free transformation of fluorescence decay into a 2D polar plot for easy species separation.
- Maximum Likelihood Estimation (MLE): Statistical estimator optimized for low-photon regimes.
- Rapid Lifetime Determination (RLD): Computationally efficient method for real-time applications and high-frame-rate data.
- Laguerre Method: Model-free IRF deconvolution followed by multi-exponential lifetime extraction on a per-pixel basis.
- Bayesian Inference: Probabilistic parameter estimation with uncertainty quantification for lifetime fitting.
Installation
Install the stable version directly from PyPI:
pip install pyfli-lib
For users requiring GPU-based processing, install the optional tensor/AI dependencies:
pip install "pyfli-lib[gpu]"
Quick Start
Even though the package is installed as pyfli-lib, you import it as pyfli in your scripts:
from pyfli import DataOperations
loader = DataOperations(
data_path="experimental_data.sdt",
irf_path="instrument_data.txt",
bg_path="background_data.tif",
mask_path="background_data.png",
)
decay_data = loader.load_data()
irf_data = loader.load_irf()
Documentation
Full documentation, examples and API reference are at pyfli.org. Guides:
- How to perform phasor plot analysis in Python with PyFLI
- Training deep-learning FLIM models on simulated data
- Example notebooks: NLSF/MLE fitting, phasor analysis, FLIM simulation and SPAD data I/O
Citation
If you use PyFLI in your research, please cite this package:
Pandey V., Erbas I., Barroso M., Radev S., Intes X. PyFLI: A Python Library for Simulation, Parameter Estimation, and Benchmarking in Fluorescence Lifetime Imaging. https://arxiv.org/abs/2609.11994
@misc{pandey2026pyflipythonlibrarysimulation,
title={PyFLI: A Python Library for Simulation, Parameter Estimation, and Benchmarking in Fluorescence Lifetime Imaging},
author={Vikas Pandey and Ismail Erbas and Margarida Barroso and Stefan Radev and Xavier Intes},
year={2026},
eprint={2609.11994},
archivePrefix={arXiv},
primaryClass={q-bio.QM},
url={https://arxiv.org/abs/2609.11994},
}
Repository & Issues
The source code is hosted on GitHub. Please report any bugs or feature requests via the issues tracker.
- Website: PyFLI, the open-source FLIM analysis framework (pyfli.org)
- GitHub: https://github.com/vkp217/pyfli-lib
- Contact: For any queries, reach out at pyfli4lifetime@gmail.com or support@pyfli.org
Metadata
Release files for pyfli-lib 0.1.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfli_lib-0.1.20.tar.gz | 2.1 MB | Without provenance | Details for pyfli_lib-0.1.20.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfli_lib-0.1.20-py3-none-any.whl | Python 3 | none | any | Details for pyfli_lib-0.1.20-py3-none-any.whl |
Total release size: 4.2 MB
Release files / pyfli_lib-0.1.20.tar.gz
| Download URL | pyfli_lib-0.1.20.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82f9b41d4584652b852502ee82739321d63c158df3512529a6ffd973961117bc
|
|
BLAKE2b-256 checksum How to use checksums |
9566b15a3c046f2ccea90a6089378592db9029f3e5212b331b3c39350b6aff8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / pyfli_lib-0.1.20-py3-none-any.whl
| Download URL | pyfli_lib-0.1.20-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ce86407afd86c19b2fefeed695bc0a4dc6c39290eb6109f06cc155908613445
|
|
BLAKE2b-256 checksum How to use checksums |
e0ba709b5e001a0313d3704d00c304181a00f33ad06996ee42fadedead99f06e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for pyfli-lib 0.1.20
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.