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.
The library facilitates the work with files containing time-tagged time resolved photon streams by providing a vendor independent C++ application programming interface (API) for TTTR files that is wrapped by SWIG (Simplified Wrapper and Interface Generator) for common scripting languages as Python as target languages and non-scripting languages such as C# and Java including Octave, Scilab and R. Currently, tttrlib is wrapped for the use in Python.
- Multi-dimensional histograms
- Correlation analysis
- Time-window analysis
- Photon distribution anaylsis
- FLIM image generation and analysis
tttrlib
is programmed in C++ and wrapped for python. Thus, it can be used to integrate time-resolved data into
advanced data analysis pipelines.
Capabilities
- Fast reading TTTR files (IO limited)
- Generation / analysis of fluorescence decays
- Time window analysis
- Correlation of time event traces
- Filtering of time event traces to generate instrument response functions for fluorescence decays analysis without the need of independent measurements..
- Fast photon distribution analysis
- Fast selection of photons from a photon stream
Generation of fluorescence decay histograms tttrlib outperforms pure numpy and Python based libraries by a factor of ~40.
Documentation
Installation
In an anaconda environment the library can be installed by the following command:
conda install -c tpeulen tttrlib
Alternatively, you can use pip to install tttrlib
pip install tttrlib
Usage
The API of tttrlib as well as some use cases are documented on its web page. Below you find a small selection of code snippets.
Access photon data as follows:
import tttrlib
fn = 'photon_stream.ptu'
data = tttrlib.TTTR(fn)
macro_times = data.macro_times
micro_times = data.micro_times
routing_channels = data.routing_channels
Print header-information:
import tttrlib
fn = 'photon_stream.ptu'
data = tttrlib.TTTR(fn)
print(data.json)
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 from CLSM data:
import tttrlib
fn = 'image.ptu'
data = tttrlib.TTTR(fn)
clsm = tttrlib.CLSM(data)
channels = [0, 1]
prompt_range = [0, 16000]
clsm.fill(channels=channels, micro_time_ranges=[prompt_range])
intensity_image = clsm.intensity
tttrlib is in active development. In case you notice unusual behaviour do not hesitate to contact the authors.
Supported file formats
PicoQuant (PQ)
- PicoHarp ptu, T2/T3
- HydraHarp ptu, T2/T3
- HydraHarp ht3, PTU
Becker & Hickl (BH)
- spc132
- spc630 (256 & 4096 mode)
Photon HDF5
Design goals
- Low memory footprint (keep objective large datasets, e.g., FLIM in memory).
- Platform independent C/C++ library with interfaces for scripting libraries
Building and Installation
C++ shared library
The C++ shared library can be installed from source with cmake:
git clone --recursive https://github.com/fluorescence-tools/tttrlib.git
mkdir tttrlib/build; cd tttrlib/build
cmake ..
sudo make install
On Linux you can build and install a package instead:
Python bindings
The Python bindings can be either be installed by downloading and compiling the source code or by using a precompiled distribution for Python anaconda environment.
The following commands can be used to download and compile the source code:
git clone --recursive https://github.com/fluorescence-tools/tttrlib.git
cd tttrlib
sudo python setup.py install
In an anaconda environment the library can be installed by the following command:
conda install -c tpeulen tttrlib
For most users, the latter approach is recommended. Currently, pre-compiled packages for the anaconda distribution system are available for Windows (x86), Linux (x86, ARM64, PPCle), and macOS (x86). Precompiled libary are linked against conda-forge HDF5 & Boost. Thus, the use of miniforge is recommended.
Legacy 32-bit platforms and versions of programming languages, e.g., Python 2.7 are not supported.
Citation
If you use this software please also check the pre-print:
tttrlib: modular software for integrating fluorescence spectroscopy, imaging, and molecular modeling; Thomas-Otavio Peulen, Katherina Hemmen, Annemarie Greife, Benjamin M. Webb, Suren Felekyan, Andrej Sali, Claus A. M. Seidel, Hugo Sanabria, Katrin G. Heinze; https://arxiv.org/abs/2402.17252
License
Copyright 2007-2024 tttrlib developers. Licensed under the BSD-3-Clause
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
Hashes for tttrlib-0.24.4-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19e34446cf27247e766f7952c3584a9bef38214d041658b6f65e513d2171e4a3 |
|
MD5 | 1052a1970226ed1d5722faba95de06db |
|
BLAKE2b-256 | 1ac1f6b84e93e3ba92bbca30ee07169780e21a3ffff04b8edbe8533c74cccc85 |
Hashes for tttrlib-0.24.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b65ac9227f6624b1b1c72a132b8f7b47b7b9af6fc77a84d8e5bc5c1c668d803 |
|
MD5 | 0af709b0a670d60c4b0a3fbffdaa6bb4 |
|
BLAKE2b-256 | 6a134aa459b6a4de50478f7b340e95046120e5bc1d06c1d3fd43b246034750e2 |
Hashes for tttrlib-0.24.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81b97c3cc73990dcca9c5f0716d5fd5285b1dc6ae58fd8bddfff16dff49a331c |
|
MD5 | 48df76e9bdc590fef8e28dd2127611e6 |
|
BLAKE2b-256 | 0e99845ae257ec7f177ef4f4a679dc7371d315b971a77cf5f2bc4751e9d8f5c1 |
Hashes for tttrlib-0.24.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e4913720e032bc8ab8093ae7f9b5bf973325a01d39f69c3f59e26d5c83fa4d |
|
MD5 | 44027e7f479ec475ec5e78037ee8c4ce |
|
BLAKE2b-256 | 73f16a6a400c89b9ad02d25a20cf0d143ef386877203dd15267ff1ee3d9c04aa |
Hashes for tttrlib-0.24.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2df9db20a9baee9d1aeb3173624e966d5b42f83648b46a56fc9445427157ef3 |
|
MD5 | e86fabdb5e9924f278e2f903020534cd |
|
BLAKE2b-256 | b68690910eab284ffd56770b1ab9718029cc903a965b4860118f35a1c7bbd5c6 |