Package: tttrlib
tttrlibGeneral descriptiontttrlib 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 histogramsCorrelation analysisTime-window analysisPhoton distribution anaylsisFLIM image generation and analysistttrlibis programmed in C++ and wrapped for python. Thus, it can be used to integrate time-resolved data into
advanced data analysis pipelines.CapabilitiesFast reading TTTR files (IO limited)Generation / analysis of fluorescence decaysTime window analysisCorrelation of time event tracesFiltering of time event traces to generate instrument response functions for fluorescence decays analysis without the need of independent measurements..Fast photon distribution analysisFast selection of photons from a photon streamGeneration of fluorescence decay histograms tttrlib outperforms pure numpy and Python based
libraries by a factor of ~40.DocumentationInstallationIn ananacondaenvironment the library can
be installed by the following command:conda install -c tpeulen tttrlibAlternatively, you can use pip to installtttrlibpip install tttrlibUsageThe API of tttrlib as well as some use cases are documented on itsweb page.
Below you find a small selection of code snippets.Access photon data as follows:importtttrlibfn='photon_stream.ptu'data=tttrlib.TTTR(fn)macro_times=data.macro_timesmicro_times=data.micro_timesrouting_channels=data.routing_channelsPrint header-information:importtttrlibfn='photon_stream.ptu'data=tttrlib.TTTR(fn)print(data.json)Correlate photon streams:importtttrlibfn='photon_stream.ptu'data=tttrlib.TTTR(fn)correlator=tttrlib.Correlator(channels=([1],[2]),tttr=data)taus=correlator.x_axis,correlation_amplitude=correlator.correlationCreate intensity images from CLSM data:importtttrlibfn='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.intensitytttrlib is in active development. In case you notice unusual behaviour do not
hesitate to contact the authors.Supported file formatsPicoQuant (PQ)PicoHarp ptu, T2/T3HydraHarp ptu, T2/T3HydraHarp ht3, PTUBecker & Hickl (BH)spc132spc630 (256 & 4096 mode)Photon HDF5Design goalsLow memory footprint (keep objective large datasets, e.g., FLIM in memory).Platform independent C/C++ library with interfaces for scripting librariesBuilding and InstallationC++ shared libraryThe C++ shared library can be installed from source withcmake:git clone --recursive https://github.com/fluorescence-tools/tttrlib.gitmkdir tttrlib/build; cd tttrlib/buildcmake ..sudo make installOn Linux you can build and install a package instead:Python bindingsThe 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.gitcd tttrlibsudo python setup.py installIn ananacondaenvironment the library can
be installed by the following command:conda install -c tpeulen tttrlibFor 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 ofminiforgeis recommended.Legacy 32-bit platforms and versions of programming languages, e.g., Python 2.7
are not supported.LicenseCopyright 2007-2024 tttrlib developers.
Licensed under the BSD-3-Clause