Skip to main content

PyFLI logo: open-source FLIM analysis software in Python

PyFLI (pyfli-lib): A Unified Open-Source Python Library for FLIM Analysis and Fluorescence Lifetime Imaging

Website PyPI version License: AGPL v3 Python 3.11+ Tests Contributions Welcome

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:

  1. ICCD: Intensified Charge-Coupled Device cameras for fast-gated, wide-field imaging.
  2. SPAD: High-speed SPAD (Single-Photon Avalanche Diode) architectures for high-resolution photon counting.
  3. 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:

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.

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)

Source distribution for pyfli-lib 0.1.20
File Size Uploaded
pyfli_lib-0.1.20.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfli-lib 0.1.20
File Interpreter ABI Platform
pyfli_lib-0.1.20-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.20 This release

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page