https://github.com/cgohlke/sdtfile
Read Becker & Hickl SDT files.
https://github.com/cgohlke/sdtfile
fluorescence-lifetime-spectroscopy fluorescence-microscopy-imaging format-reader life-sciences-image photon-counting python
Last synced: 8 months ago
JSON representation
Read Becker & Hickl SDT files.
- Host: GitHub
- URL: https://github.com/cgohlke/sdtfile
- Owner: cgohlke
- License: bsd-3-clause
- Created: 2020-02-22T22:41:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-10T19:42:06.000Z (about 1 year ago)
- Last Synced: 2025-09-28T17:44:19.071Z (8 months ago)
- Topics: fluorescence-lifetime-spectroscopy, fluorescence-microscopy-imaging, format-reader, life-sciences-image, photon-counting, python
- Language: Python
- Homepage: https://pypi.org/project/sdtfile
- Size: 52.7 KB
- Stars: 13
- Watchers: 2
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
..
This file is generated by setup.py
Read Becker & Hickl SDT files
=============================
Sdtfile is a Python library to read SDT files produced by Becker & Hickl
SPCM software. SDT files contain time correlated single photon counting
instrumentation parameters and measurement data. Currently only the
"Setup & Data", "DLL Data", and "FCS Data" formats are supported.
`Becker & Hickl GmbH `_ is a manufacturer of
equipment for photon counting.
:Author: `Christoph Gohlke `_
:License: BSD-3-Clause
:Version: 2025.5.10
:DOI: `10.5281/zenodo.10125608 `_
Quickstart
----------
Install the sdtfile package and all dependencies from the
`Python Package Index `_::
python -m pip install -U sdtfile
See `Examples`_ for using the programming interface.
Source code and support are available on
`GitHub `_.
Requirements
------------
This revision was tested with the following requirements and dependencies
(other versions may work):
- `CPython `_ 3.10.11, 3.11.9, 3.12.10, 3.13.3 64-bit
- `NumPy `_ 2.2.5
Revisions
---------
2025.5.10
- Support Python 3.14.
2025.3.25
- Fix shape of data with routing channels.
- Drop support for Python 3.9, support Python 3.13.
2024.12.6
- Fix read MeasureInfo fields as scalars (breaking).
- Update some structure field names with BH reference (breaking).
- Parse some SetupBlock binary structures (#7).
- Include more information in str(SdtFile).
- Add subtype to FileRevision.
2024.11.24
- Update MEASURE_INFO_EXT struct to SPCM v.9.9 (breaking).
2024.5.24
- Fix docstring examples not correctly rendered on GitHub.
2024.4.24
- Support NumPy 2.
2023.9.28
- Update structs to SPCM v.9.66 (breaking).
- Shorten MEASURE_INFO struct to meas_desc_block_length.
2023.8.30
- …
Refer to the CHANGES file for older revisions.
References
----------
1. W Becker. The bh TCSPC Handbook. 9th Edition. Becker & Hickl GmbH 2021.
pp 879.
2. SPC_data_file_structure.h header file. Part of the Becker & Hickl
SPCM software installation.
Examples
--------
Read image and metadata from a "SPC Setup & Data File":
.. code-block:: python
>>> sdt = SdtFile('image.sdt')
>>> int(sdt.header.revision)
588
>>> sdt.info.id[1:-1]
'SPC Setup & Data File'
>>> int(sdt.measure_info[0].scan_x)
128
>>> len(sdt.data)
1
>>> sdt.data[0].shape
(128, 128, 256)
>>> sdt.times[0].shape
(256,)
Read data and metadata from a "SPC Setup & Data File" with multiple data sets:
.. code-block:: python
>>> sdt = SdtFile('fluorescein.sdt')
>>> len(sdt.data)
4
>>> sdt.data[3].shape
(1, 1024)
>>> sdt.times[3].shape
(1024,)
>>> int(sdt.setup.bh_bin_hdr['soft_rev'])
850
Read image data from a "SPC FCS Data File" as numpy array:
.. code-block:: python
>>> sdt = SdtFile('fcs.sdt')
>>> sdt.info.id[1:-1]
'SPC FCS Data File'
>>> len(sdt.data)
1
>>> sdt.data[0].shape
(512, 512, 256)
>>> sdt.times[0].shape
(256,)