PyFLI: Open-Source FLIM Analysis in Python#

PyFLI logo PyFLI logo

PyFLI is an open-source Python library for Fluorescence Lifetime Imaging Microscopy (FLIM) analysis, simulation and visualization. It loads time-resolved data from TCSPC systems, SPAD arrays and gated ICCD cameras through one interface, and estimates fluorescence lifetimes with phasor plot analysis, non-linear least squares and maximum likelihood estimation (MLE) fitting with instrument response function (IRF) deconvolution, or trained deep-learning models. Its FLIM simulator generates realistic, detector-specific training and benchmarking data. PyFLI is described in the PyFLI manuscript (arXiv:2609.11994).

Streamlined Processing Pipeline

Simplifies handling FLIM data acquired by different imaging systems, with a consistent loading and processing interface.

Enhanced FLI Simulator

A robust simulation engine adaptable to specific camera hardware parameters and noise models, for method development and testing.

Standardized Inference

One unified interface for time-resolved data across modalities: microscopy (FLIM), mesoscopy (m-FLI) and macroscopic imaging (MFLI).

Overview#

PyFLI sits between raw instrument output and lifetime results: it loads and pre-processes decay data from a given acquisition system, then hands it to one of several interchangeable analytical or deep-learning fitting backends. The simulator generates FLI/FLIM data with known ground truth for deep-learning model training and for benchmarking lifetime estimators.

Supported Acquisition Methods
  • 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
  • Non-linear Least Squares Fitting (NLSF) — robust exponential decay modeling.

  • Phasor Plot Analysis — graphical, fit-free transformation of fluorescence decay into a 2D polar plot for species separation (see How to perform phasor plot analysis in Python with PyFLI).

  • Maximum Likelihood Estimation (MLE) — statistical estimator optimized for low-photon regimes.

  • Rapid Lifetime Determination (RLD) — computationally efficient method for fast inference.

  • Laguerre Method — model-free IRF deconvolution followed by multi-exponential lifetime extraction on a per-pixel basis.

Where to go next#

Install

Get pyfli from PyPI, with optional GPU support — or install the latest dev build directly from GitHub.

Install
Quickstart

Load your first dataset and run a fit in a few lines.

Quickstart
User Guide

Concepts and workflows behind pyfli, in more depth than the quickstart.

User Guide
API Reference

Full autogenerated reference for every module in pyfli.

API Reference
Changelog

Version history and currently open issues, pulled live from GitHub.

Changelog
FAQ

Answers to common setup and usage questions.

FAQ

Cite PyFLI#

If PyFLI helps your research, please cite the manuscript: Pandey V., Erbas I., Barroso M., Radev S., Intes X. PyFLI: A Python Library for Simulation, Parameter Estimation, and Benchmarking in Fluorescence Lifetime Imaging. arXiv:2609.11994. BibTeX is on the Citation page.

FLIM analysis guides#

How to perform phasor plot analysis in Python with PyFLI

Turn TCSPC or SPAD decay cubes into phasor coordinates, calibrate them with the IRF, read off per-pixel lifetimes, and separate two lifetime species, all without fitting.

How to perform phasor plot analysis in Python with PyFLI
Training deep-learning FLIM models on simulated data

Generate labeled FLIM training sets with realistic IRFs and detector noise, randomize acquisition conditions, and run a trained model over a lifetime image.

Training deep-learning FLIM models on simulated data