Read, write & process time-tagged time-resolved (TTTR) data.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tttrlib-0.26.2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31ef183afd96457c9c87f8b7ec7ed6d69467ff1360c0b9123df9f04604a9580
|
|
| MD5 |
56157d4d7f6dd4d9390486666a3909d1
|
|
| BLAKE2b-256 |
fade5bcf555902211c0284dc857ea0787d511d44fcd64861d5802d395f156dec
|
File details
Details for the file tttrlib-0.26.2-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9529e91b74a6bfeda12b7f6556963518f7af3e9a02e5baed1d697dc3c17c907
|
|
| MD5 |
5a7ca3c0b0509ce8049f890c88120def
|
|
| BLAKE2b-256 |
9ad75488ee72961767afb3071b901aa88ad957e3c3fafd41440d2041a428a772
|
File details
Details for the file tttrlib-0.26.2-cp313-cp313-macosx_26_0_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp313-cp313-macosx_26_0_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.13, macOS 26.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aa908d34b100a66589e677f47fac2ac67a2665dcf3fd3de692c6df6074829b5
|
|
| MD5 |
e78c4fc94c2dd7c109fd6db305979519
|
|
| BLAKE2b-256 |
90159e5fe49d89594ebba2058e2dea7576091b28f8e6939250cddb6fac19670b
|
File details
Details for the file tttrlib-0.26.2-cp313-cp313-macosx_26_0_arm64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp313-cp313-macosx_26_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7253cc45cfb8aa2b112bf74c8a6e1f4d717075b016655a129288532d6b22080
|
|
| MD5 |
905be03a543136a480c2e964174de78f
|
|
| BLAKE2b-256 |
75a930fdba9da1629bbbbbdcacd1df858dbff33bcaae017b56b8ff5fecf6217f
|
File details
Details for the file tttrlib-0.26.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278a9a7464b59380b6c800b14a9077c172b93c59abee1758bc8a9bbcb8d4b2c1
|
|
| MD5 |
df0338de9b0779d995d69f7a05885c9a
|
|
| BLAKE2b-256 |
4e94c73ef9d546c79bf2bdf49ef2dd8e3c9e00e869aca597b8f043e1e2bf9e93
|
File details
Details for the file tttrlib-0.26.2-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8977edfffae333a9a3f1be0eb92390ee74181429fe68b5a6bd5665a7820930e1
|
|
| MD5 |
58a22fae272525d2a10ae80989d762b8
|
|
| BLAKE2b-256 |
78689570c74751e9a1347c42ba5b0ce963c9ea7aa5ea42e6e913cab52d17a1d7
|
File details
Details for the file tttrlib-0.26.2-cp312-cp312-macosx_26_0_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp312-cp312-macosx_26_0_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.12, macOS 26.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56073bd9afaa20033c90d44db1a9fa9d6df5eb7e780d092da44e35d2e749816f
|
|
| MD5 |
16c8f659711d28fca6cbc28bb1076b60
|
|
| BLAKE2b-256 |
51e4bc79e3ae8f57c60aaa6946bc44e54f8a967792cc876dbbe3e64b9cf3b038
|
File details
Details for the file tttrlib-0.26.2-cp312-cp312-macosx_26_0_arm64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp312-cp312-macosx_26_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b47bfd6b2ae6e41f392c435b8301ed54d8d7bc8455e4089053313cd3101851ba
|
|
| MD5 |
7ceae3031dd6d980d6448b84f8ff099c
|
|
| BLAKE2b-256 |
9046538718ae573afed4f503bfa2cc52cebda55163c5713239cd8117716d9dd8
|
File details
Details for the file tttrlib-0.26.2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a19d8ae265a3b523fadbfad5e2764c540b8894b8d960bc524d4008a9ec6c3143
|
|
| MD5 |
5ad45b3e8b0321a217fd29e922707dca
|
|
| BLAKE2b-256 |
712acfe0776a87585a22cbead448b3604e41eb652b1aff7c09946596aa1d462c
|
File details
Details for the file tttrlib-0.26.2-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a40b024270fe38706aa9a3661cca3d2473dd8e5a29d78cf6111dfe43cedda86
|
|
| MD5 |
ae60e727dcb3c55325bdb2647ccf43dd
|
|
| BLAKE2b-256 |
10d546ace7b3b5e5f9200b30a8f7995ea7971fd29461314d3295caa9ecda6edc
|
File details
Details for the file tttrlib-0.26.2-cp311-cp311-macosx_26_0_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp311-cp311-macosx_26_0_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.11, macOS 26.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
402f1873b8a8032f35c3b938dfb5207069aaa0d5387056b4d28083b556ce8d77
|
|
| MD5 |
10c60ff60c2b82a7a9a393fab548bc61
|
|
| BLAKE2b-256 |
47c79d2d7b3adcc1d8b559a4726090d5653c1d06075406327bd8d1bd05901a79
|
File details
Details for the file tttrlib-0.26.2-cp311-cp311-macosx_26_0_arm64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp311-cp311-macosx_26_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb0587472b1f2b8914b31d4ad5931465fed7b4716d755807a159152d0b8d4f1
|
|
| MD5 |
0929754e24de9421e488d7b7c25ba383
|
|
| BLAKE2b-256 |
d8fbed281c3b6e612f19bd382f511573a6511d1c718aaa9d1aaafeaee2c8cb26
|
File details
Details for the file tttrlib-0.26.2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03dd8376dba8464f68fee1b773a24577852041b866371a9cc4f4c5e755a1a4a9
|
|
| MD5 |
05133ccbd7e1ecb22e2319c26eda87a4
|
|
| BLAKE2b-256 |
ee8563f01d53bb50dae4c2da1cbd13bafdf0fe346fcf84fdf7238bb69b0d3c8e
|
File details
Details for the file tttrlib-0.26.2-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
301ef848a11e259ef59e0762cde7e8bd201192c1c5de4d6572e27ed520e0a68b
|
|
| MD5 |
ac79ada6cd400156f83ce0224f33e7c6
|
|
| BLAKE2b-256 |
ded3a116c4501a3f92af7ca5a1f2aee6e8376ea4660524d181418f2cdea37f85
|
File details
Details for the file tttrlib-0.26.2-cp310-cp310-macosx_26_0_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp310-cp310-macosx_26_0_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.10, macOS 26.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0041a6967fffe5147cb18707b5d1c94cfd7459a20628eb632c18a5e5b284e9db
|
|
| MD5 |
49e888449364e1dcda5491061ff9e468
|
|
| BLAKE2b-256 |
b83633f8a3c423359b7a3f7703d57fcba2f3265164a227df3eea179a80e9f7fd
|
File details
Details for the file tttrlib-0.26.2-cp310-cp310-macosx_26_0_arm64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp310-cp310-macosx_26_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8180609e45514da926fb23ad7e111640d4eb85ac2f2a0e81e3f42c89a37073f5
|
|
| MD5 |
e253e3cdbde911bcebcf0b24e2e125f3
|
|
| BLAKE2b-256 |
25ee320e6b428cd6e68734b68869cf374c482d2fde5b4a957938257cf60ce6e4
|
File details
Details for the file tttrlib-0.26.2-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7093ece531f1f71ad1137695e96e6c05c0bdf64a18e39159a09f814e7ec80e3a
|
|
| MD5 |
aa89afe164a0038b9cee984bdfaf10c8
|
|
| BLAKE2b-256 |
2b4a7d99b05b69040a794c796609d38655981599f09d6fc195b225613610961a
|
File details
Details for the file tttrlib-0.26.2-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc011a045b4901d22c56eaa6c395bbbdbf082c30adc2f4cef4e5e5e0f8aeb3a3
|
|
| MD5 |
486863557dbd425b34945138d45d1cc2
|
|
| BLAKE2b-256 |
b94321ed948730aca642d4caa0f8f47383333a2fab2efa9b03ac20aa2b64f2c9
|
File details
Details for the file tttrlib-0.26.2-cp39-cp39-macosx_26_0_x86_64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp39-cp39-macosx_26_0_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.9, macOS 26.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
123eb9e43bc83f50991b7b68f0cc7c6a029a1c1ba3e2dc30ef60bc3601b3c54e
|
|
| MD5 |
c1c8e7a0549a3b819f57413ce0317c7d
|
|
| BLAKE2b-256 |
5680c1c731e4da33d24d57088ea45ae7b7fa16e4386a26057f70929e02601edf
|
File details
Details for the file tttrlib-0.26.2-cp39-cp39-macosx_26_0_arm64.whl.
File metadata
- Download URL: tttrlib-0.26.2-cp39-cp39-macosx_26_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.9, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f5fbcf89cac7e1633cb4adbec3d0852a9d21fc97c9edeeb0cfb095062d3f9bc
|
|
| MD5 |
ba889c663273f6b776d69d39f268a8e8
|
|
| BLAKE2b-256 |
07d02387730caee1b59683d02b22e54c08484f99e0168f7731344723829e33c4
|