FLIM phasor plotter

napari-flim-phasor-plotter

A plugin that performs phasor plot from TCSPC FLIM data.

License BSD-3 PyPI Python Version tests codecov napari hub

Napari-flim-phasor-plotter is a napari plugin to interactively load and show raw fluorescence lifetime imaging microscopy (FLIM) single images and series and generate phasor plots. These are Fourier transforms of the decay data being visualized using the napari-clusters-plotter plotter, adapted to suit the FLIM context. This allows qualitative and quantitative downstream analysis of FLIM images.


Usage

Open a FLIM image to visualize it both as a 'FLIM image series' being a sequence of intensity images each corresponding to an individual time point of the FLIM 'micro-time', plus as a timely summed up image. Scrolling through the FLIM time series provides a first glimpse of lifetimes across image regions.

Call the plugin from the menu Plugins > FLIM phasor plotter > Make FLIM Phasor Plot to generate a phasor plot by pixel-wise Fourier transformation of the decay data. Hereby, select the FLIM image to be used, specify the laser pulse frequency if not read properly from metadata. Define an intensity threshold to exclude pixels of low photon counts, optionally a median filter, and a harmonic for optimal visualization. Run creates the phasor plot and an additional labels layer in the layer list. Below is a demonstration:

Change the color-code of the phasor plot to a density plot of various ‘Colormaps’ from the pulldown Expand for advanced options and select HISTOGRAM. Manually encircle a region of interest in the phasor plot to highlight the corresponding pixels in the newly created image layer. Hold ‘Shift’ to select and visualize several clusters to investigate image regions of similar FLIM patterns.

Input Data

This plugin integrates with napari-clusters-plotter plugin.

This plugin can read the following FLIM file types:

  • ".ptu"
  • ".sdt"
  • ".tif"
  • ".zarr"

This plugin works with the following data shapes:

  • 2D FLIM images (actually 3D data where FLIM counts are in the first axis).
  • 3D FLIM images (actually 4D data where FLIM counts are in the first axis).
  • 3D timelapse FLIM images (actually 5D data where FLIM counts are in the first axis).
  • Multichannel '.tif' or '.zarr' data may need to be loaded separately.

The plugin outputs data axes in the following order (data from multiple detectors are displayed as distinct napari layers):

(flim_counts, time, z, y, x)

It also outputs the standard intensity image in another layer by summing the flim_counts dimension.

Data Conversion

If a collection of raw (uncompressed) images are larger than 4GB, we recommend converting them to .zarr. This can be done via Plugins > napari-flim-phasor-plotter > Convert to zarr.

Warning: In the current version, lazy loading with .zarr is available, but processing may still load all data into memory, so keep track of your memory usage.

If you have multiple slices or time-points as separated files, you can choose a folder containing the files. In order for the plugin to properly build a stack, the file names must contain some indication about which slice or time-point they represent, i.e., each file name should contain a _t and/or _z followerd by a number.

Here are a few example templates:

  • timelapse:
    • image_t001.ptu
    • image_t002.ptu
  • z-stack:
    • image_z01.sdt
    • image_z02.sdt
  • 3D timelapse:
    • image_t001_z001.tif
    • image_t001_z002.tif
    • ...
    • image_t002_z001.tif

Installation

You can install napari-flim-phasor-plotter via pip. Follow these steps from a terminal.

We recommend using mamba-forge whenever possible. Click here to choose the right download option for your OS. If you use mamba-forge, replace the conda term whenever you see it below with mamba.

Create a conda environment:

conda create -n napari-flim-phasor-env python=3.9

Activate the environment:

conda activate napari-flim-phasor-env

Then install napari and napari-clusturs-plotter (plus git if on Windows):

conda install -c conda-forge napari==0.4.17 napari-clusters-plotter git pyqt

Optional: we strongly recommend having the devbio-napari plugin bundle also installed for post-processing. This can be done with:

conda install -c conda-forge devbio-napari

Finally install napari-flim-phasor-plotter plugin with:

pip install napari-flim-phasor-plotter

Alternatively, clone this repository and install the latest plugin development version with:

pip install git+https://github.com/zoccoler/napari-flim-phasor-plotter.git

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-flim-phasor-plotter" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Version:

  • 0.0.6

Last updated:

  • 18 August 2023

First released:

  • 17 August 2023

License:

Supported data:

  • Information not submitted

GitHub activity:

  • Stars: 7
  • Forks: 1
  • Issues + PRs: 19

Python versions supported:

Operating system:

Requirements:

  • numpy
  • magicgui
  • qtpy
  • napari-clusters-plotter
  • sdtfile
  • natsort
  • rocket-fft
  • dask
  • zarr

Sign up to receive updates