<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="other" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.24006.1</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Software Tool Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>
                    <italic>flimview</italic> : A software framework to handle, visualize and analyze FLIM data</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 1; peer review: 1 approved, 1 approved with reservations]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Carrasco Kind</surname>
                        <given-names>Matias</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Visualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Zurauskas</surname>
                        <given-names>Mantas</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Alex</surname>
                        <given-names>Aneesh</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Project Administration</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a4">4</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Marjanovic</surname>
                        <given-names>Marina</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a3">3</xref>
                    <xref ref-type="aff" rid="a5">5</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Mukherjee</surname>
                        <given-names>Prabuddha</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Review &amp; Editing</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Doan</surname>
                        <given-names>Minh</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <xref ref-type="aff" rid="a4">4</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Spillman Jr.</surname>
                        <given-names>Darold R.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Resources</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a3">3</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Hood</surname>
                        <given-names>Steve</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a7">7</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Boppart</surname>
                        <given-names>Stephen A.</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-9386-5630</uri>
                    <xref ref-type="aff" rid="a2">2</xref>
                    <xref ref-type="aff" rid="a3">3</xref>
                    <xref ref-type="aff" rid="a5">5</xref>
                    <xref ref-type="aff" rid="a6">6</xref>
                    <xref ref-type="aff" rid="a8">8</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>National Center for Supercomputing Applications, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
                <aff id="a2">
                    <label>2</label>GSK Center for Optical Molecular Imaging, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
                <aff id="a3">
                    <label>3</label>Beckman Institute for Advanced Science and Technology, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
                <aff id="a4">
                    <label>4</label>GlaxoSmithKline, Collegeville, PA, USA</aff>
                <aff id="a5">
                    <label>5</label>Department of Bioengineering, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
                <aff id="a6">
                    <label>6</label>Carle Illinois College of Medicine, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
                <aff id="a7">
                    <label>7</label>GlaxoSmithKline, Stevenage, UK</aff>
                <aff id="a8">
                    <label>8</label>Department of Electrical and Computer Engineering, University of Illinois at Urbana-Champaign, Urbana, IL, 61801, USA</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:mcarras2@illinois.edu">mcarras2@illinois.edu</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>S.A.B receives research grant support from GlaxoSmithKline related to the research described here, and reports receiving consulting fees from and owning equity interest in PhotoniCare, Inc., Diagnostic Photonics, Inc. and LiveBx, LLC. A.A., M.D. and S.H. are employees and shareholders of GlaxoSmithKline. M.Z, M.M., P.M., D.R.S. declare no potential conflict of interest.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>8</day>
                <month>6</month>
                <year>2020</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2020</year>
            </pub-date>
            <volume>9</volume>
            <elocation-id>574</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>1</day>
                    <month>6</month>
                    <year>2020</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Carrasco Kind M et al.</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/9-574/pdf"/>
            <abstract>
                <p>
                    <monospace>flimview</monospace> is a bio-imaging Python software package to read, explore, manage and visualize Fluorescence-Lifetime Imaging Microscopy (FLIM) images. It can open the standard FLIM data file conventions (e.g., sdt and ptu) and processes them from the raw format to a more readable and manageable binned and fitted format. It allows customized kernels for binning the data as well as user defined masking operations for pre-processing the images. It also allows customized fluorescence decay fitting functions and preserves all of the metadata generated for provenance and reproducibility. Outcomes from the analysis are lossless compressed and stored in an efficient way providing the necessary open-source tools to access and explore the data. 
                    <monospace>flimview</monospace> is open source and includes example data, example 
                    <ext-link ext-link-type="uri" xlink:href="https://Jupyter.org/">Jupyter</ext-link> notebooks and tutorial documentation. The package, test data and documentation are available on 
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/mgckind/filmview">Github</ext-link>
                </p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>FLIM</kwd>
                <kwd>bio-imaging</kwd>
                <kwd>microscopy</kwd>
                <kwd>visualization</kwd>
                <kwd>fluorescence</kwd>
                <kwd>Python</kwd>
            </kwd-group>
            <funding-group>
                <award-group id="fund-1">
                    <funding-source>GlaxoSmithKline</funding-source>
                </award-group>
                <funding-statement>The work presented here was funded by GlaxoSmithKline.</funding-statement>
                <funding-statement>
                    <italic>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</italic>
                </funding-statement>
            </funding-group>
        </article-meta>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>Fluorescence lifetime imaging microscopy (FLIM) is an imaging technique where the image contrast is derived from the differences in the exponential decay rate of the fluorescence from a fluorescent sample (
                <xref ref-type="bibr" rid="ref-6">Bower 
                    <italic toggle="yes">et al.</italic>, 2018</xref>).</p>
            <p>In modern two-photon FLIM, the most widely used detection method is known as time-correlated single-photon counting (TCSPC) (
                <xref ref-type="bibr" rid="ref-3">Becker 
                    <italic toggle="yes">et al.</italic>, 2004</xref>). TCPC employs a pulsed excitation source, such as a laser or a light emitting diode and measures the timing of arrival of single photons originating from the fluorescent sample on a detector to reconstruct the fluorescence lifetime decay (
                <xref ref-type="bibr" rid="ref-13">McGinty 
                    <italic toggle="yes">et al.</italic>, 2016</xref>). Typically, different fluorophores can be characterized by their fluorescence lifetimes. Furthermore, fluorescence lifetimes of a fluorophore can be affected by its environment, therefore FLIM have emerged as a valuable tool, providing unique contrast mechanisms for biomedical imaging (
                <xref ref-type="bibr" rid="ref-8">Bower 
                    <italic toggle="yes">et al.</italic>, 2019</xref>; 
                <xref ref-type="bibr" rid="ref-11">Hirvonen &amp; Suhling, 2016</xref>; 
                <xref ref-type="bibr" rid="ref-14">Ranawat 
                    <italic toggle="yes">et al.</italic>, 2019</xref>).</p>
            <p>To reconstruct TCSPC based FLIM image, several non-trivial data processing steps are necessary. For extracting the lifetime and amplitude data from initially saved raw files, first the data has to be imported from proprietary files such as Becker and Hickl 
                <monospace>.sdt</monospace>, or PicoQuant 
                <monospace>.ptu</monospace>. Next, signal preprocessing through denoising or binning has to be applied to ensure robust performance in low photon count scenarios. Finally, after compensating for instrument response function, biexponential decay curves are fitted to extract lifetime and amplitude values for two dominant components at each pixel.</p>
            <p>Several commercial and open source packages are already available for FLIM analysis (
                <xref ref-type="bibr" rid="ref-4">Bergmann, 2003</xref>; 
                <xref ref-type="bibr" rid="ref-10">Fli</xref>; 
                <xref ref-type="bibr" rid="ref-16">Warren 
                    <italic toggle="yes">et al.</italic>, 2013</xref>). However, in practice, when custom FLIM analysis capabilities are required, this can lead to a need for building complicated signal processing and analysis pipelines (
                <xref ref-type="bibr" rid="ref-5">Borhani 
                    <italic toggle="yes">et al.</italic>, 2019</xref>; 
                <xref ref-type="bibr" rid="ref-7">Bower 
                    <italic toggle="yes">et al.</italic>, 2017</xref>; 
                <xref ref-type="bibr" rid="ref-9">Cao 
                    <italic toggle="yes">et al.</italic>, 2020</xref>), involving a mix of commercial tools, open-source software and bespoke analysis algorithms. While other packages have been published, (
                <xref ref-type="bibr" rid="ref-2">Ballesteros 
                    <italic toggle="yes">et al.</italic>, 2019</xref>), we expect that 
                <monospace>flimview</monospace>, with its focus on simplicity, and versatility, will serve as a useful tool for the FLIM community which can also contribute to its growth.</p>
            <p>Here we present a Python package, 
                <monospace>flimview</monospace>, which provides a user-friendly toolkit for opening, fitting and visualizing FLIM data. The package can be used as a stand-alone tool for analyzing and visualizing FLIM data, or it can be used as a basis for creating end-to-end streamlined analytical pipelines in Python.</p>
        </sec>
        <sec sec-type="methods">
            <title>Methods</title>
            <sec>
                <title>Implementation</title>
                <p>
                    <monospace>flimview</monospace> is a library module implemented in Python 3 and can be installed using PyPI (e.g., 
                    <monospace>pip install flimview</monospace>). Installation instructions using Conda are also included within the repository. A complete list of requirements can be found at the package Github page but include standard Python libraries such as 
                    <monospace>pandas, scipy, matplotlib, h5py</monospace>, etc. The code is released under the open-source NCSA license which is based on the MIT open source license, allowing full and free use for both commercial and non-commercial purposes. Full usage documentation, Jupyter notebooks (web-browser interface that allows live Python codes), test data and others, including guidelines for contributions and issue reporting, are included in the project repository. This package has been tried in Windows, Mac OS and Linux Operating Systems. In general 
                    <monospace>flimview</monospace> works better in the latter two for which it is also expected to get supported development.</p>
            </sec>
            <sec>
                <title>Operation</title>
                <p>
                    <monospace>flimview</monospace> consists of several utility libraries for storage, visualization and manipulation of FLIM data. After reading and processing the raw data (
                    <monospace>.ptu</monospace> or 
                    <monospace>.sdt</monospace> files), the input data is stored in the main class of the package, a 
                    <monospace>FlimCube</monospace>, which is an object that represents 3D data (2D spatial dimensions and one temporal dimension) allowing multiple methods to access and manipulate the data cube.</p>
                <p>Among its attributes is the header which includes all the metadata available for the dataset, sizes of the arrays, resolution and whether this cube is binned and/or masked (see Binning and Masking sections below). When the data cube is masked, a process described in the following sections, the pixel-level mask is also included as an attribute in the 
                    <monospace>FlimCube</monospace> object. Due to its construction, we consider a 
                    <monospace>FlimCube</monospace> to be self-explanatory as it contains all needed information (including its corresponding metadata) to analyze, visualize and fit the data.</p>
                <p>
                    <bold>
                        <italic toggle="yes">Binning</italic>
                    </bold>. 
                    <monospace>flimview</monospace> includes a binning function with several pre-defined kernels, although a user-defined kernel is also possible and can be easily added. The binning procedure is simply a convolution kernel applied to the image to increase the signal or to enhance its features. This function takes a 
                    <monospace>FlimCube</monospace> as an input and returns a 
                    <monospace>FlimCube</monospace> as output by copying all of the metadata and properties from the input data. The following snippet shows an example on how to bin an existing 
                    <monospace>FlimCube</monospace> using a Gaussian kernel of size 9&#x00d7;9 and a sigma of 3 (the size of the kernel is 2 &#x2217; b + 1, where 
                    <italic toggle="yes">b</italic> is the bin size)</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> flimview.flim as flim

                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> flimview.io_utils as io 
                        <styled-content style="font-size:15px;color:#009900"># IO utils</styled-content>

data, header = io.read_sdt_file (sdtfile)
FC = flim.FlimCube (data, header) 
                        <styled-content style="font-size:15px;color:#009900"># FlimCube Class</styled-content>
FCbinned = flim.binCube (FC, 
                        <styled-content style="font-size:15px;color:#EC008D">bin</styled-content>=4, kernel=
                        <styled-content style="font-size:15px;color:#9400D1">&#x2019;gauss&#x2019;</styled-content>, sigma=3)

                        <styled-content style="font-size:15px;color:#009900"># FCbinned is also a FlimCube object
#</styled-content>
                    </preformat>
                </p>
                <p>The kernel functions included in 
                    <monospace>flimview</monospace> are Gaussian kernel, Airy disk kernel, linear kernel, and a flat kernel. Customized kernels can be easily incorporated. 
                    <xref ref-type="fig" rid="f1">Figure 1</xref> shows examples of different 9&#x00d7;9 kernels where we can observe how the weight is distributed around the central pixel. In the case of a Gaussian kernel or an Airy disk kernel, the width of the kernel can be customized using the sigma 
                    <italic toggle="yes">&#x03c3;</italic> parameter. For reference, the Gaussian kernel is given by: 
                    <disp-formula id="e1">
                        <mml:math display="block" id="math1">
                            <mml:mrow>
                                <mml:mi>I</mml:mi>
                                <mml:mrow>
                                    <mml:mo>(</mml:mo>
                                    <mml:mi>x</mml:mi>
                                    <mml:mo>)</mml:mo>
                                </mml:mrow>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>I</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:msup>
                                    <mml:mi>e</mml:mi>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mrow>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:msup>
                                                    <mml:mi>x</mml:mi>
                                                    <mml:mn>2</mml:mn>
                                                </mml:msup>
                                            </mml:mrow>
                                            <mml:mo>/</mml:mo>
                                            <mml:mrow>
                                                <mml:mn>2</mml:mn>
                                                <mml:msup>
                                                    <mml:mi>&#x03c3;</mml:mi>
                                                    <mml:mn>2</mml:mn>
                                                </mml:msup>
                                            </mml:mrow>
                                        </mml:mrow>
                                    </mml:mrow>
                                </mml:msup>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula> where 
                    <italic toggle="yes">x</italic> is the distance to the center pixel and 
                    <italic toggle="yes">I</italic>
                    <sub>0</sub> is a normalization factor (usually just a unit). In the case of the Airy disk, the kernel is given by: 
                    <disp-formula id="e2">
                        <mml:math display="block" id="math2">
                            <mml:mrow>
                                <mml:mi>I</mml:mi>
                                <mml:mrow>
                                    <mml:mo>(</mml:mo>
                                    <mml:mi>x</mml:mi>
                                    <mml:mo>)</mml:mo>
                                </mml:mrow>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>I</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                                <mml:msup>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mo>[</mml:mo>
                                            <mml:mrow>
                                                <mml:mfrac>
                                                    <mml:mrow>
                                                        <mml:mn>2</mml:mn>
                                                        <mml:msub>
                                                            <mml:mi>J</mml:mi>
                                                            <mml:mn>1</mml:mn>
                                                        </mml:msub>
                                                        <mml:mrow>
                                                            <mml:mo>(</mml:mo>
                                                            <mml:mi>x</mml:mi>
                                                            <mml:mo>)</mml:mo>
                                                        </mml:mrow>
                                                    </mml:mrow>
                                                    <mml:mi>x</mml:mi>
                                                </mml:mfrac>
                                            </mml:mrow>
                                            <mml:mo>]</mml:mo>
                                        </mml:mrow>
                                    </mml:mrow>
                                    <mml:mn>2</mml:mn>
                                </mml:msup>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula> where 
                    <italic toggle="yes">J</italic>
                    <sub>1</sub>(
                    <italic toggle="yes">x</italic>) is the Bessel function of the first kind of order one. In both cases, 
                    <italic toggle="yes">I</italic>(
                    <italic toggle="yes">x</italic>) is discretized and normalized to the unit across the 2d binning window.</p>
                <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                    <label>Figure 1. </label>
                    <caption>
                        <title>Example of different 9x9 kernels used for binning.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/26482/cc36aa93-2a32-4069-9b75-753ab671960f_figure1.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Masking</italic>
                    </bold>. 
                    <monospace>FlimCube</monospace> also includes methods for looking at the header information and for masking pixels below a given integrated intensity, or below a given peak threshold in the time series, or even for a custom made geometry mask. The pixels masked this way will not be used during the fitting analysis while the mask is also saved within the same input 
                    <monospace>FlimCube</monospace> object. The following snippet shows how to apply a mask for a given 
                    <monospace>FlimCube</monospace> :</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> flimview.flim as flim

                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> flimview.io_utils as io 
                        <styled-content style="font-size:15px;color:#009900">#IO utils</styled-content>


                        <styled-content style="font-size:15px;color:#009900"># Read data
# sdtfile = ...</styled-content>
data, header = io.read_sdt_file (sdtfile)
FC = flim.FlimCube (data, header)

                        <styled-content style="font-size:15px;color:#009900"># To mask by intensity</styled-content>
FC.mask_intensity(100)

                        <styled-content style="font-size:15px;color:#009900"># To mask by peak</styled-content>
FC.mask_peak(5)

                        <styled-content style="font-size:15px;color:#009900"># To mask by a given geometry</styled-content>
FC.mask_peak(0, mask=custom_numpy_masked_array)

                        <styled-content style="font-size:15px;color:#009900">#</styled-content>
                    </preformat>
                </p>
                <p>
                    <xref ref-type="fig" rid="f2">Figure 2</xref> shows different masks applied to the example raw (top) and binned (bottom) data. Masks can be combined and can be transferred between binned and raw data.</p>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>Figure 2. </label>
                    <caption>
                        <title>Different Masking approaches to the raw data (top) and binned data (bottom).</title>
                        <p>Masks can be combined. Masked pixels will not be used in the analysis.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/26482/cc36aa93-2a32-4069-9b75-753ab671960f_figure2.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Fitting</italic>
                    </bold>. Once the data is read and binned, and have the low signal and error pixels masked, 
                    <monospace>flimview</monospace> provides a function to fit a decay function for every pixel in the temporal data using a predefined model (from the module 
                    <monospace>models.py</monospace> which can be customized and also parallelized. By default a double exponential is used as follows: 
                    <disp-formula id="e3">
                        <mml:math display="block" id="math3">
                            <mml:mrow>
                                <mml:mi>f</mml:mi>
                                <mml:mrow>
                                    <mml:mo>(</mml:mo>
                                    <mml:mi>t</mml:mi>
                                    <mml:mo>)</mml:mo>
                                </mml:mrow>
                                <mml:mo>=</mml:mo>
                                <mml:msub>
                                    <mml:mi>a</mml:mi>
                                    <mml:mn>1</mml:mn>
                                </mml:msub>
                                <mml:msup>
                                    <mml:mi>e</mml:mi>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mrow>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mi>t</mml:mi>
                                            </mml:mrow>
                                            <mml:mo>/</mml:mo>
                                            <mml:mrow>
                                                <mml:msub>
                                                    <mml:mi>&#x03c4;</mml:mi>
                                                    <mml:mn>1</mml:mn>
                                                </mml:msub>
                                            </mml:mrow>
                                        </mml:mrow>
                                    </mml:mrow>
                                </mml:msup>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>a</mml:mi>
                                    <mml:mn>2</mml:mn>
                                </mml:msub>
                                <mml:msup>
                                    <mml:mi>e</mml:mi>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mrow>
                                                <mml:mo>&#x2212;</mml:mo>
                                                <mml:mi>t</mml:mi>
                                            </mml:mrow>
                                            <mml:mo>/</mml:mo>
                                            <mml:mrow>
                                                <mml:msub>
                                                    <mml:mi>&#x03c4;</mml:mi>
                                                    <mml:mn>2</mml:mn>
                                                </mml:msub>
                                            </mml:mrow>
                                        </mml:mrow>
                                    </mml:mrow>
                                </mml:msup>
                                <mml:mo>+</mml:mo>
                                <mml:msub>
                                    <mml:mi>l</mml:mi>
                                    <mml:mn>0</mml:mn>
                                </mml:msub>
                            </mml:mrow>
                        </mml:math>
                    </disp-formula> where 
                    <italic toggle="yes">a</italic>
                    <sub>1</sub> and 
                    <italic toggle="yes">a</italic>
                    <sub>2</sub> are the amplitudes for the given exponential factor. Usually, there is an extra constraint given by 
                    <italic toggle="yes">a</italic>
                    <sub>1</sub> + 
                    <italic toggle="yes">a</italic>
                    <sub>2</sub> = 1. 
                    <italic toggle="yes">&#x03c4;</italic>
                    <sub>1</sub> and 
                    <italic toggle="yes">&#x03c4;</italic>
                    <sub>2</sub> are the mean lifetime for each exponential. 
                    <italic toggle="yes">l</italic>
                    <sub>0</sub> is a level constant.</p>
                <p>Before fitting the entire cube, a single fit is done to the mean intensity values to obtain initial guess parameters for the fitting procedures as shown in 
                    <xref ref-type="fig" rid="f3">Figure 3</xref>, as well as the boundaries to each parameter which can also be provided by hand. The snippet below shows how this is done using 
                    <monospace>flimview</monospace> :</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> flimview.flim as flim

                        <styled-content style="font-size:15px;color:#009900"># Assuming a FlimCube FC, let&#x2019;s compute the average of the pixel values</styled-content>
timesteps, mean_pixel = flim.meanDecay (FCbin)

                        <styled-content style="font-size:15px;color:#009900"># Let&#x2019;s clean these by a threshold, normalize and shift to the maximum</styled-content>
timesteps_clean, mean_pixel_clean, max_value, time_shift = flim.cleanCurve (timesteps,
    mean_pixel, norm=True, threshold=0.02)

                        <styled-content style="font-size:15px;color:#009900"># Let&#x2019;s assume a model (double exponential with a level parameter)</styled-content>
mymodel = models.model1

                        <styled-content style="font-size:15px;color:#009900"># Let&#x2019;s fit that mean pixel using fitPixel function
# xf, yf are the time and value used for the fitting, pfit is the fitted values, pcov
     is the parameters covariance matrix and chi2
# is the Chi - square value of the fit</styled-content>
xf, yf, pfit, pcov, chi2 = flim.fitPixel(
     timesteps,
     mean_pixel,
     mymodel,
     initial_p =[0.8, 0.3, 3, 0.03],
     bounds =(0, np.inf),
     norm = True)

                        <styled-content style="font-size:15px;color:#009900">#</styled-content>
                    </preformat>
                </p>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>Example of fitting the average and normalized pixel decay to determine initial parameters.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/26482/cc36aa93-2a32-4069-9b75-753ab671960f_figure3.gif"/>
                </fig>
                <p>Note that the data is normalized, cleaned, and shifted with respect its peak. For example, to generate 
                    <xref ref-type="fig" rid="f3">Figure 3</xref> we can use the following:</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#009900"># We can plot the fitted data (only considering from the maximum value)</styled-content>
plt.plot(timesteps - time_shift, mean_pixel/max_value, 
                        <styled-content style="font-size:15px;color:#9400D1">&#x2019;.&#x2019;</styled-content>, label=
                        <styled-content style="font-size:15px;color:#9400D1">&#x2019;original data&#x2019;</styled-content>)
plt.plot(xf, yf, 
                        <styled-content style="font-size:15px;color:#9400D1">&#x2019;.&#x2019;</styled-content>, label=
                        <styled-content style="font-size:15px;color:#9400D1">&#x2019;fitted data&#x2019;</styled-content>)
plt.plot(xf, mymodel(xf, *pfit))

                        <styled-content style="font-size:15px;color:#000000;">plt.xlabel(</styled-content>
                        <styled-content style="font-size:15px;color:#9400D1;">&#x2019;time [ns]&#x2019;</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                        <styled-content style="font-size:15px;color:#000000;"> fontsize=15)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">plt.ylabel(</styled-content>
                        <styled-content style="font-size:15px;color:#9400D1;">&#x2019;Intensity&#x2019;</styled-content>
                        <styled-content style="font-size:15px;color:#000000;">,</styled-content>
                        <styled-content style="font-size:15px;color:#000000;"> fontsize=15)</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">plt.text(6, 0.5, flim.printModel(mymodel, pfit, pcov, chi2, oneliner=False))
plt.legend(loc=0)</styled-content>
                    </preformat>
                </p>
                <p>After those parameters are defined and a model is selected a function 
                    <monospace>fitCube</monospace> takes a 
                    <monospace>FlimCube</monospace> as input and produces another 
                    <monospace>flimview</monospace> class called 
                    <monospace>FlimFit</monospace> which contains the fitting information for every pixel, including all parameters from the model, their errors and 
                    <italic toggle="yes">&#x03c7;</italic>
                    <sup>2</sup> values. It is a collection of 2D arrays for the results of the fitting.</p>
                <p>To generate a 
                    <monospace>FlimFit</monospace> object we can use the following:</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#009900"># Define the boundaries for parameters</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">bounds_lower=[0.0, 0.0, 0., 0.]
bounds_upper=[1, 1., 5., 1.]</styled-content>

                        <styled-content style="font-size:15px;color:#009900"># Fit the whole cube to create a FlimFit object</styled-content>

                        <styled-content style="font-size:15px;color:#000000;">Ffit = flim.fitCube(
   FCbin,
   mymodel,
   pfit,
   bounds =(bounds_lower, bounds_upper), 
   norm=True,
   threshold=0.02)</styled-content>
</preformat>
</p>
                <p>
                    <bold>
                        <italic toggle="yes">Visualization</italic>
                    </bold>. The package also includes means to visualize the 
                    <monospace>FlimCube</monospace> and 
                    <monospace>FlimFit</monospace> objects using intensity or peak values. Additionally, one can visualize the results from the fitting procedure using a function called 
                    <monospace>plotFit</monospace>, which takes a 
                    <monospace>FlimCube</monospace> and a 
                    <monospace>FlimFit</monospace> as input, along with a pixel coordinate, to produce a figure as the one shown in 
                    <xref ref-type="fig" rid="f4">Figure 4</xref>, showing the fit results for a given pixel, the parameters, the residuals, and the residuals distribution which is a useful way to explore the results. These can be combined in an interactive widget showing, for example, the same figure for a given point selected interactively. It is also possible to combine multiple visualizations to generate a sequence of plots into an animation of the datacube. The 
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/mgckind/filmview">package repository</ext-link> includes examples on how this can be done to generate a short animation. Other visualization functions are also included and documented in the package.</p>
                <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                    <label>Figure 4. </label>
                    <caption>
                        <title>Visualization example showing the fit for an individual pixel, the residuals and the location on the image for both, 
                            <monospace>.sdt</monospace> (a) and 
                            <monospace>.ptu</monospace> (b) files.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/26482/cc36aa93-2a32-4069-9b75-753ab671960f_figure4.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Storage</italic>
                    </bold>. 
                    <monospace>FlimCube</monospace> and 
                    <monospace>FlimFit</monospace> can be easily stored and easily retrieved by using a hierarchical and compression data store format for array-like data called HDF5 (
                    <xref ref-type="bibr" rid="ref-15">The HDF Group, 2000&#x2013;2020</xref>). Using this data format, we can store multiple data in different &#x2018;folders&#x2019;, including parameters, different models, masks, raw, binned and fitted data in one file for easy retrieval, as it only loads what is asked for, saving memory consumption if necessary. In the case of multiple files, we can serve them on-demand using a web server and only load the data as necessary, including over the web, which is an HDF5 feature. The methods 
                    <monospace>saveCube, saveFit, loadCube, loadFit, viewH5</monospace> are implemented in the 
                    <monospace>io_utils</monospace> modules inside 
                    <monospace>flimview</monospace>. For example, after running 
                    <monospace>fitCube</monospace> and saving the example data in a file, one can easily see its internal structure with:</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#EC008D">import</styled-content> 
                        <styled-content style="font-size:15px;color:#000000;"> flimview.io_utils as io
io.viewH5(h5file)</styled-content>
</preformat>
</p>
                <p>which produces the following output, showing the file content of the processed data:</p>
                <p>
                    <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                        <styled-content style="font-size:15px;color:#000000;">File: test_ptu .h5
----&gt; example_ptu: /example_ptu
--------&gt; v0: /example_ptu /v0
------------&gt; binned: /example_ptu /v0/ binned
----------------&gt; data: (256, 256, 107)
----------------&gt; mask: (256, 256)
------------&gt; fit: /example_ptu /v0/ fit
----------------&gt; a1: (256, 256)
----------------&gt; a1_err: (256, 256)
----------------&gt; chi2: (256, 256)
----------------&gt; level: (256, 256)
----------------&gt; level_err: (256, 256)
----------------&gt; mask: (256, 256)
----------------&gt; residuals: (256, 256)
----------------&gt; tau1: (256, 256)
----------------&gt; tau1_err: (256, 256)
----------------&gt; tau2: (256, 256)
----------------&gt; tau2_err: (256, 256)
------------&gt; raw: /example_ptu /v0/ raw
----------------&gt; data: (256, 256, 107)
--------&gt; v1: /example_ptu /v1
------------&gt; raw: /example_ptu /v1/ raw
----------------&gt; data: (256, 256, 107)
--------&gt; v2: /example_ptu /v2
------------&gt; raw: /example_ptu /v2/ raw
----------------&gt; data: (256, 256, 107)
--------&gt; v3: /example_ptu /v3
------------&gt; raw: /example_ptu /v3/ raw
----------------&gt; data: (256, 256, 107)
</styled-content>
</preformat>
</p>
                <p>More examples on how to save and retrieve FLIM data using this format are included in the example notebooks at the 
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/Biophotonics-COMI/flimview">Github</ext-link> repository.</p>
            </sec>
        </sec>
        <sec>
            <title>Use cases</title>
            <p>To highlight the main features of 
                <monospace>flimview</monospace>, we have used two of the most common FLIM data formats, namely, the Becker and Hickl 
                <monospace>.sdt</monospace>, and PicoQuant 
                <monospace>.ptu</monospace>. We have included the reading routines for both data types but others can be easily extended within the module. All the figures in this paper were made using the two example files included in the package which we describe below. In particular 
                <xref ref-type="fig" rid="f4">Figure 4</xref> shows both files presented in the same visualization after being processed into a 
                <monospace>FlimCube</monospace>. Both example files are included with the package and are briefly described below.</p>
            <sec>
                <title>SDT File</title>
                <p>The example file 
                    <monospace>epidermis.sdt</monospace> contains 2-photon excited FLIM data from the skin (epidermis) on the upper forearm of a healthy human volunteer captured with commercial optical medical imaging system (MPT-lex CARS, JenLab GmbH, Germany) (
                    <xref ref-type="bibr" rid="ref-17">Weinigel 
                        <italic toggle="yes">et al.</italic>, 2015</xref>). The image was captured using the procedure described in (
                    <xref ref-type="bibr" rid="ref-1">Alex 
                        <italic toggle="yes">et al.</italic>, 2018</xref>). For generating optical images, the excitation wavelength of the femtosecond laser was set to 760 nm and the incident in situ laser power was set to 30 mW. The light was focused through a 40x 1.35 NA objective. Autofluorescence signals within the spectral range of 405 nm&#x2013;600 nm were detected. All these parameters are extracted from the file and added to the header inside the 
                    <monospace>FlimCube</monospace>.</p>
            </sec>
            <sec>
                <title>PTU File</title>
                <p>The example file 
                    <monospace>macrophages.ptu</monospace> contains the 2-photon excited FLIM data from J774A.1 mouse macrophages grown in Dulbecco&#x2019;s Modified Eagle Medium + 10% FBA + 1% antibiotic, under 5% CO
                    <sub>2</sub>. The image was acquired with the laser set to 750 nm and the incident in situ laser power was set to 25 mW.</p>
            </sec>
        </sec>
        <sec>
            <title>Summary</title>
            <p>In this paper we have presented 
                <monospace>flimview</monospace>, a novel Python 3 package to manipulate, visualize, and analyze FLIM images and measurements from specific data formats 
                <monospace>.sdt</monospace> and 
                <monospace>.ptu</monospace>. We included snippets on how different kernels and different masking strategies can be applied after reading the raw data into a 
                <monospace>FlimCube</monospace> object. We also show how the procedure of fitting the whole cube is carried out and how these results can be visualized effectively. Most of the functions provided in this package can be customized for further research or to fit specific needs, including user defined binning kernels, mask functions or exponential decay fitting models. We showed how, using a hierarchical data format, the results from multiple files, multiple formats and multiple views can be stored in a single optimized data format called HDF5 which allows much better data management and data access to the data sets, even in the case of multiple files.</p>
        </sec>
        <sec>
            <title>Data availability</title>
            <p>We have included two data examples along with 
                <ext-link ext-link-type="uri" xlink:href="https://Jupyter.org/">Jupyter</ext-link> notebooks to explore and get started with the module and its functions. This data examples can be found in the following repository: 
                <ext-link ext-link-type="uri" xlink:href="https://github.com/Biophotonics-COMI/flimview">https://github.com/Biophotonics-COMI/flimview</ext-link>. Individual files can be loaded locally using this snippet. Detailed instructions and description of the data included can be found in the package website:</p>
            <p>
                <preformat orientation="portrait" position="float" preformat-type="computer code" xml:space="preserve">
                    <styled-content style="font-size:15px;color:#EC008D;">from</styled-content> 
                    <styled-content style="font-size:15px;color:#000000;">flimview</styled-content> 
                    <styled-content style="font-size:15px;color:#EC008D;">import</styled-content> 
                    <styled-content style="font-size:15px;color:#000000;">datasets</styled-content>

                    <styled-content style="font-size:15px;color:#009900;"># Get SDT example file</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">datasets.fetch_sdt()</styled-content>

                    <styled-content style="font-size:15px;color:#009900;"># Get PTU file</styled-content>

                    <styled-content style="font-size:15px;color:#000000;">datatsets.fetch_ptu()</styled-content>
</preformat>
            </p>
        </sec>
        <sec>
            <title>Software availability</title>
            <list list-type="bullet">
                <list-item>
                    <label>1. </label>
                    <p>Package and installation instructions can be found here: 
                        <ext-link ext-link-type="uri" xlink:href="https://github.com/Biophotonics-COMI/flimview">https://github.com/Biophotonics-COMI/flimview</ext-link>
                    </p>
                </list-item>
                <list-item>
                    <label>2. </label>
                    <p>Source code can be found here: 
                        <ext-link ext-link-type="uri" xlink:href="https://github.com/Biophotonics-COMI/flimview">https://github.com/Biophotonics-COMI/flimview</ext-link>
                    </p>
                </list-item>
                <list-item>
                    <label>3. </label>
                    <p>Archived source code at time of publication: 
                        <ext-link ext-link-type="uri" xlink:href="http://doi.org/10.5281/zenodo.3825694">http://doi.org/10.5281/zenodo.3825694</ext-link> (
                        <xref ref-type="bibr" rid="ref-12">Carrasco Kind, 2020</xref>).</p>
                </list-item>
                <list-item>
                    <label>4. </label>
                    <p>License: 
                        <ext-link ext-link-type="uri" xlink:href="https://github.com/mgckind/flimview/raw/master/Licence.txt">NCSA</ext-link>
                    </p>
                </list-item>
            </list>
        </sec>
    </body>
    <back>
        <ref-list>
            <ref id="ref-1">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Alex</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Frey</surname>
                            <given-names>S</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Angelene</surname>
                            <given-names>H</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>
                        <italic toggle="yes">In situ</italic> biodistribution and residency of a topical anti-inflammatory using fluorescence lifetime imaging microscopy.</article-title>
                    <source>

                        <italic toggle="yes">Br J Dermatol.</italic>
</source>
                    <year>2018</year>;<volume>179</volume>(<issue>6</issue>):<fpage>1342</fpage>&#x2013;<lpage>1350</lpage>.
                    <pub-id pub-id-type="pmid">29989149</pub-id>
                    <pub-id pub-id-type="doi">10.1111/bjd.16992</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-2">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ballesteros</surname>
                            <given-names>GC</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Proux</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Bonato</surname>
                            <given-names>C</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>readPTU: a python library to analyse time tagged time resolved data.</article-title>
                    <source>

                        <italic toggle="yes">Journal of Instrumentation.</italic>
</source>
                    <year>2019</year>;<volume>14</volume>(<issue>06</issue>):<fpage>T06011</fpage>&#x2013;<lpage>T06011</lpage>.
                    <pub-id pub-id-type="doi">10.1088/1748-0221/14/06/T06011</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-3">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Becker</surname>
                            <given-names>W</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Bergmann</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Hink</surname>
                            <given-names>MA</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Fluorescence lifetime imaging by time-correlated single-photon counting.</article-title>
                    <source>

                        <italic toggle="yes">Microsc Res Tech.</italic>
</source>
                    <year>2004</year>;<volume>63</volume>(<issue>1</issue>):<fpage>58</fpage>&#x2013;<lpage>66</lpage>.
                    <pub-id pub-id-type="pmid">14677134</pub-id>
                    <pub-id pub-id-type="doi">10.1002/jemt.10421</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-4">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bergmann</surname>
                            <given-names>A</given-names>
                        </name>
</person-group>:
                    <article-title>Spcimage: data analysis software for fluorescence lifetime imaging microscopy.</article-title>
                    <source>

                        <italic toggle="yes">Becker &amp; Hickl GmbH.</italic>
</source>
                    <year>2003</year>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.becker-hickl.com/products/spcimage/">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-5">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Borhani</surname>
                            <given-names>N</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Bower</surname>
                            <given-names>AJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Boppart</surname>
                            <given-names>SA</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Digital staining through the application of deep neural networks to multi-modal multi-photon microscopy.</article-title>
                    <source>

                        <italic toggle="yes">Biomed Opt Express.</italic>
</source>
                    <year>2019</year>;<volume>10</volume>(<issue>3</issue>):<fpage>1339</fpage>&#x2013;<lpage>1350</lpage>.
                    <pub-id pub-id-type="pmid">30891350</pub-id>
                    <pub-id pub-id-type="doi">10.1364/BOE.10.001339</pub-id>
                    <pub-id pub-id-type="pmcid">6420275</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-6">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bower</surname>
                            <given-names>AJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Li</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Chaney</surname>
                            <given-names>EJ</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>High-speed imaging of transient metabolic dynamics using two-photon fluorescence lifetime imaging microscopy.</article-title>
                    <source>

                        <italic toggle="yes">Optica.</italic>
</source>
                    <year>2018</year>;<volume>5</volume>(<issue>10</issue>):<fpage>1290</fpage>&#x2013;<lpage>1296</lpage>.
                    <pub-id pub-id-type="pmid">30984802</pub-id>
                    <pub-id pub-id-type="doi">10.1364/OPTICA.5.001290</pub-id>
                    <pub-id pub-id-type="pmcid">6457362</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-7">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bower</surname>
                            <given-names>AJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Marjanovic</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Zhao</surname>
                            <given-names>Y</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Label-free 
                        <italic toggle="yes">in vivo</italic> cellular-level detection and imaging of apoptosis.</article-title>
                    <source>

                        <italic toggle="yes">J Biophotonics.</italic>
</source>
                    <year>2017</year>;<volume>10</volume>(<issue>1</issue>):<fpage>143</fpage>&#x2013;<lpage>150</lpage>.
                    <pub-id pub-id-type="pmid">27089867</pub-id>
                    <pub-id pub-id-type="doi">10.1002/jbio.201600003</pub-id>
                    <pub-id pub-id-type="pmcid">5071126</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-8">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Bower</surname>
                            <given-names>AJ</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Sorrells</surname>
                            <given-names>JE</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Li</surname>
                            <given-names>J</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Tracking metabolic dynamics of apoptosis with high-speed two-photon fluorescence lifetime imaging microscopy.</article-title>
                    <source>

                        <italic toggle="yes">Biomed Opt Express.</italic>
</source>
                    <year>2019</year>;<volume>10</volume>(<issue>12</issue>):<fpage>6408</fpage>&#x2013;<lpage>6421</lpage>.
                    <pub-id pub-id-type="pmid">31853407</pub-id>
                    <pub-id pub-id-type="doi">10.1364/BOE.10.006408</pub-id>
                    <pub-id pub-id-type="pmcid">6913390</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-12">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Carrasco Kind</surname>
                            <given-names>M</given-names>
                        </name>
</person-group>:
                    <article-title>Biophotonics-COMI/flimview: flimview 1.2.0 (Version v1.2.0).</article-title>
                    <source>

                        <italic toggle="yes">Zenodo.</italic>
</source>
                    <year>2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.5281/zenodo.3825694">http://www.doi.org/10.5281/zenodo.3825694</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-9">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Cao</surname>
                            <given-names>R</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Wallrabe</surname>
                            <given-names>H</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Siller</surname>
                            <given-names>K</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Optimization of FLIM imaging, fitting and analysis for auto-fluorescent NAD(p)h and FAD in cells and tissues.</article-title>
                    <source>

                        <italic toggle="yes">Methods Appl Fluoresc.</italic>
</source>
                    <year>2020</year>;<volume>8</volume>(<issue>2</issue>):<fpage>024001</fpage>.
                    <pub-id pub-id-type="pmid">31972557</pub-id>
                    <pub-id pub-id-type="doi">10.1088/2050-6120/ab6f25</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-10">
                <mixed-citation publication-type="journal">
                    <article-title>Flimlib: a package for exponential curve fitting of fluorescence lifetime image data</article-title>. Accessed: 2020-02-26.
                    <ext-link ext-link-type="uri" xlink:href="https://github.com/flimlib/flimlib">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-11">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Hirvonen</surname>
                            <given-names>LM</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Suhling</surname>
                            <given-names>K</given-names>
                        </name>
</person-group>:
                    <article-title>Wide-field TCSPC: methods and applications.</article-title>
                    <source>

                        <italic toggle="yes">Meas Sci Technol.</italic>
</source>
                    <year>2016</year>;<volume>28</volume>(<issue>1</issue>): 012003.
                    <pub-id pub-id-type="doi">10.1088/1361-6501/28/1/012003 </pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-13">
                <mixed-citation publication-type="book">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>McGinty</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Talbot</surname>
                            <given-names>CB</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Owen</surname>
                            <given-names>D</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Fluorescence lifetime imaging: Microscopy, endoscopy, and tomography.</article-title>In:
                    <source>

                        <italic toggle="yes">Handbook of Biomedical Optics.</italic>
</source>CRC Press,<year>2016</year>;<fpage>609</fpage>&#x2013;<lpage>636</lpage>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.researchgate.net/publication/327177640_Fluorescence_lifetime_imaging_Microscopy_endoscopy_and_tomography">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-14">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Ranawat</surname>
                            <given-names>H</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Pal</surname>
                            <given-names>S</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Mazumder</surname>
                            <given-names>N</given-names>
                        </name>
</person-group>:
                    <article-title>Recent trends in two-photon auto-fluorescence lifetime imaging (2p- flim) and its biomedical applications.</article-title>
                    <source>

                        <italic toggle="yes">Biomed Eng Lett.</italic>
</source>
                    <year>2019</year>;<fpage>1</fpage>&#x2013;<lpage>18</lpage>.
                    <pub-id pub-id-type="pmid">31456890</pub-id>
                    <pub-id pub-id-type="doi">10.1007/s13534-019-00119-7</pub-id>
                    <pub-id pub-id-type="pmcid">6694381</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-15">
                <mixed-citation publication-type="journal">
                    <collab>The HDF Group</collab>:
                    <article-title>Hierarchical data format version 5, 2000-2020.</article-title>
                    <ext-link ext-link-type="uri" xlink:href="http://www.hdfgroup.org/HDF5">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-16">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Warren</surname>
                            <given-names>SC</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Margineanu</surname>
                            <given-names>A</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Alibhai</surname>
                            <given-names>D</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Rapid global fitting of large fluorescence lifetime imaging microscopy datasets.</article-title>
                    <source>

                        <italic toggle="yes">PLoS One.</italic>
</source>
                    <year>2013</year>;<volume>8</volume>(<issue>8</issue>):<fpage>e70687</fpage>.
                    <pub-id pub-id-type="pmid">23940626</pub-id>
                    <pub-id pub-id-type="doi">10.1371/journal.pone.0070687</pub-id>
                    <pub-id pub-id-type="pmcid">3734241</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-17">
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Weinigel</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Georg Breunig</surname>
                            <given-names>H</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Uchugonova</surname>
                            <given-names>A</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Multipurpose nonlinear optical imaging system for 
                        <italic toggle="yes">in vivo</italic> and 
                        <italic toggle="yes">ex vivo</italic> multimodal histology.</article-title>
                    <source>

                        <italic toggle="yes">J Med Imaging.</italic>
</source>
                    <year>2015</year>;<volume>2</volume>(<issue>1</issue>):<fpage>016003</fpage>.
                    <pub-id pub-id-type="pmid">26158089</pub-id>
                    <pub-id pub-id-type="doi">10.1117/1.JMI.2.1.016003</pub-id>
                    <pub-id pub-id-type="pmcid">4478869</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report68967">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.26482.r68967</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Mazumder</surname>
                        <given-names>Nirmal</given-names>
                    </name>
                    <xref ref-type="aff" rid="r68967a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-8068-6484</uri>
                </contrib>
                <aff id="r68967a1">
                    <label>1</label>Department of Biophysics, Manipal School of Life Sciences, Manipal Academy of Higher Education (MAHE), Manipal, Karnataka, India</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>1</day>
                <month>9</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Mazumder N</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport68967" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.24006.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve-with-reservations</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The manuscript on flimview is well written and rationale of developing a new software is needed to analysis FLIM data acquired by commercial software or hardware.&#x00a0;</p>
            <p> </p>
            <p> The manuscript can be accepted for indexing after minor revision.&#x00a0;</p>
            <p> </p>
            <p> Line 4, in introduction, It should be "TCSPC".</p>
            <p> In this manuscript, definition of "fluorescence lifetime" is missing.&#x00a0;</p>
            <p> Author could describe in brief about the instrumentation. Is flimview applicable for single photon or two photon fluorescence measurement?</p>
            <p> </p>
            <p> A step by step flowchart about the flimview could help to implement.&#x00a0;</p>
            <p> </p>
            <p> In figure 2, only center of the image is used for analysis after masking. However, in some cases cells are distributed in full field of view. In such case, how does this kind of masking work?&#x00a0;</p>
            <p> </p>
            <p> Author should mention in figure 2, what kind of image it is, what does the color mean, what type of cell is imaged.&#x00a0;</p>
            <p> In fitting, why two lifetimes are used for fitting? If there is only one flurophore then single exponential fitting may work. In case of NADH, it exists in free and bound forms and hence two lifetimes. Author should comment on it.&#x00a0;</p>
            <p> </p>
            <p> In figure 4, it will be more acceptable if author can compare the results of flimview with&#x00a0;Becker and Hickl&#x00a0;or PicoQuant software analysis. Residues should be close to 1. Is it due to experimental&#x00a0;or software error?</p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Partly</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Partly</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Partly</p>
            <p>Reviewer Expertise:</p>
            <p>Biophotonics, Biophysics</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.</p>
        </body>
    </sub-article>
    <sub-article article-type="reviewer-report" id="report65063">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.26482.r65063</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Michalet</surname>
                        <given-names>Xavier</given-names>
                    </name>
                    <xref ref-type="aff" rid="r65063a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-6602-7693</uri>
                </contrib>
                <aff id="r65063a1">
                    <label>1</label>Department of Chemistry and Biochemistry, University of California, Los Angeles&#x00a0;(UCLA), Los Angeles, CA, USA</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>2</day>
                <month>7</month>
                <year>2020</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Michalet X</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport65063" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.24006.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>approve</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>Reviewer&#x2019;s Report on the manuscript &#x201c;flimview&#x2026;&#x201d; by Kind et al.</p>
            <p> This paper describes a python package to load and visualize FLIM datasets. The source code has been deposited on Github, together with two example data files used to illustrate some of the software features.</p>
            <p> </p>
            <p> The manuscript is well written and describes the software features with a fair amount of detail. The samples of code I have reviewed appear to be also reasonably well documented. Based on these basic criteria, this work should be valuable as a basis for future developments by researchers interested in developing their own tools for FLIM analysis.</p>
            <p> I would however encourage the authors to address the following remarks: 
                <list list-type="order">
                    <list-item>
                        <p>
                            <bold>Presentation:</bold> 
                            <list list-type="bullet">
                                <list-item>
                                    <p>For whatever reasons, the figures do not include color scales, which are present in the Jupyter notebooks used to generate them. This can easily be fixed and would be useful.</p>
                                </list-item>
                                <list-item>
                                    <p>The datasets shown correspond to microscopy images of biological samples. It is customary (and very useful) to show such data with a scale bar. Consider making the extra effort to generate one (maybe optionally) as part of the code, to encourage scientific rigor.</p>
                                </list-item>
                                <list-item>
                                    <p>Some of the features of the software are incompletely described. For instance, the package opens .sdt and .ptu files 
                                        <italic>containing photon timestamps</italic>, but does not dwell on the choice of timestamp binning used internally. This of course has an effect on RAM resources but also potentially on decay artifacts. As a side comment, the package, as is, does not support pre-binned datasets, as far as I can tell (see below). Some .sdt files are pre-binned only and would not be handled by the current software version.</p>
                                </list-item>
                                <list-item>
                                    <p>I am not sure what the authors mean by &#x201c;after compensating for the instrument response function&#x201d; (p 3)? Clearly the code does fit the decays without IRF convolution (which of course requires the user to provide an IRF file as well).</p>
                                </list-item>
                                <list-item>
                                    <p>While I understand why binning the original dataset could be interesting to increase SNR and decrease data footprint, I am unclear about the role of convolution with Gaussian or other kernels. What would this correspond to physically? I would understand deconvolution of the image with such kernels (although that would not address the question of how the photon time stamps should be redistributed in the deconvolved image), but the purpose of these kernels, besides image beautification, is mysterious and not an encouraged practice for rigorous analysis.</p>
                                </list-item>
                            </list> </p>
                    </list-item>
                    <list-item>
                        <p>
                            <bold>Content:</bold> 
                            <list list-type="bullet">
                                <list-item>
                                    <p>While this software is understandably only offering basic features (opening datasets &#x2013; 2 kinds only supported, pre-processing, displaying an intensity image and fitting), it seems to be missing what I would consider an expected functionality for a software bearing the flim
                                        <italic>view</italic> name, namely visualization of fluorescence lifetime information. A barebone commercial software such as SPCImage from Becker &amp; Hickl, at least does offer a mean lifetime representation, which would not seem to be difficult to implement. Since we are dealing with a software intended for research, I would have naively expected that options to represent the bi-exponential fitted amplitudes and lifetimes as color-coded maps would have been offered.</p>
                                </list-item>
                                <list-item>
                                    <p>The software allows saving the data in the open and multiplatform HDF5 format. While this is commendable, it is not quite clear what principles are governing the structure of the data in this file format, or for that matter, what the file format actually looks like from a bird&#x2019;s eye view. Our group has made an attempt to offer a similar type of HDF5-based file format for a slightly different purpose (
                                        <ext-link ext-link-type="uri" xlink:href="http://www.photon-HDF5.org">photon-HDF5</ext-link>), which could be taken as an example (if maybe extreme in its level of detail) of what could be provided to potential users
                                        <sup>
                                            <xref ref-type="bibr" rid="rep-ref-65063-1">1</xref>
                                        </sup>. More importantly, it is not quite clear how this file format will and could evolve, whether it is intended to become a standard, while it has been chosen preferentially to another, etc. A minimum discussion of these considerations within the manuscript, and a more extended presentation online (say on the Github website) would be extremely useful.</p>
                                </list-item>
                                <list-item>
                                    <p>It would be useful to hear from the authors whether and how they intend to encourage contribution and ensure evolution of the software. Of particular importance would be evidence that there is some kind of quality control (test modules &#x2013; e.g. such as those described in a software cited in the file loading code, 
                                        <ext-link ext-link-type="uri" xlink:href="https://github.com/tritemio/FRETBursts">FRETBurst</ext-link>
                                        <sup>
                                            <xref ref-type="bibr" rid="rep-ref-65063-2">2</xref>
                                        </sup>- written using 
                                        <ext-link ext-link-type="uri" xlink:href="https://docs.pytest.org/en/stable/">pytest</ext-link>).</p>
                                </list-item>
                                <list-item>
                                    <p>Also related to the lack of bird&#x2019;s eye view description is the absence of discussion of the principles involved in defining the FlimCube class. How can it be extended to support more than one spectral channel (or any other spectroscopic variable)? An additional spatial dimension? An additional temporal dimension?</p>
                                </list-item>
                            </list> </p>
                    </list-item>
                </list>
            </p>
            <p>Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?</p>
            <p>Yes</p>
            <p>Is the rationale for developing the new software tool clearly explained?</p>
            <p>Yes</p>
            <p>Is the description of the software tool technically sound?</p>
            <p>Yes</p>
            <p>Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?</p>
            <p>Yes</p>
            <p>Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?</p>
            <p>Yes</p>
            <p>Reviewer Expertise:</p>
            <p>single-molecule FRET, wide-field FLIM, single-photon detectors</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.</p>
        </body>
        <back>
            <ref-list>
                <title>References</title>
                <ref id="rep-ref-65063-1">
                    <label>1</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>Photon-HDF5: An Open File Format for Timestamp-Based Single-Molecule Fluorescence Experiments.</article-title>
                        <source>
                            <italic>Biophys J</italic>
                        </source>.<year>2016</year>;<volume>110</volume>(<issue>1</issue>) :
                        <elocation-id>10.1016/j.bpj.2015.11.013</elocation-id>
                        <fpage>26</fpage>-<lpage>33</lpage>
                        <pub-id pub-id-type="pmid">26745406</pub-id>
                        <pub-id pub-id-type="doi">10.1016/j.bpj.2015.11.013</pub-id>
                    </mixed-citation>
                </ref>
                <ref id="rep-ref-65063-2">
                    <label>2</label>
                    <mixed-citation publication-type="journal">
                        <person-group person-group-type="author"/>:
                        <article-title>FRETBursts: An Open Source Toolkit for Analysis of Freely-Diffusing Single-Molecule FRET.</article-title>
                        <source>
                            <italic>PLoS One</italic>
                        </source>.<year>2016</year>;<volume>11</volume>(<issue>8</issue>) :
                        <elocation-id>10.1371/journal.pone.0160716</elocation-id>
                        <fpage>e0160716</fpage>
                        <pub-id pub-id-type="pmid">27532626</pub-id>
                        <pub-id pub-id-type="doi">10.1371/journal.pone.0160716</pub-id>
                    </mixed-citation>
                </ref>
            </ref-list>
        </back>
    </sub-article>
</article>
