Author: Steffen Ruettinger
Organization: PicoQuant GmbH, Berlin, Germany
This repository contains a small utility script to quickly visualize which FLIM channels were active in a PicoQuant PTU file and to explore time-delay (dtime) windows. It produces:
- A log-scale histogram of the PTU counts summed over channels.
- A grid of images: rows = selected dtime windows, columns = detector channels.
Script: plot_ptu_channel_windows.py
This repository contains experimental Python code originally developed for internal research purposes.
By using this code, you acknowledge and agree to the following:
- No Warranty – Provided “as is”, without express or implied warranties (including merchantability, fitness for a particular purpose, or non-infringement). Use at your own risk.
- Experimental Nature – Not fully tested, optimized, or production-ready. Intended for developers comfortable working with experimental software.
- Limited Support – No guarantee of active maintenance or timely responses to issues, bugs, or pull requests.
- Liability – The authors accept no responsibility for any loss or damage caused by the use of this code. You are responsible for ensuring it meets your needs and complies with applicable laws.
- Contributions – Contributions are welcome. All submissions will be subject to the same license and disclaimers as the original project.
- Load a PTU file via PtuFile (https://github.com/cgohlke/ptufile).
- Compute simple, evenly spaced dtime windows (configurable count).
- Sum frames and dtime-bins into a 2D image for each channel and window.
- Save publication-ready PNGs.
- Python 3.9+ (tested versions may vary)
- numpy
- matplotlib
- ptufile (provides PtuFile for PTU file handling) - https://github.com/cgohlke/ptufile
This script is based on PicoQuant and related PTU files, therefore it is necessary to install the following dependencies:
python -m pip install -U "ptufile[all]"Install all dependencies using pip:
pip install -r requirements.txtOr install them individually:
pip install numpy matplotlib ptufile- Place or reference your PTU file (e.g. RawImage.ptu). You can use https://nc.picoquant.com/index.php/s/DqQcgGGc7gbLbZ6 1 for example.
- Open plot_ptu_channel_windows.py and adjust:
- filename: path to the PTU file.
- N_WINDOWS: number of evenly spaced dtime windows.
- channel_ids: list of channel indices to visualize.
- Run the script:
python plot_ptu_channel_windows.py- ptu_histogram_log.png: log-scale histogram of counts summed over channels.
- channels_overview_grid.png: grid of images with rows = windows and columns = channels.
- Windowing: compute_windows_from_hist() currently splits the histogram range into N_WINDOWS equal-width windows. You can replace this with peak-based window detection if desired.
- Performance: The script decodes only the requested dtime window and integrates frames to keep memory usage manageable. Logging provides timing for decode and reduction steps.
Footnotes
-
GUVs with 2 Lipid-bindinding Fluorophores: Liz-Rhodamine PE and Atto488-DOPE - data courtesy of Viktorija Glembockyte (https://www.mr.mpg.de/14599619/single-molecule-sensing) ↩