-
PDF
- Split View
-
Views
-
Cite
Cite
Alexander Vallmitjana, Belén Torrado, Amanda F Durkin, Alexander Dvornikov, Navid Rajil, Suman Ranjit, Mihaela Balu, GSLab: open-source platform for advanced phasor analysis in fluorescence microscopy, Bioinformatics, Volume 41, Issue 4, April 2025, btaf162, https://doi.org/10.1093/bioinformatics/btaf162
- Share Icon Share
Abstract
GSLab addresses the need for effective image analysis tools in fluorescence microscopy by providing an open-source platform that enhances traditional phasor analysis with advanced features. Key capabilities include machine learning-based clustering, real-time monitoring, and quantitative unmixing of fluorescent species. Designed for both commercial and custom systems, GSLab provides researchers with comprehensive lifetime and spectral phasor image analysis tools to tackle complex biological problems.
The software is written as a MATLAB app. It is available for download at: https://doi.org/10.6084/m9.figshare.27921966. Example files and tutorials are also available: https://doi.org/10.6084/m9.figshare.28067108. For developers who wish to contribute please use: https://github.com/AlexVallmitjana/GSLab. A compiled Windows installer (does not require MATLAB) is available at: https://doi.org/10.6084/m9.figshare.28655276.
1 Introduction
Fluorescence lifetime microscopy (FLIM) is a powerful imaging technique that provides quantitative information about the local environment and molecular interactions of fluorophores within biological tissues or other materials. By measuring how long a fluorescent molecule remains in an excited state before emitting a photon, FLIM offers a new dimension for biological imaging, which, combined with spectral imaging, enables researchers to investigate complex cellular processes and interactions. The integration of advanced analytical methods, such as the phasor approach, enables more sophisticated image analysis and interpretation. As a result, this will further enhance the capabilities of FLIM and spectral microscopy.
The basis of phasor analysis lies in using the phasor transform to map every pixel of an image onto a two-dimensional space known as phasor space, based on the photon distribution within that pixel across the fluorescence lifetime or spectral dimensions (Digman et al. 2008, Fereidouni et al. 2012). The position of each pixel in phasor space is determined by the shape of the photon distribution and is independent of the signal’s intensity. Analysis by means of the phasor representation does not require prior knowledge of the nature of the sample nor fitting of a model. In addition, utilization of the Fast Fourier Transform algorithm enables rapid computation. This analysis simplifies visual inspection and identification of distinct populations of pixels, which can subsequently be mapped back to the original fluorescence image (or set of images) (Ranjit et al. 2018). Furthermore, the mathematical properties of the phasor transform enable researchers to understand the phenomena occurring in the sample by observing changes in the photon distribution represented in phasor space. A brief overview of the mathematics behind the phasor approach for analyzing FLIM images is available in Section 2.
Phasor analysis is widely used in the biophysics and bioimaging fields and has led to a vast number of quantification methods and applications. These include studying cellular metabolic states (Stringari et al. 2011), molecular interactions (Guaglianone et al. 2022), molecular dynamics (Rossetta 2023), drug delivery (Jeong et al. 2020), chromatin compaction (Pelicci et al. 2019), sensing local polarity (Malacrida and Gratton 2018), ion concentration (Celli et al. 2010), pH (Rennick et al. 2022), enhancing superresolution (Lanzanò et al. 2015), and multiplexed imaging (Yao et al. 2022).
For over a decade, the scientific community has primarily relied on Globals for Images SimFCS software developed by Prof. Enrico Gratton for phasor analysis (https://lfd.uci.edu/globals). However, maintenance and updates for this software were discontinued in 2021, prompting developers to create alternative phasor analysis tools. While several research laboratories have developed custom tools to address specific challenges (Schrimpf et al. 2018, Castello et al. 2019, Gao et al. 2020, Bernardi and Cardarelli 2023, Gottlieb et al. 2023, Tan et al. 2023, Zoccoler et al. 2024), notably https://www.phasorpy.org, and commercial brands such as Leica, PicoQuant, Becker and Hickl, FLIM Labs, and ISS have incorporated phasor analysis into their software suites, there are few reports on open-source software solutions. Existing platforms, based on Python [PhasorPy, FLUTE (Gottlieb et al. 2023), Phasor Identifier (Bernardi and Cardarelli 2023), FLIMPA (Kapsiani et al. 2024)], Java [FLIMJ (Gao et al. 2020)], or MATLAB [PAM (Schrimpf et al. 2018)], have successfully incorporated traditional phasor analysis techniques, such as intensity thresholding, image filtering, color-mapping, and cursor analysis (manual clustering). Despite these developments, recent advances in machine learning-clustering for image segmentation (Vallmitjana et al. 2020) and unmixing of fluorescent species present in the same pixel via higher harmonics (Vallmitjana et al. 2021), are not yet available in open-source formats.
To address this gap, our team has developed GSLab, a pioneering, open-source software platform designed to provide researchers with a comprehensive set of tools for advanced lifetime and spectral phasor image analysis. GSLab includes essential functionalities, such as calibration and traditional phasor analysis techniques, including real-time monitoring of both image and phasor space by using cursors. Additionally, GSLab introduces two unique advanced capabilities: (i) machine learning-based clustering for automated image segmentation using the phasor space, and (ii) quantitative unmixing of multiple fluorescent species from a single pixel, compatible with any imaging system, whether commercial or custom-built.
2 Materials and methods
2.1 Phasor analysis for fluorescence lifetime and hyperspectral microscopy
2.2 GSLab capabilities
2.2.1 Input/Output
2.2.1.1 Image formats
We developed our software for the analysis of lifetime and spectral images, initially designed for our home-built FLAME microscope operated by ScanImage (MBF Bioscience). Since then, we have expanded its functionality to support a variety of file formats for FLIM and Spectral data, including generic (.tif) image sequences, simple decay/spectral traces (.txt/.csv), and images generated by commercial microscopes such as Leica-Falcon LAS X (S and G phasor exports), PicoQuant (.ptu), Becker and Hickl (.std), FLIM LABS (.json), and hyperspectral images from Zeiss ZEN (.lsm). Additionally, we have integrated support for the ref file format, enabling the saving of image phasor coordinates in multiple harmonics, adding compatibility with legacy SimFCS.
2.2.1.2 Data export
GSLab has flexibility to export phasor plots, phasor-colored images and spreadsheets of computed values in different formats. Intensity images can be rendered using a logarithmic intensity scale. A pseudo-high dynamic range routine is implemented to compute the local dynamic range for each pixel, enabling the export of images with an extended dynamic range. Raw grayscale images can be exported or color-coded in various ways: based on cursor positions, phasor coordinates, or the results of clustering or unmixing algorithms. Colors can be applied to the image space using two methods: hard masking, which assigns a solid color to each pixel and soft masking, which creates an intensity-weighted color image. Additionally, built-in options for exporting phasor plots are available, such as the ability to adjust the binning resolution of phasor space histogram and choose between the linear or logarithmic phasor plot representation. Phasor distributions can be normalized to each loaded file to represent multiple files at the same time. Users can select different colormaps to depict the phasor density representations and for phasor measurement images. Contour lines can also be added to the phasor plots.
2.2.2 Basic analysis
2.2.2.1 Calibration
To ensure accurate calibration and referencing of phasor coordinates, GSLab allows any loaded file to serve as a calibration sample (e.g. a measurement of a fluorophore solution with a known single-exponential lifetime). The user can select the calibration files and input the corresponding lifetime values, enabling the software to compute the correction phase shift and modulation factor. Additionally, each calibration file can be tagged with a file name to identify specific detectors and/or spectral channels in the instrument. This functionality allows multiple files to be loaded, with the flexibility to apply a unique calibration to each. The software also includes a manual coarse calibration where the user can simply enter the phase shift and modulation factor instead of using loaded files.
2.2.2.2 Quantification
Phase and modulation are classical parameters for characterizing fluorescence lifetime in the frequency domain (Torrado et al. 2024). They have a direct representation on the phasor plot and are used as a way to render lifetime images. Researchers report tau-phase or tau-modulation images or a combination of both, which correspond to the lifetime associated with a measurement based on phase difference or modulation factor of the fluorescence signal with respect to the excitation signal (see Fig. 1). We implement a color-coded gradient representation of these parameters, allowing users to assign each pixel a specific lifetime value and export color-coded images depending on the assigned lifetime values. The software also allows the use of custom projections on the universal circle, by setting the coordinates of the origin and selecting if projecting either radially or angularly, which would be a generalization for lifetime measurements.

Interpretation of the phasor transform and associated lifetime measurement. The temporal decay (or spectral emission) in each pixel yields a set of coordinates G and S given by the integral of the product by the trigonometric functions. Right-most panel depicts the geometrical interpretation of the lifetime associated to the measurement, namely tau-phase, -modulation and -normalized.
2.2.2.3 Image manipulation
Inspired by SimFCS, our software can perform multi-image phasor analysis, enabling users to load any number of images and display them in one panel while viewing their corresponding phasor distribution in another, allowing for real time interaction between the image and phasor spaces. Users can select or deselect files from the set to display the phasor or to use the phasor transform data with the other available tools. Additionally, the dynamic range of the intensity image can be adjusted to enhance certain regions.
2.2.2.4 Image masking
Phasor representation with image masking via thresholding involves selecting pixels in the image space based on their intensity to represent them on the phasor space. This functionality allows users to select or remove very bright populations or very dim/noisy pixels, which may be disguising relevant information. In combination with the previous methods, it allows users to create an image mask which can be used to exclude specific regions from analysis. Additionally, users can load image masks created in other software to pre-segment the images for phasor analysis.
2.2.2.5 Phasor filtering
We have included various options to facilitate phasor analysis, including phasor filtering. Users can define a kernel size and the number of times the filter needs to be applied. The kernel is convolved over the phasor space coordinates to generate the density histogram. Additionally, users can set the resolution of the phasor space, along with the harmonic number of the phasor transform. The filtering is performed for all harmonics simultaneously.
2.2.2.6 Cursor analysis
Traditional cursor analysis can be seen as manual clustering in the phasor space. GSLab implements this by allowing users to point and click to create circles (cursors) of any size on the phasor space and assign colors to these cursors. The software highlights the pixels in the image space whose phasor coordinates fall within the cursors based on the assigned color of these cursors. We have implemented these capabilities inspired by SimFCS with improvements toward ease of use.
2.2.3 Advanced analysis
2.2.3.1 Inspection mode
GSLab has a real-time built in functionality that makes use of the phasor reciprocity principle (Ranjit et al. 2018) for image content exploration. The reciprocity principle connects the phasor space to the image space, allowing the selection of a set of coordinates in one space to be highlighted in the other. The cursor analysis described above uses one direction of this reciprocity principle; however, it does not operate in real time. GSLab implements an inspection mode allowing users to hover the mouse over the image space to see the corresponding pixels in the phasor space in real time, and vice versa, hover the mouse over the phasor space to see where the pixels fall on the image space. Multiple images can be loaded simultaneously which may carry some computational burden. The software addresses this by down sampling the loaded images thus reducing the computation time for all other functionalities. When exporting data, users can select between a fast, low-resolution version using the down-sampled images or a high-resolution version based on the original dimensions of the images. Users can also adjust the level of down-sampling as needed.
2.2.3.2 Clustering in the phasor space
Gaussian mixture models (GMMs) are the preferred machine learning algorithm for automated clustering of populations in the phasor space (Vallmitjana et al. 2021). The automatic selection of populations enables segmentation of structures in the image space based on their phasor signatures, facilitating further analysis. We have implemented the GMM algorithm, allowing users to train a model using a dataset and apply it to other datasets. Users can define initial cluster points and assign colors for exporting segmented images based on the probability of assignment to each cluster, as determined by the model’s posterior. This process serves as an automated and enhanced version of the cursor analysis described above, offering several key advantages: (i) it yields the same parameters as manual cursor analysis, such as the mean coordinates and size of each cluster; (ii) it adjusts for the cluster covariance matrix, describing the clusters as ellipsoids; and (iii) it is fully automated, ensuring reproducibility and eliminating bias.
2.2.3.3 Phasor unmixing
Phasor unmixing in lifetime imaging is a method that allows users to compute the photon fraction for each individual species contributing to the fluorescence in a pixel (Vallmitjana et al. 2020). Similar to phasor analysis, phasor unmixing is model-free. The user needs to input only the lifetime values of the components for unmixing. We have implemented the computation and representation of N-harmonics, allowing users to perform phasor unmixing for up to 2N+1 components. Users define a set of pure components, assign a lifetime value to each of them and solve the unmixing at each pixel. Component fractions can be exported in spreadsheets and unmixed images can be generated, both as independent fractions and as component color-coded images. Additionally, component ratio-metric images can be generated. Furthermore, users can take empirical measurements and select them as pure components, which is particularly useful for unmixing spectral components.
3 Results
GSLab is developed in MATLAB. It offers robust computational and visualization capabilities, allowing researchers to enhance their phasor analysis workflows effectively. GSLab compiles these tools into a user-friendly program, featuring a graphical user interface that simplifies complex analyses. MATLAB’s extensive library of built-in functions facilitates rapid development, enabling users to tailor GSLab to their specific research needs. While a MATLAB license by Mathworks Inc. may be a barrier for some, the widespread availability in academia ensures that most researchers can benefit from the advanced functionalities of GSLab. We have uploaded GSLab in a public repository under MIT license (https://doi.org/10.6084/m9.figshare.27921966).
Figure 2 provides an overview of GSLab’ capabilities. It highlights its key features across three main areas: Input/Output, Basic Analysis, and Advance Analysis. The Input/Output section illustrates the software’s compatibility with all major image formats for lifetime and spectral data, along with its export options for phasor plots and color-coded intensity images. The Basic Analysis section illustrates the commonly available tools such as cursor analysis, phasor filtering and image manipulation, enabling users to interact with and process the data efficiently. The current open-source solutions allow for the implementation of a subset of these analysis tools. The Advanced Analysis section emphasizes the software’s powerful functions for unmixing multiple fluorescence components, machine learning-based clustering, and real-time examination of the reciprocity between image and phasor space, demonstrating its robust analytical capabilities. A more detailed description of GSLab’ capabilities is available in the Section 2.

GSLab capability overview. (1) Input/Output: Supports major image formats for lifetime and spectral data. Allows exporting of phasor plots and color-coded intensity images based on phasor coordinates, component unmixing, or clustering results, with various styling options for both phasor plots and images. (2) Basic Analysis: Offers cursor analysis, phasor filtering, image manipulation, and the ability to create or load masks. Users can measure pixel phasor coordinates and create color gradients on the phasor space, generate lifetime and spectral images based on the color gradients, and calibrate the data using reference files. (3) Advanced Analysis: Enables unmixing of multiple fluorescence components, machine learning-based clustering of phasor distributions, and real time inspection of the reciprocity between image and phasor space. Icons are open-source from fontawesome.io.
Figure 3 illustrates the advanced capabilities of phasor analysis for automated machine learning, clustering, and unmixing of fluorescent components. We demonstrate these capabilities by analyzing two sets of data. First, label-free FLIM images of a fresh human skin specimen (discarded tissue from surgery), acquired with a custom-built clinical multiphoton microscopy device (Fast et al. 2020) are used to demonstrate automated clustering and image segmentation (Fig. 3A–D). Second, time-resolved fluorescence images of labeled cell cultures, obtained using another custom-built FLIM-based multiphoton microscope for thick tissue imaging (Dvornikov et al. 2019) are used to demonstrate unmixing of fluorescent components (Fig. 3E–H).

Advanced phasor analysis: Automated machine learning clustering of phasor distributions and fluorescent component unmixing. (A) Intensity obtained through time-resolved two-photon excited fluorescence signal detection from a human skin specimen. (B) Corresponding fluorescence lifetime phasor plot with gradient color distribution representing tau-phase values. The plot demonstrates automated machine learning clustering into four populations with ellipses outlining 88% of pixels within each Gaussian component. (C) The intensity image from (A) shown as color-coded lifetime image, based on tau-phase values from the phasor plot. (D) The intensity image from (A) displayed as color-coded image highlighting the four populations identified through automatic clustering. These populations correspond to known skin structures: keratin in epidermal keratinocytes (green), melanin in pigmented keratinocytes (red), elastin in the dermis (blue), and other structures characterized by a mixed fluorescence lifetime distribution, representing a linear combination of the other three clusters. (E) Intensity images obtained through time-resolved two-photon excitation signal detection from five cell cultures: four of them stained independently with one of the nuclear dyes Ethidium Bromide, Acridine Orange, NucBlue, and Rose Bengal, and the fifth with a mixture of all four dyes. (F) Corresponding fluorescence lifetime phasor plot with gradient color distribution representing tau-modulation values. The plot shows the fluorescence lifetime signatures for each dye and the signature of the mixed sample as an elongated distribution in the center. The theoretical lifetime of the four dyes is used to compute the coordinates for each of the four components, depicted by the vertices of a quadrilateral. Inset displays the same data in the 2nd harmonic required for the fluorescent component unmixing. (G) Intensity images from (E) shown as color-coded lifetime images, based on tau-modulation values from the phasor plot. (H) Results of fluorescent component unmixing: H1–H4. Unmixed photon fraction images for each component (rows) and each measurement (columns). Inset violin plots illustrate pixel value distribution for each image. (H5) Merged images for each measurement using linear addition of panels (H1–H4).
Phasor analysis of the skin specimen’s FLIM image (Fig. 3B) shows automated machine-learning-based clustering into four populations, which are subsequently illustrated in the corresponding color-coded FLIM image revealing well-known skin structures. Phasor analysis of the fluorescence images of stained cell cultures highlights the ability to unmix four fluorescent components by clearly resolving the fluorescence lifetime signatures of the dyes and computing the pixel fractions of the components in the mixed sample. These examples demonstrate the powerful advanced capabilities of GSLab for resolving complex fluorescence signatures within a single sample.
In conclusion, GSLab represents a significant advancement over the current state of the art, offering enhanced functionality, improved accuracy, and greater flexibility for researchers in the field. With the introduction of two unique features—phasor unmixing using higher harmonics and automated phasor clustering through GMMs—this software pushes the boundaries of what is possible in phasor-based analysis. These innovative capabilities not only enable more precise interpretation of complex data but also streamline the analysis process, making it more robust, efficient and accessible. While the software does not currently support all possible file formats, its open-source nature allows for continuous development, enabling the community to expand its compatibility in the future. By addressing key limitations in existing tools, this software provides researchers with a powerful and comprehensive platform for both routine and advanced phasor analysis tasks, paving the way for future developments in this area.
Acknowledgements
We wish to recognize the impactful career of Prof. Enrico Gratton, whose contributions have significantly influenced our work.
Author contributions
Alexander Vallmitjana (Conceptualization [equal], Data curation [lead], Formal analysis [lead], Investigation [supporting], Methodology [lead], Software [lead], Supervision [supporting], Validation [equal], Visualization [lead], Writing—original draft [lead], Writing—review & editing [equal]), Belén Torrado (Investigation [lead], Methodology [supporting], Resources [supporting], Validation [equal], Visualization [supporting], Writing—review & editing [supporting]), Amanda F. Durkin (Investigation [equal], Resources [equal], Writing—review & editing [supporting]), Alexander Dvornikov (Investigation [equal], Resources [equal], Writing—review & editing [supporting]), Navid Rajil (Investigation [equal], Resources [equal], Writing—review & editing [equal]), Suman Ranjit (Conceptualization [equal], Investigation [supporting], Methodology [supporting], Resources [supporting], Validation [equal], Visualization [supporting], Writing—review & editing [supporting]), and Mihaela Balu (Conceptualization [equal], Funding acquisition [lead], Project administration [lead], Resources [lead], Supervision [lead], Visualization [supporting], Writing—original draft [supporting], Writing—review & editing [lead]).
Conflict of Interest
M.B. is a coauthor of a patent owned by the University of California, Irvine (UCI) related to the development of clinical multiphoton microscopy (MPM) technology. Additionally, M.B. is a cofounder of Infraderm, LLC, a startup spin-off from UCI focused on commercializing clinical MPM imaging platforms that may benefit from the use of advanced analysis tools. The Institutional Review Board and Conflict of Interest Office of UCI have reviewed patent disclosures and found no concerns.
Funding
This work was supported by the National Institute of Biomedical Imaging and Bioengineering [R01EB026705]; National Institute of Arthritis and Musculoskeletal and Skin Diseases [R21AR082648]; National Cancer Institute [R01CA259019]; and the Department of Defense [HT94252311027]. Additionally, we acknowledge the Skin Biology Resource-Based Center at the University of California, Irvine [P30AR075047]. This work was conducted by the Nonlinear Optical Microscopy Lab, which is part of the Optical Biology Core Facility, a shared resource supported by the Chao Family Comprehensive Cancer Center [P30CA062203] at the University of California, Irvine.
Data availability
The data underlying this article are available in public repository Figshare: https://doi.org/10.6084/m9.figshare.28067108.