---
# System prepended metadata

title: 'tttrlib: A library for time-tagged time-resolved fluorescence and image spectroscopy'
tags: [spectroscopy, Python, confocal imaging, single-molecule spectroscopy, fluorescence correlation spectroscopy, fluorescence]

---

---
title: 'tttrlib: A library for time-tagged time-resolved fluorescence and image spectroscopy'
tags:
 - Python
 - fluorescence
 - spectroscopy
 - confocal imaging
 - single-molecule spectroscopy
 - fluorescence correlation spectroscopy
authors:
 - name: Thomas-Otavio Peulen^[Custom footnotes for e.g. denoting who the corresponding author is can be included like this.]
   orcid: 0000-0001-8478-9755
   affiliation: 1
 - name: Andrej Sali
   affiliation: 1
affiliations:
   - name: Department of Bioengineering and Therapeutic Sciences, Department of Pharmaceutical Chemistry, California Institute for QuantitativeBiosciences, Byers Hall, 1700 4th Street, Suite 503B, University of California, San Francisco, San Francisco, CA 94158, USA
     index: 1

date: 6 April 2021
bibliography: paper.bib
---

# Summary

We present a library to read, write, and process time-tagged time-resolved (TTTR) 
data. The library can be used for time-resolved fluorescence spectroscopy 
experiments, such as time-resolved confocal single-molecule spectroscopy [@eggeling2001data], 
confocal laser scanning microscopy (CLSM) [@warren2013rapid; @kravets2016guanylate], 
STED microscopy [@hell1994breaking], and fluorescence correlation spectroscopy 
(FCS) [@bohmer2002time]. 
The library processes multiple vendor-specific TTTR file formats without the 
need to prior format conversion. This library can be used to develop analysis 
pipelines for fluorescence correlation spectroscopy, single-molecule spectroscopy, 
time-resolve laser scanning microscopy (aka fluorescence lifetime 
imaging, FLIM), and image correlation spectroscopy \autoref{fig:example}.


# Statement of need

There is a need for a library that processes original TTTR files of different types 
via a unified interface. Current, libraries are either vendor specific or require
the conversion to other file formats. 

For automated and custom data processing pipelines in imaging, single-molecule 
spectroscopy, and integrative modeling there is a need for a libray that (1) processes 
TTTR data without conversion, (2) offers a unified interface to information 
contained in TTTR files, and (3) can be integrated into 
various scripting languages for simple usage.

Here, we present the library `tttrlib` that: (1) reads, writes, and 
processing the most common file formats without conversion; (2) has a a simple 
common interface for the most used TTTR file formats; (3) is wrapped via 
Simplified Wrapper and Interface Generator (SWIG) for Python and can support 
multiple different scripting languages.
 

# Description

`tttrlib` is a C++ library that is wrapped for scripting languages without losing 
flexibility, ease-of-use, or speed.

The API for `tttrlib` was designed to provide a class-based, user-friendly interface
to information contained in a TTTR file that is independent of the file format.
Existing data processing software requires a conversion of the original data to 
an open format [@ingargiola2016photon] or is tightly integrated 
graphical user interfaces [@schrimpf2018pam]. Both aspects preclude
a custom automated analysis pipelines and a close integration of TTTR data 
into integrative modeling frameworks [@russel2012putting].

`tttrlib` provides the most common data processing algorithoms
used in fluorescence spectroscopy such as photon distribution analysis 
(PDA) [@antonik2006separating] and correlation algorithms for FCS [@wahl2003fast] 
that can be used for advanced FCS techniques such as full-, gated-, or 
filtered-FCS.

Moreover, as `tttrlib` can be used for CLSM TTTR data and implements reading 
routines for the most common CLSM microscopes (such as the Leica SP5/SP8). 
In `tttrlib` all parameters necessary for interpreting CLSM TTTR data can 
be user specified. Hence, `tttrlib` can be used to processs abitrary 
CLSM data.

Finally, `tttrlib` provides classes and methods for time-resolved 
image spectroscopy [@kravets2016guanylate] and image correlation 
spectroscopy (ICS) [@petersen1993quantitation]. 
Through image specroscopy on FRET labeled samples molecular distances 
on population within pixels of an image can be obtained. ICS informs
on mobility and number of molecular species.

`tttrlib` was designed to be used by researchers in the field of 
fluorescence spectroscopy, fluorescence microscopy, and integrative 
modeling [@russel2012putting]. The combination of speed, design, and 
support for NumPy/SciPy  and scikit-image `tttrlib` will enable
scientific explorations through the development of automated and custom tailored
data data analysis pipelines for expert developers and users alike.

# Figures

![Supported files and TTTR preprocessing steps.\label{fig:example}](figure.png){ width=100% }

# References

