FLIMAnalyzer
Python package for analysis of Fluorescence Lifetime Imaging Microscopy (FLIM) data.
Documentation: https://flimanalyzer.readthedocs.io
Requirements
- Python 3.12 to 3.14
- All Python dependencies, including PyTorch and Prefect, are declared in
pyproject.tomland installed automatically.
Installation
From PyPI with uv (recommended)
uv creates a virtual environment in .venv (installing a matching Python if needed). Then install FLIMAnalyzer with its graphical user interface (GUI) into it:
uv venv --python 3.12
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install "flimanalyzer[gui]"
The gui extra installs the GUI. Without it, uv pip install flimanalyzer installs only what batch mode needs, for example on a computing cluster. Add dask for the optional Dask support (see Concurrent and distributed execution), e.g. "flimanalyzer[gui,dask]".
From PyPI with pip
python3.12 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install "flimanalyzer[gui]"
PyTorch and the GPU
Installed from PyPI, FLIMAnalyzer gets PyTorch from PyPI, which provides a different build on each platform:
- Linux: the PyPI build includes CUDA, so an NVIDIA GPU is used if its driver is recent enough.
- Windows: the PyPI build is CPU-only. For an NVIDIA GPU, install with
uv pip install "flimanalyzer[gui]" --torch-backend=cu130, or with pip install the CUDA build first:pip install torch --index-url https://download.pytorch.org/whl/cu130. See pytorch.org for other CUDA versions. - macOS: only Apple Silicon is supported, because current PyTorch versions are not available for Intel Macs. The PyPI build uses the Apple GPU (MPS).
Latest development version
To install the current state of the repository, clone it and let uv create the environment. uv sync installs FLIMAnalyzer with the GUI in editable mode, with the exact package versions from uv.lock (the versions the tests run with). On Windows and Linux (x86_64), it installs the CUDA 13.0 build of PyTorch:
git clone https://github.com/uvaKCCI/flimanalyzer.git
cd flimanalyzer
uv sync
Without the GUI, with the test dependencies, or with Dask support:
uv sync --no-group gui
uv sync --extra test
uv sync --extra dask
With pip, in a virtual environment in the cloned folder: pip install -e ".[gui]".
With Docker
The Docker images run only batch mode. They do not include the GUI. Each release is published to the GitHub Container Registry:
| Image | |
|---|---|
ghcr.io/uvakcci/flimanalyzer:<version>, :latest |
with the CUDA build of PyTorch (x86_64, several GB) |
ghcr.io/uvakcci/flimanalyzer:<version>-cpu, :latest-cpu |
CPU only (x86_64 and ARM), much smaller |
docker pull ghcr.io/uvakcci/flimanalyzer:latest-cpu
To build an image from the repository instead: with the CUDA 13.0 build of PyTorch, with the build for another CUDA version (here 12.6, for older GPUs), with the CPU-only build, or with Dask support:
docker build -t flimanalyzer .
docker build -t flimanalyzer:cu126 --build-arg TORCH_INDEX=https://download.pytorch.org/whl/cu126 .
docker build -t flimanalyzer:cpu --build-arg TORCH_INDEX=https://download.pytorch.org/whl/cpu .
docker build -t flimanalyzer:dask --build-arg EXTRAS=dask .
TORCH_INDEX replaces PyTorch with the build from that PyTorch package index, in the same PyTorch version (the one in uv.lock, currently 2.14.1). Choose the CUDA version that the NVIDIA driver and the GPU of your computer support. PyTorch 2.14.1 is available for CUDA 12.6 (cu126), 13.0 (cu130, the default) and 13.2 (cu132). CUDA 13 needs NVIDIA driver 580 or newer and a GPU of the Turing generation or newer (e.g. T4, RTX 20xx, A100, H100). For older GPUs such as the V100, try the CUDA 12.6 build (cu126); check PyTorch's release notes for the GPUs it supports.
EXTRAS=gui stops the build with an error, because the images do not support a display.
Start FLIMAnalyzer with the GUI
With uv, no activation is needed:
uv run flimanalyzer
In an activated environment:
flimanalyzer
To open data files (tab- or comma-separated) at startup, each in its own window:
uv run flimanalyzer -i results.txt more-results.csv
Run flimanalyzer --help for all command line options.
Using a GPU
The autoencoder tools (Autoencoder Run and Autoencoder Augment Data) and workflows (Autoencoder Train, FLIM Data Augmentation Tuning and FLIM Feature Analysis) have a Device setting, in the GUI and in batch mode:
auto(default): an NVIDIA GPU (cuda) if available, otherwise the Apple GPU (mps), otherwise the CPU.cpu,cudaormps: uses that device, or the CPU if it is not available.
Which GPU can be used depends on the PyTorch build that was installed (see Installation). Trained models are saved so that they do not need a GPU, so a model trained on a GPU can also be used on a computer without one.
Run FLIMAnalyzer in batch mode
flimbatch reads data files and runs tools or workflows on them without opening the GUI, for example on a computing cluster. A workflow file, for example the built-in Import, says exactly what a run does with the files. A tool runs with its settings from a tool file, which Save Settings... in the tool's dialog writes.
uv run flimbatch -i data/ -o results/ --run Import --run summarize.json
Each call saves its results in a new folder below -o, named after the date and time, with a folder run-<n> per --run; a workflow file saves the results of the steps it marks to save. --dry-run validates the runs against the files without running them. A column that is not in the data (for example FAD a1% for FAD a1[%]) is an error, unless the tool or workflow file's processing section allows the closest column ("strict": false). The exit code is 1 if a validation or a task failed. Run flimbatch --help for all options.
flimanalyzer --batch … does the same as flimbatch …, but is deprecated and is removed in 0.8.0. On Windows, use flimbatch: flimanalyzer starts without a console there, so its messages are not shown.
In Docker
The image runs flimbatch. Make the folder with the data and the tool or workflow files available inside the container as /work:
docker run --rm -v "$PWD:/work" ghcr.io/uvakcci/flimanalyzer:latest-cpu \
-i data/ -o results/ --run summarize.json --no-prefect-server
- On Linux, add
-u $(id -u)so that the result files belong to you. - With the CUDA image, add
--gpus allto use the GPU. - With
--no-prefect-server, each run uses a temporary Prefect server. To report to a Prefect server instead, leave out--no-prefect-serverand pass the server's address todocker run, before the image name, for exampledocker run --rm -e PREFECT_API_URL=http://prefect.example.org:4200/api -v "$PWD:/work" .... An-eafter the image name goes toflimbatch, which reads it as the executor.
Prefect server
FLIMAnalyzer runs analyses and workflows as Prefect flows. At startup it looks for a Prefect server in this order:
-
The server configured in the active Prefect profile or in the
PREFECT_API_URLenvironment variable, e.g.prefect profile use <profile> # or export PREFECT_API_URL=https://my-prefect-server/api -
A server already running locally at
http://127.0.0.1:4200/api. -
If none is found, FLIMAnalyzer starts a local server (
prefect server start) and stops it again when FLIMAnalyzer closes. If port 4200 is taken, the server is started on a free port. The server's output is written toprefect-server.log. If no server can be started, FLIMAnalyzer stops with an error.
The server found or started at startup is used for all runs until FLIMAnalyzer closes.
Flow and task runs can be inspected in the Prefect UI of the server in use, e.g. http://127.0.0.1:4200 for a local server. To keep a local server running across sessions, start it yourself in a separate terminal with uv run prefect server start. Use --no-prefect-server to skip starting a server; Prefect then starts a temporary server for each run, which stops when the run ends.
Concurrent and distributed execution
Every tool and workflow step runs as a Prefect task. A task starts as soon as the results it needs are ready. Tasks that do not depend on each other run concurrently, without waiting for each other. Tasks that draw figures take turns, because matplotlib's pyplot is not thread-safe.
By default, up to one task per CPU core runs at a time, as threads. To change that number:
uv run flimanalyzer -e local:workers=4
workers=1 runs one task at a time. Prefect's PREFECT_TASKS_RUNNER_THREAD_POOL_MAX_WORKERS setting, if set, is used as the default.
FLIMAnalyzer can also use Dask. Dask support is optional; install it with uv sync --extra dask (or pip install -e ".[dask]").
On a single node, start a local Dask cluster:
uv run flimanalyzer -e dask-local:workers=8,scheduler=processes
As a general guideline, adjust workers to match the number of CPU cores in your system. Use scheduler=threads to run the workers as threads instead of processes.
To use an existing Dask cluster:
uv run flimanalyzer -e dask:address=tcp://<scheduler-host>:8786
Concurrency limits
Prefect applies tag concurrency limits set on the Prefect server, whichever executor is used. Every task is tagged with its tool's name as shown in the menu (e.g. Autoencoder Train, not the Python class name), also as a step of a workflow; workflow steps can carry more tags, which also name their results folders. For example, to let only one autoencoder training run at a time, also inside workflows:
uv run prefect concurrency-limit create "Autoencoder Train" 1
uv run prefect concurrency-limit ls lists the limits, and uv run prefect concurrency-limit delete <tag> removes one.
How to cite
If you use FLIMAnalyzer, please cite:
-
The original publication, in all cases:
Zhang J, Wallrabe H, Siller K, Mbogo B, Cassidy T, Alam SR, Periasamy A. Measuring metabolic changes in cancer cells using two-photon fluorescence lifetime imaging microscopy and machine-learning analysis. Journal of Biophotonics 18(1), e202400426 (2025). doi:10.1002/jbio.202400426
-
The publication closest to the version you used, plus that release's software DOI, from the table below. Use the newest release that is not newer than your version. The version is shown in the FLIMAnalyzer window title.
| Your version | Publication | Software DOI |
|---|---|---|
| v0.5.0 or later | Alam SR, Siller K, Dreicer R, Periasamy A. Label-free optical biomarker for prostate cancer diagnosis. Molecular Medicine 32(1), 165 (2026). doi:10.1186/s10020-026-01605-2 | 10.5281/zenodo.23438157 |
| v0.4.1 or earlier | Zhang et al. (2025), the original publication above | 10.5281/zenodo.23426564 |
The concept DOI 10.5281/zenodo.23426563 covers all versions archived on Zenodo and resolves to the latest of them. Not every release is archived on Zenodo; the table above lists the versions used in publications. Citation metadata is also in CITATION.cff; GitHub shows it under "Cite this repository".
Development
Run the test suite:
uv sync --extra test
uv run pytest
Tests that run flows use a temporary Prefect server and database and do not report to any configured server.
The tests run one after another. The GUI tests depend on wxPython's event loop and on timing, so they must not run in parallel. Only the core tests (no GUI) can run in parallel, one process per CPU core, with pytest-xdist:
uv run pytest -n auto tests/core
Build the documentation (output in docs/_build/html):
uv run --group docs sphinx-build -b html docs docs/_build/html
The docs dependency group contains only Sphinx and the lightweight packages needed to document the code; docs/conf.py imports flim from the source tree and mocks wxPython, PyTorch and Prefect. This is also how the documentation is built on Read the Docs (see .readthedocs.yaml).
Metadata
Release files for flimanalyzer 0.7.0
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 |
|---|---|---|---|---|
| flimanalyzer-0.7.0.tar.gz | 867.9 kB | With provenance | Details for flimanalyzer-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flimanalyzer-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for flimanalyzer-0.7.0-py3-none-any.whl |
Total release size: 1.6 MB
Release files / flimanalyzer-0.7.0.tar.gz
| Download URL | flimanalyzer-0.7.0.tar.gz |
|---|---|
| Size | 867.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62655407e94aefe590913b8bd66b00e4572c0b90e50edb3a6f4cf26f2f4820a3
|
|
BLAKE2b-256 checksum How to use checksums |
d156275af0900419c21300779938ce1dcb81f32a70b72f53e9ca8f0af7cb459b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logRelease files / flimanalyzer-0.7.0-py3-none-any.whl
| Download URL | flimanalyzer-0.7.0-py3-none-any.whl |
|---|---|
| Size | 733.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2628aa72eca8d4adf5bb878744152c3bc6dd6cc60b273727af5d008fe90f914d
|
|
BLAKE2b-256 checksum How to use checksums |
51d29ed03e134926811b2c23229475511ee1a2a7d17d3acca76a5d31141c21e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for flimanalyzer 0.7.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for flimanalyzer-0.7.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA 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.