Napari Phasors

A simple plugin to use phasor analysis

  • Bruno Pannunzio, Marcelo Leomil Zoccoler, Bruno Schuty, Leonel Malacrida

License BSD-3 PyPI Python Version tests codecov napari hub DOI

A comprehensive plugin for phasor analysis in napari. Based on the phasorpy library.

Jump to Intallation


Usage

napari-phasors is a comprehensive plugin that provides a complete workflow for phasor analysis in napari. It includes widgets for reading various FLIM and hyperspectral file formats, performing phasor analysis, calibration, component analysis, FRET analysis, filtering, manual selections, and exporting results.

Sample Data

Two sample datasets for FLIM are provided, along with their corresponding calibration images. Additionally, a paramecium image is included as sample data for hyperspectral analysis.

sample_data

Phasor Analysis

Plot FLIM Data

FLIM phasor data can be plotted as a 2D histogram or scatter plot in the "Phasor Plot" widget. The colormap, the number of bins and the scale of the colors can be customized.

phasors_flim

Plot Hyperspectral Data

Hyperspectral phasor data can also be plotted as a 2D histogram or scatter plot and visualized in the full universal circle. The 'Universal Semi-Circle/Full Polar Plot' in the "Plot Settings" tab must be unchecked.

phasors_hyperspectral

Phasor Calibration

FLIM images can be calibrated using a reference image acquired under the same experimental parameters in the "Calibration" tab of the "Phasor Plot" widget. This reference image should consist of a homogeneous solution of a fluorophore with a known fluorescence lifetime and the laser frequency used in the experiment. This ensures accuracy and consistency in lifetime measurements.

calibration

Filtering and Thresholding

Apply various filters and thresholds to your phasor data to enhance analysis quality in the "Filter/Threshold" tab on the "Phasor Plot" widget. You can filter phasor coordinates using the median or wavelet filter.

filter_threshold

Mask

You can create a mask using either a shapes layer or a labels layer in napari. Once the mask is created, select it from the mask combobox in the "Phasor Plot" widget. Only the pixels inside the selected mask will be plotted in the phasor space and included in subsequent analyses. This allows you to focus your analysis on specific regions of interest within your data.

mask

Copy Settings and Analysis

You can quickly copy plot settings and analysis parameters, such as calibration, frequency, filter settings, and component locations, from another layer or from an OME-TIF file previously exported with the napari-phasors plugin. This feature streamlines the workflow by allowing you to reuse established configurations, ensuring consistency and saving time when analyzing multiple datasets.

copy_settings

Manual Phasor Selections

Create manual selections on the phasor plot to identify specific regions of interest. These selections can be used to highlight corresponding pixels in the intensity image and perform targeted analysis. Shape of selection can be chosen at the top of the phasor plot and the selection ID can be selected in the "Selection" tab of the "Phasor Plot" widget.

selections

Component Analysis

Perform multi-component analysis to identify and separate different fluorescent species in your sample. This feature allows you to decompose complex phasor distributions into individual components with distinct lifetimes. Multi-component analysis can be done in the "Components" tab of the "Phasor Plot" widget, either by projection to a line between components (only two component analysis), or by component fitting 'n' number of components based on the available harmonics. For more than three component analysis, the location of the components in higher harmonics must be provided.

components

Apparent or Normal Lifetime Analysis

A FLIM image can be colormapped according to the phase or modulation apparent lifetime, as well as the normal lifetime in the "Lifetime" tab of the "Phasor Plot" widget. A histogram is also created for visualization of the distribution of apparent lifetimes of the FLIM image.

lifetimes

FRET Analysis

Analyze Förster Resonance Energy Transfer (FRET) trajectories and efficiencies in the "FRET" tab of the "Phasor Plot" widget. The lifetime of the donor and the location of the background in the phasor plot can be obtained automatically from another layer.

fret

Phasor Custom Import

Supported file formats (.tif, .ptu, .sdt, .fbd, .lsm, .ome.tif) can be imported and converted to phasor space using the "Phasor Custom Import" widget. Depending on the file format, you can specify additional options such as harmonics, channels, and frames. The signal can then be visualized according to the selected parameters for each file.

custom_import

Data Export

The average intensity image and phasor coordinates can be exported as OME-TIF files, which are compatible with both napari-phasors and PhasorPy. Alternatively, you can export the phasor coordinates and selections as a CSV file using the "Export Phasor" widget. Analysis results—such as lifetime, FRET efficiency, and component fractions—can also be exported to CSV. Additionally, the colormapped image layer can be exported with or without its associated colorbar.

export_phasors

Installation

You can install napari-phasors via pip. Follow these steps from a terminal.

We recommend using miniforge whenever possible. Click here to choose the right download option for your OS. If you do not use miniforge, but rather Anaconda or Miniconda, replace the mamba term whenever you see it below with conda.

Create a conda environment with napari by typing :

mamba create -y -n napari-phasors-env napari pyqt python=3.12

Activate the environment :

mamba activate napari-phasors-env

Install napari-phasors via pip :

pip install napari-phasors

Alternatively, install latest development version with :

pip install git+https://github.com/napari-phasors/napari-phasors.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-phasors" is free and open source software.

Please cite doi: https://doi.org/10.5281/zenodo.14647626 if napari-phasors contributes to a project that leads to a publication.

Issues

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

Version:

  • 0.3.0

Last updated:

  • 2025-12-15

First released:

  • 2024-11-22

License:

  • Copyright (c) 2024, Marcelo L....

Supported data:

  • Information not submitted

Save extension:

Python versions supported:

    Operating system:

    • Information not submitted

    Requirements:

    • phasorpy>=0.8
    • qtpy
    • scikit-image
    • biaplotter>=0.4.2
    • fbdfile
    • sdtfile
    • ptufile
    • tifffile
    • pandas
    • pyqt5
    • pawflim
    • tox; extra == "testing"
    • pytest; extra == "testing"
    • pytest-cov; extra == "testing"
    • pytest-qt; extra == "testing"
    • napari; extra == "testing"
    • qtpy; extra == "testing"
    • scikit-image; extra == "testing"
    • biaplotter>=0.4.2; extra == "testing"
    • PyQt5; extra == "testing"
    • pandas; extra == "testing"
    • black; extra == "testing"
    • isort; extra == "testing"
    • phasorpy>=0.8; extra == "testing"
    • tifffile; extra == "testing"
    • fbdfile; extra == "testing"
    • sdtfile; extra == "testing"
    • ptufile; extra == "testing"
    • pawflim; extra == "testing"
    Website by the napari team, original design by CZI. Go to napari main website.