- Notifications
You must be signed in to change notification settings - Fork11
FLIMLib: a package for exponential curve fitting of fluorescence lifetime image data
License
flimlib/flimlib
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
FLIMLib is a curve fitting library used for Fluorescent Lifetime Imaging orFLIM. It is developed by Paul Barber (UCL and KCL, London) and the Advanced Technology Group at theOxford Institute for Radiation Oncology,University of Oxford, as well as theLaboratory for Optical and ComputationalInstrumentation at the University ofWisconsin-Madison. FLIMLib is used for FLIM functionality in theTime ResolvedImaging (TRI2) software, as wellas in theFLIMJ plugin for ImageJ.
For exponential lifetime fitting there are three core algorithms within FLIMLib:
- A triple integral method that does a very fast estimate of a singleexponential lifetime component.
- A Levenberg-Marquardt algorithm or LMA that uses an iterative,least-squares-minimization approach to generate a fit. This works withsingle, double and triple exponential models, as well as stretchedexponential.
- A Bayesian algorithm that combines evidence from each single photon toestimate lifetimes etc. It offers better performance with low photon counts.
There is also code to perform 'global' analysis over a number of signalssimultaneously (e.g. over an image), where the lifetimes can be consideredconstant across the data set, but the amplitudes are allowed to vary for eachsignal. There is also a completely generic global analysis function. A thirdalgorithm is available to perform phasor analysis.
In addition there is a non-negative linear least squares algorithm that isuseful for spectral unmixing in combined spectral-lifetime imaging (SLIM).
The FLIMLib library code is written in C89 compatible C and is thread-safe forfitting multiple pixels concurrently. A Java interface (generated bySWIG is privided to call the library from Javacode:FLIMLib.java
provide a subset of function calls used by the FLIMJplugin for ImageJ.
Additionally, there is wrapper code inFLIMLib.i
to wrap the externalfunctions inflimlib.def
. This code generates swig wrapper files which enableyou to call these functions from Java.
Directory | Contents |
---|---|
src/main/c | The source files for the FLIMLib library |
src/main/cpp | The C++ include file for a FLIMLib class for use in C++ projects |
target/generated-sources/main | The Java API and C++ wrapper generated by SWIG |
src/main/java | The rest of the Java API source files |
src/main/python | The Python API source files (ctypes-based) |
src/main/swig | The SWIG sources that directs Java API generation |
src/flimlib-cmd/c | The source files for the standalone executable wrapper for the library |
src/flimlib-cmd/cpp | The source files for the standalone executable written in C++ |
src/matlab | Wrapper and example code for use of the library with Matlab |
test_files | .dat and.ini settings file for testing |
target/natives | Compiled library binary |
You need JDK, Maven, CMake, SWIG, and C and C++ toolchains (GCC on Linux,Command Line Tools or Xcode on macOS, Visual Studio (with C++ DesktopDevelopment) on Windows) to be installed.
To build the library and standalone program using maven:
mvn clean install
Copy the executable to the
test_files
folder for conveniencecp target/build/bin/flimlib-cmd ./test_files
Run the program with the test files
cd ./test_files./flimlib-cmd test.ini transient.dat
To depend on FLIMLib from Maven, simply copy the following to appropriate places in yourpom.xml
:
<properties> <flimlib.version>2.1.0</flimlib.version></properties><!-- FLIMLib Java interface--><dependency> <groupId>flimlib</groupId> <artifactId>flimlib</artifactId> <version>${flimlib.version}</version></dependency><!-- FLIMLib native binary--><dependency> <groupId>flimlib</groupId> <artifactId>flimlib</artifactId> <version>${flimlib.version}</version> <classifier>${scijava.natives.classifier}</classifier><!-- Or one of the following if you would like to manually specify the binary platform--><!-- <classifier>native-linux_64</classifier>--><!-- <classifier>native-windows_64</classifier>--><!-- <classifier>native-osx_64</classifier>--></dependency>
Note that the native binary is platform-dependent. So you may want to make sure that the<classifier>
attribute is either automatically detected by the parentscijava
pom (${scijava.natives.classifier}
) or manually filled in to match your platform.
The Python API is a ctypes-based wrapper around a few of the library functions.
pip install flimlib
importflimlib
To get started, see the help (docstrings) for these functions:
flimlib.GCI_marquardt_fitting_engine()
(Levenberg-Marquardt)flimlib.GCI_triple_integral_fitting_engine()
(RLD: rapid lifetimedetermination)flimlib.GCI_Phasor()
(phasor analysis)
About
FLIMLib: a package for exponential curve fitting of fluorescence lifetime image data