tttrlib


Nametttrlib JSON
Version 0.24.3 PyPI version JSON
download
home_page
SummaryRead, write & process time-tagged time-resolved (TTTR) data.
upload_time2024-02-11 17:16:19
maintainer
docs_urlNone
author
requires_python>=3.8
license Copyright: 2018-2023 tttrlib developers. License: BSD-3-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords fluorescence time-resolved spectroscopy imaging microscopy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tttrlib
[![Anaconda-Server Badge](https://anaconda.org/tpeulen/tttrlib/badges/version.svg)](https://anaconda.org/tpeulen/tttrlib)
[![PyPI version](https://badge.fury.io/py/tttrlib.svg)](https://pypi.org/project/tttrlib/)
![conda build](https://github.com/fluorescence-tools/tttrlib/actions/workflows/conda-build.yml/badge.svg)


## 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 FLIM][3]

`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](https://www.anaconda.com/) environment the library can
be installed by the following command:

```console
conda install -c tpeulen tttrlib
```

Alternatively, you can use pip to install `tttrlib`

```console
pip install tttrlib
```

### Usage
The API of tttrlib as well as some use cases are documented on its [web page](https://docs.peulen.xyz/tttrlib).
Below you find a small selection of code snippets.

Access photon data as follows:
```python
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:
```python
import tttrlib
fn = 'photon_stream.ptu'
data = tttrlib.TTTR(fn)
print(data.json)
```

Correlate photon streams:
```python
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:
```python
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](https://cmake.org/):

```console
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:

```console
git clone --recursive https://github.com/fluorescence-tools/tttrlib.git
cd tttrlib
sudo python setup.py install
```

In an [anaconda](https://www.anaconda.com/) environment the library can
be installed by the following command:

```console
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](https://github.com/conda-forge/miniforge) 
is recommended.

Legacy 32-bit platforms and versions of programming languages, e.g., Python 2.7
are not supported.

## License

Copyright 2007-2024 tttrlib developers.
Licensed under the BSD-3-Clause

[3]: https://github.com/Fluorescence-Tools/tttrlib/blob/master/doc/logos/mashup.png?raw=true "tttrlib FLIM"

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tttrlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "fluorescence,time-resolved,spectroscopy,imaging,microscopy",
    "author": "",
    "author_email": "author = Thomas-Otavio Peulen <thomas.otavio.peulen@gmail.com>",
    "download_url": "",
    "platform": null,
    "description": "# tttrlib\r\n[![Anaconda-Server Badge](https://anaconda.org/tpeulen/tttrlib/badges/version.svg)](https://anaconda.org/tpeulen/tttrlib)\r\n[![PyPI version](https://badge.fury.io/py/tttrlib.svg)](https://pypi.org/project/tttrlib/)\r\n![conda build](https://github.com/fluorescence-tools/tttrlib/actions/workflows/conda-build.yml/badge.svg)\r\n\r\n\r\n## General description\r\ntttrlib is a file format agnostic high performance library to\r\nread, process, and write time-tagged-time resolved (TTTR) data acquired by\r\nPicoQuant (PQ) and Becker & Hickl measurement devices/cards or TTTR\r\nfiles in the open Photon-HDF format.\r\n\r\nThe library facilitates the work with files containing\r\ntime-tagged time resolved photon streams by providing\r\na vendor independent C++ application programming interface (API)\r\nfor TTTR files that is wrapped by SWIG (Simplified Wrapper and Interface\r\nGenerator) for common scripting languages as Python as target languages\r\nand non-scripting languages such as C# and Java including Octave,\r\nScilab and R. Currently, tttrlib is wrapped for the use in Python.\r\n\r\n* Multi-dimensional histograms\r\n* Correlation analysis\r\n* Time-window analysis\r\n* Photon distribution anaylsis\r\n* FLIM image generation and analysis\r\n\r\n![tttrlib FLIM][3]\r\n\r\n`tttrlib` is programmed in C++ and wrapped for python. Thus, it can be used to integrate time-resolved data into \r\nadvanced data analysis pipelines.\r\n\r\n### Capabilities\r\n\r\n* Fast reading TTTR files (IO limited)\r\n* Generation / analysis of fluorescence decays\r\n* Time window analysis\r\n* Correlation of time event traces\r\n* Filtering of time event traces to generate instrument response functions for fluorescence decays analysis without the need of independent measurements..\r\n* Fast photon distribution analysis\r\n* Fast selection of photons from a photon stream\r\n\r\nGeneration of fluorescence decay histograms tttrlib outperforms pure numpy and Python based\r\nlibraries by a factor of ~40.\r\n\r\n## Documentation\r\n\r\n### Installation\r\nIn an [anaconda](https://www.anaconda.com/) environment the library can\r\nbe installed by the following command:\r\n\r\n```console\r\nconda install -c tpeulen tttrlib\r\n```\r\n\r\nAlternatively, you can use pip to install `tttrlib`\r\n\r\n```console\r\npip install tttrlib\r\n```\r\n\r\n### Usage\r\nThe API of tttrlib as well as some use cases are documented on its [web page](https://docs.peulen.xyz/tttrlib).\r\nBelow you find a small selection of code snippets.\r\n\r\nAccess photon data as follows:\r\n```python\r\nimport tttrlib\r\nfn = 'photon_stream.ptu'\r\ndata = tttrlib.TTTR(fn)\r\n\r\nmacro_times = data.macro_times\r\nmicro_times = data.micro_times\r\nrouting_channels = data.routing_channels\r\n```\r\n\r\nPrint header-information:\r\n```python\r\nimport tttrlib\r\nfn = 'photon_stream.ptu'\r\ndata = tttrlib.TTTR(fn)\r\nprint(data.json)\r\n```\r\n\r\nCorrelate photon streams:\r\n```python\r\nimport tttrlib\r\nfn = 'photon_stream.ptu'\r\ndata = tttrlib.TTTR(fn)\r\ncorrelator = tttrlib.Correlator(\r\n    channels=([1], [2]),\r\n    tttr=data\r\n)\r\ntaus = correlator.x_axis,\r\ncorrelation_amplitude = correlator.correlation\r\n```\r\n\r\nCreate intensity images from CLSM data:\r\n```python\r\nimport tttrlib\r\nfn = 'image.ptu'\r\ndata = tttrlib.TTTR(fn)\r\nclsm = tttrlib.CLSM(data)\r\n\r\nchannels = [0, 1]\r\nprompt_range = [0, 16000]\r\nclsm.fill(channels=channels, micro_time_ranges=[prompt_range])\r\n\r\nintensity_image = clsm.intensity\r\n```\r\n\r\ntttrlib is in active development. In case you notice unusual behaviour do not\r\nhesitate to contact the authors.\r\n\r\n## Supported file formats\r\n\r\n### PicoQuant (PQ)\r\n* PicoHarp ptu, T2/T3\r\n* HydraHarp ptu, T2/T3\r\n* HydraHarp ht3, PTU\r\n\r\n### Becker & Hickl (BH)\r\n* spc132\r\n* spc630 (256 & 4096 mode)\r\n\r\n### Photon HDF5\r\n\r\n## Design goals\r\n* Low memory footprint (keep objective large datasets, e.g., FLIM in memory).\r\n* Platform independent C/C++ library with interfaces for scripting libraries\r\n\r\n## Building and Installation\r\n\r\n### C++ shared library\r\n\r\nThe C++ shared library can be installed from source with [cmake](https://cmake.org/):\r\n\r\n```console\r\ngit clone --recursive https://github.com/fluorescence-tools/tttrlib.git\r\nmkdir tttrlib/build; cd tttrlib/build\r\ncmake ..\r\nsudo make install\r\n```\r\n\r\nOn Linux you can build and install a package instead:\r\n\r\n### Python bindings\r\n\r\nThe Python bindings can be either be installed by downloading and compiling the source code or by using a\r\nprecompiled distribution for Python anaconda environment.\r\n\r\nThe following commands can be used to download and compile the source code:\r\n\r\n```console\r\ngit clone --recursive https://github.com/fluorescence-tools/tttrlib.git\r\ncd tttrlib\r\nsudo python setup.py install\r\n```\r\n\r\nIn an [anaconda](https://www.anaconda.com/) environment the library can\r\nbe installed by the following command:\r\n\r\n```console\r\nconda install -c tpeulen tttrlib\r\n```\r\n\r\nFor most users, the latter approach is recommended. Currently, pre-compiled\r\npackages for the anaconda distribution system are available for Windows (x86),\r\nLinux (x86, ARM64, PPCle), and macOS (x86). Precompiled libary are linked against \r\nconda-forge HDF5 & Boost. Thus, the use of [miniforge](https://github.com/conda-forge/miniforge) \r\nis recommended.\r\n\r\nLegacy 32-bit platforms and versions of programming languages, e.g., Python 2.7\r\nare not supported.\r\n\r\n## License\r\n\r\nCopyright 2007-2024 tttrlib developers.\r\nLicensed under the BSD-3-Clause\r\n\r\n[3]: https://github.com/Fluorescence-Tools/tttrlib/blob/master/doc/logos/mashup.png?raw=true \"tttrlib FLIM\"\r\n",
    "bugtrack_url": null,
    "license": " Copyright: 2018-2023 tttrlib developers. License: BSD-3-Clause  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "Read, write & process time-tagged time-resolved (TTTR) data.",
    "version": "0.24.3",
    "project_urls": {
        "documentation": "https://docs.peulen.xyz/tttrlib",
        "homepage": "https://github.com/fluorescence-tools/tttrlib",
        "repository": "https://github.com/fluorescence-tools/tttrlib.git"
    },
    "split_keywords": [
        "fluorescence",
        "time-resolved",
        "spectroscopy",
        "imaging",
        "microscopy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "27ae2204b4a60d938e6ae8866c231d9cd198fe98624df9f7fd1c3070dfe405ee",
                "md5": "3ae107992f7fd51891b47619487641da",
                "sha256": "8753dc94452e617c44ebacad665a540e56b44b6ab2cc047a93188faa2787dd4c"
            },
            "downloads": -1,
            "filename": "tttrlib-0.24.3-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "3ae107992f7fd51891b47619487641da",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 787261,
            "upload_time": "2024-02-11T17:16:19",
            "upload_time_iso_8601": "2024-02-11T17:16:19.717657Z",
            "url": "https://files.pythonhosted.org/packages/27/ae/2204b4a60d938e6ae8866c231d9cd198fe98624df9f7fd1c3070dfe405ee/tttrlib-0.24.3-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec7c6c533d4df94e69c6d59ceee39f0edcec87d803f2a0dbf4792ba6ca431a30",
                "md5": "dfcf33158a4a740a444b1c362b6182bd",
                "sha256": "9d20288e79b572e88831f9cefd615b018a1775306250bea3e9991745a7b11f2d"
            },
            "downloads": -1,
            "filename": "tttrlib-0.24.3-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "dfcf33158a4a740a444b1c362b6182bd",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 787457,
            "upload_time": "2024-02-11T17:16:22",
            "upload_time_iso_8601": "2024-02-11T17:16:22.031704Z",
            "url": "https://files.pythonhosted.org/packages/ec/7c/6c533d4df94e69c6d59ceee39f0edcec87d803f2a0dbf4792ba6ca431a30/tttrlib-0.24.3-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfd8f58ecd2d195b2e55cbab7c86ebe5f44159c671d78f502a9878e0d4b45dcd",
                "md5": "a784624cde3bb367dbef0a8136b8815a",
                "sha256": "58cceedae935e23278c943d9ee6f2cbbeb0577c48fba8953970ae9d2078aedf9"
            },
            "downloads": -1,
            "filename": "tttrlib-0.24.3-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "a784624cde3bb367dbef0a8136b8815a",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.8",
            "size": 788857,
            "upload_time": "2024-02-11T17:16:24",
            "upload_time_iso_8601": "2024-02-11T17:16:24.227857Z",
            "url": "https://files.pythonhosted.org/packages/df/d8/f58ecd2d195b2e55cbab7c86ebe5f44159c671d78f502a9878e0d4b45dcd/tttrlib-0.24.3-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee3ea6067ce7ac40753aeec8bc219321764313740d7c1ca1d587e83a1f0e7f53",
                "md5": "c59382854419e9599ef08572a1184101",
                "sha256": "e746c81b4e7310ce1a8206deb0ff0d98924f0a88cbb1c06edbcd89f83bd1b3c2"
            },
            "downloads": -1,
            "filename": "tttrlib-0.24.3-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "c59382854419e9599ef08572a1184101",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 786382,
            "upload_time": "2024-02-11T17:16:25",
            "upload_time_iso_8601": "2024-02-11T17:16:25.875049Z",
            "url": "https://files.pythonhosted.org/packages/ee/3e/a6067ce7ac40753aeec8bc219321764313740d7c1ca1d587e83a1f0e7f53/tttrlib-0.24.3-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8b760ae00bf87372e149b695c58a62466deb1fc8acd380cf299cdbe7e69101a",
                "md5": "a85855a24788155e15790374ef4c0ee1",
                "sha256": "ddc96eff94df0edbb6f19c03c2d086a14c76d76ee592cff3dc40d1930e8955ac"
            },
            "downloads": -1,
            "filename": "tttrlib-0.24.3-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "a85855a24788155e15790374ef4c0ee1",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 786281,
            "upload_time": "2024-02-11T17:16:28",
            "upload_time_iso_8601": "2024-02-11T17:16:28.073058Z",
            "url": "https://files.pythonhosted.org/packages/c8/b7/60ae00bf87372e149b695c58a62466deb1fc8acd380cf299cdbe7e69101a/tttrlib-0.24.3-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-11 17:16:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fluorescence-tools",
    "github_project": "tttrlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tttrlib"
}
        
Elapsed time: 3.08536s