tttrlib
General description
tttrlib is a file format agnostic high performance library to read, process, and write time-tagged-time resolved (TTTR) data acquired by PicoQuant (PQ) and Becker & Hickl measurement devices/cards or TTTR files in the open Photon-HDF format.
tttrlib is a high-performance, file-format-agnostic library to read, process, and write time-tagged time-resolved (TTTR) data from PicoQuant, Becker & Hickl, and Photon-HDF5 files.
Written in C++ with Python bindings, it provides a fast, vendor-independent API for handling photon streams and enables integration into advanced data analysis pipelines for time-resolved fluorescence spectroscopy and imaging.
Key Features
- Fast TTTR file reading (IO-limited)
- Multi-dimensional histogramming
- Correlation analysis
- Fluorescence decay generation and analysis
- Photon distribution (FIDA/PCH)
- Burst and time-window selection
- FLIM and ISM image generation
- Experimental ISM tools (Adaptive Pixel Reassignment, Focus-ISM background rejection)
tttrlib typically outperforms pure Python implementations by
~40× in decay histogramming and ~2–5× in burst selection.
Installation
pip (recommended)
pip install tttrlib
Pre-built wheels are available on PyPI for Linux (x86_64), macOS (arm64, x86_64), and Windows (x86_64) across Python 3.9–3.13.
Conda / Mamba
macOS / Linux (via bioconda)
mamba install -c conda-forge -c bioconda tttrlib
Windows (via tpeulen)
mamba install -c tpeulen tttrlib
We recommend Miniforge with the fast mamba solver.
From Source
git clone https://github.com/fluorescence-tools/tttrlib.git
cd tttrlib
pip install -e .
Pre-compiled packages are available for Windows, Linux (x86_64), and macOS (arm64, x86_64). Legacy 32-bit and Python 2.7 are not supported.
Usage
See docs.peulen.xyz/tttrlib for the full API and tutorials. Below are minimal examples.
Detailed build instructions for developers are available in BUILDING.md.
Read TTTR data
import tttrlib
data = tttrlib.TTTR("photon_stream.ptu")
macro = data.macro_times
micro = data.micro_times
routing = data.routing_channels
Inspect header
import tttrlib
fn = 'photon_stream.ptu'
data = tttrlib.TTTR(fn)
print(data.header.json)
print(data.header.to_csv())
Cross-correlate photon streams
import tttrlib
fn = 'photon_stream.ptu'
data = tttrlib.TTTR(fn)
correlator = tttrlib.Correlator(
channels=([1], [2]),
tttr=data
)
taus = correlator.x_axis,
correlation_amplitude = correlator.correlation
Create intensity images (CLSM)
import tttrlib
fn = 'image.ptu'
data = tttrlib.TTTR(fn)
clsm = tttrlib.CLSMImage(data)
channels = [0, 1]
prompt_range = [0, 16000]
clsm.fill(channels=channels, micro_time_ranges=[prompt_range])
intensity_image = clsm.intensity
# Alternatively
clsm = tttrlib.CLSMImage(fn, fill=True)
intensity_image = clsm.intensity
Minimal burst search
import tttrlib
import numpy as np
fn = 'photon_stream.ptu'
tttr = tttrlib.TTTR(fn)
# Bust selection
L, m, T = 30, 10, 1e-3 # min photons, window photons, window time [s]
ranges = tttr.burst_search(L=L, m=m, T=T) # flat [start, stop, start, stop, ...]
bursts = list(zip(ranges[0::2], ranges[1::2]))
For PIE/ALEX data, add micro-time gating before burst search; see the tutorial for donor/acceptor prompt examples. For details, parameters, and plotting examples, see the Burst Analysis tutorial.
Supported File Formats
- PicoQuant: PicoHarp/TimeHarp/HydraHarp (
ptu,ht3, T2/T3) - Becker & Hickl:
spc132,spc630(256 & 4096 mode) - Photon-HDF5: open standard format
Contributing
To add support for a new format / microscope:
- Open a GitHub issue describing the format and instrument.
- Share a small demo file (<100 MB) with expected results.
- If relevant, document your workflow or analysis steps.
With this information, we can integrate and test the new format automatically.
Design Goals
- Low memory footprint for large datasets (e.g. FLIM)
- Cross-platform C/C++ library with SWIG bindings (Python, C#, Java, etc.)
- Modular and extendable design for fluorescence spectroscopy and imaging
Citation
If you use this software, please cite:
Thomas-Otavio Peulen, Katherina Hemmen, Annemarie Greife, Benjamin M. Webb, Suren Felekyan, Andrej Sali, Claus A. M. Seidel, Hugo Sanabria, Katrin G. Heinze. “tttrlib: modular software for integrating fluorescence spectroscopy, imaging, and molecular modeling.” Bioinformatics 41 (2): btaf025 (2025). https://doi.org/10.1093/bioinformatics/btaf025
License
Copyright 2007–2026 tttrlib developers Licensed under the BSD-3-Clause license.
Metadata
Release files for tttrlib 0.26.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 61.1 MB
Release files / tttrlib-0.26.2-cp313-cp313-win_amd64.whl
| Download URL | tttrlib-0.26.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d31ef183afd96457c9c87f8b7ec7ed6d69467ff1360c0b9123df9f04604a9580
|
|
BLAKE2b-256 checksum How to use checksums |
fade5bcf555902211c0284dc857ea0787d511d44fcd64861d5802d395f156dec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | tttrlib-0.26.2-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e9529e91b74a6bfeda12b7f6556963518f7af3e9a02e5baed1d697dc3c17c907
|
|
BLAKE2b-256 checksum How to use checksums |
9ad75488ee72961767afb3071b901aa88ad957e3c3fafd41440d2041a428a772
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp313-cp313-macosx_26_0_x86_64.whl
| Download URL | tttrlib-0.26.2-cp313-cp313-macosx_26_0_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.13 macOS 26.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
4aa908d34b100a66589e677f47fac2ac67a2665dcf3fd3de692c6df6074829b5
|
|
BLAKE2b-256 checksum How to use checksums |
90159e5fe49d89594ebba2058e2dea7576091b28f8e6939250cddb6fac19670b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp313-cp313-macosx_26_0_arm64.whl
| Download URL | tttrlib-0.26.2-cp313-cp313-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.13 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b7253cc45cfb8aa2b112bf74c8a6e1f4d717075b016655a129288532d6b22080
|
|
BLAKE2b-256 checksum How to use checksums |
75a930fdba9da1629bbbbbdcacd1df858dbff33bcaae017b56b8ff5fecf6217f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp312-cp312-win_amd64.whl
| Download URL | tttrlib-0.26.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
278a9a7464b59380b6c800b14a9077c172b93c59abee1758bc8a9bbcb8d4b2c1
|
|
BLAKE2b-256 checksum How to use checksums |
4e94c73ef9d546c79bf2bdf49ef2dd8e3c9e00e869aca597b8f043e1e2bf9e93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | tttrlib-0.26.2-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8977edfffae333a9a3f1be0eb92390ee74181429fe68b5a6bd5665a7820930e1
|
|
BLAKE2b-256 checksum How to use checksums |
78689570c74751e9a1347c42ba5b0ce963c9ea7aa5ea42e6e913cab52d17a1d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp312-cp312-macosx_26_0_x86_64.whl
| Download URL | tttrlib-0.26.2-cp312-cp312-macosx_26_0_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.12 macOS 26.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
56073bd9afaa20033c90d44db1a9fa9d6df5eb7e780d092da44e35d2e749816f
|
|
BLAKE2b-256 checksum How to use checksums |
51e4bc79e3ae8f57c60aaa6946bc44e54f8a967792cc876dbbe3e64b9cf3b038
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp312-cp312-macosx_26_0_arm64.whl
| Download URL | tttrlib-0.26.2-cp312-cp312-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.12 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b47bfd6b2ae6e41f392c435b8301ed54d8d7bc8455e4089053313cd3101851ba
|
|
BLAKE2b-256 checksum How to use checksums |
9046538718ae573afed4f503bfa2cc52cebda55163c5713239cd8117716d9dd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp311-cp311-win_amd64.whl
| Download URL | tttrlib-0.26.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a19d8ae265a3b523fadbfad5e2764c540b8894b8d960bc524d4008a9ec6c3143
|
|
BLAKE2b-256 checksum How to use checksums |
712acfe0776a87585a22cbead448b3604e41eb652b1aff7c09946596aa1d462c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | tttrlib-0.26.2-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2a40b024270fe38706aa9a3661cca3d2473dd8e5a29d78cf6111dfe43cedda86
|
|
BLAKE2b-256 checksum How to use checksums |
10d546ace7b3b5e5f9200b30a8f7995ea7971fd29461314d3295caa9ecda6edc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp311-cp311-macosx_26_0_x86_64.whl
| Download URL | tttrlib-0.26.2-cp311-cp311-macosx_26_0_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.11 macOS 26.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
402f1873b8a8032f35c3b938dfb5207069aaa0d5387056b4d28083b556ce8d77
|
|
BLAKE2b-256 checksum How to use checksums |
47c79d2d7b3adcc1d8b559a4726090d5653c1d06075406327bd8d1bd05901a79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp311-cp311-macosx_26_0_arm64.whl
| Download URL | tttrlib-0.26.2-cp311-cp311-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.11 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8bb0587472b1f2b8914b31d4ad5931465fed7b4716d755807a159152d0b8d4f1
|
|
BLAKE2b-256 checksum How to use checksums |
d8fbed281c3b6e612f19bd382f511573a6511d1c718aaa9d1aaafeaee2c8cb26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp310-cp310-win_amd64.whl
| Download URL | tttrlib-0.26.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
03dd8376dba8464f68fee1b773a24577852041b866371a9cc4f4c5e755a1a4a9
|
|
BLAKE2b-256 checksum How to use checksums |
ee8563f01d53bb50dae4c2da1cbd13bafdf0fe346fcf84fdf7238bb69b0d3c8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | tttrlib-0.26.2-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
301ef848a11e259ef59e0762cde7e8bd201192c1c5de4d6572e27ed520e0a68b
|
|
BLAKE2b-256 checksum How to use checksums |
ded3a116c4501a3f92af7ca5a1f2aee6e8376ea4660524d181418f2cdea37f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp310-cp310-macosx_26_0_x86_64.whl
| Download URL | tttrlib-0.26.2-cp310-cp310-macosx_26_0_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.10 macOS 26.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
0041a6967fffe5147cb18707b5d1c94cfd7459a20628eb632c18a5e5b284e9db
|
|
BLAKE2b-256 checksum How to use checksums |
b83633f8a3c423359b7a3f7703d57fcba2f3265164a227df3eea179a80e9f7fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp310-cp310-macosx_26_0_arm64.whl
| Download URL | tttrlib-0.26.2-cp310-cp310-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.10 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8180609e45514da926fb23ad7e111640d4eb85ac2f2a0e81e3f42c89a37073f5
|
|
BLAKE2b-256 checksum How to use checksums |
25ee320e6b428cd6e68734b68869cf374c482d2fde5b4a957938257cf60ce6e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp39-cp39-win_amd64.whl
| Download URL | tttrlib-0.26.2-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7093ece531f1f71ad1137695e96e6c05c0bdf64a18e39159a09f814e7ec80e3a
|
|
BLAKE2b-256 checksum How to use checksums |
2b4a7d99b05b69040a794c796609d38655981599f09d6fc195b225613610961a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp39-cp39-manylinux_2_28_x86_64.whl
| Download URL | tttrlib-0.26.2-cp39-cp39-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dc011a045b4901d22c56eaa6c395bbbdbf082c30adc2f4cef4e5e5e0f8aeb3a3
|
|
BLAKE2b-256 checksum How to use checksums |
b94321ed948730aca642d4caa0f8f47383333a2fab2efa9b03ac20aa2b64f2c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp39-cp39-macosx_26_0_x86_64.whl
| Download URL | tttrlib-0.26.2-cp39-cp39-macosx_26_0_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 macOS 26.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
123eb9e43bc83f50991b7b68f0cc7c6a029a1c1ba3e2dc30ef60bc3601b3c54e
|
|
BLAKE2b-256 checksum How to use checksums |
5680c1c731e4da33d24d57088ea45ae7b7fa16e4386a26057f70929e02601edf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tttrlib-0.26.2-cp39-cp39-macosx_26_0_arm64.whl
| Download URL | tttrlib-0.26.2-cp39-cp39-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.9 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8f5fbcf89cac7e1633cb4adbec3d0852a9d21fc97c9edeeb0cfb095062d3f9bc
|
|
BLAKE2b-256 checksum How to use checksums |
07d02387730caee1b59683d02b22e54c08484f99e0168f7731344723829e33c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|