Fluorescence-lifetime imaging (FLIM)
=====================================

This section describes the FLIM related measurements classes of the Time Tagger API.

.. _api.FlimAbstract:

FlimAbstract
------------

.. doxygenclass:: FlimAbstract

.. _api.FLIM:

Flim
----

.. versionchanged:: 2.7.2

.. note::

    The Flim (beta) implementation is not final yet. It has a very advanced functionality, but details are subject to change. Please give us feedback (support@swabianinstruments.com)
    when you encounter issues or when you have ideas for additional functionality.

.. image:: ../../figuresPyLab/output/Flim.*

Fluorescence-lifetime imaging microscopy (FLIM) is an imaging technique
for producing an image based on the differences in the exponential decay rate
of the fluorescence from a sample.

Fluorescence lifetimes can be determined in the time domain by using a pulsed source.
When a population of fluorophores is excited by an ultrashort or delta-peak pulse of light, the time-resolved fluorescence will decay exponentially.

This measurement implements a line scan in a |FLIM| image that
consists of a sequence of pixels. This could either represent a single line
of the image, or - if the image is represented as a single meandering line -
this could represent the entire image.

We provide two different classes that support |FLIM| measurements: :ref:`api.Flim` and :ref:`api.FlimBase`.
:ref:`api.Flim` provides a versatile high-level API. :ref:`api.FlimBase` instead provides the essential functionality with no overhead
to perform Flim measurements. :ref:`api.FlimBase` is based on a callback approach.

Please visit the Python example folder for a reference implementation.

.. _flimreplacement:

.. note::

    Up to version 2.7.0, the `Flim` implementation was very limited and has been fully rewritten in version 2.7.2.
    You can use the following 1 to 1 replacement to get the old `Flim` behavior:

    .. code:: python

        # FLIM before version 2.7.0:
        Flim(tagger, click_channel=1, start_channel=2, next_channel=3,
            binwidth=100, n_bins=1000, n_pixels=320*240)

        # FLIM 2.7.0 replacement using TimeDifferences
        TimeDifferences(tagger, click_channel=1, start_channel=2,
            next_channel=3, sync_channel=CHANNEL_UNUSED,
            binwidth=100, n_bins=1000, n_histograms=320*240)

.. doxygenclass:: Flim
    :protected-members:

.. _api.FlimFrameInfo:

FlimFrameInfo
-------------

.. doxygenclass:: FlimFrameInfo

.. _api.FlimBase:

FlimBase
--------

The `FlimBase` provides only the most essential functionality for FLIM tasks. The benefit from the reduced functionality is that it is very memory and CPU efficient.
The class provides the `FlimBase.frameReady` callback, which must be used to analyze the data.

.. doxygenclass:: FlimBase
    :protected-members:
