A python wrapper for flimlib's C functions
Project description
FLIMLib
FLIMLib is a curve fitting library used for Fluorescent Lifetime Imaging or FLIM. It is developed by Paul Barber (UCL and KCL, London) and the Advanced Technology Group at the Oxford Institute for Radiation Oncology, University of Oxford, as well as the Laboratory for Optical and Computational Instrumentation at the University of Wisconsin-Madison. FLIMLib is used for FLIM functionality in the Time Resolved Imaging (TRI2) software, as well as in the FLIMJ 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 single exponential lifetime component.
- A Levenberg-Marquardt algorithm or LMA that uses an iterative, least-squares-minimization approach to generate a fit. This works with single, double and triple exponential models, as well as stretched exponential.
- A Bayesian algorithm that combines evidence from each single photon to estimate lifetimes etc. It offers better performance with low photon counts.
There is also code to perform 'global' analysis over a number of signals simultaneously (e.g. over an image), where the lifetimes can be considered constant across the data set, but the amplitudes are allowed to vary for each signal. There is also a completely generic global analysis function. A third algorithm is available to perform phasor analysis.
In addition there is a non-negative linear least squares algorithm that is useful for spectral unmixing in combined spectral-lifetime imaging (SLIM).
The FLIMLib library code is written in C89 compatible C and is thread-safe for
fitting multiple pixels concurrently. A Java interface (generated by
SWIG is privided to call the library from Java
code: FLIMLib.java
provide a subset of function calls used by the FLIMJ
plugin for ImageJ.
Additionally, there is wrapper code in FLIMLib.i
to wrap the external
functions in flimlib.def
. This code generates swig wrapper files which enable
you to call these functions from Java.
See also
Directory contents
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 |
Building the source (C++/Java)
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++ Desktop Development) on Windows) to be installed.
To build the library and standalone program using maven:
mvn clean install
Running the standalone executable
-
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
Using from a Java project
To depend on FLIMLib from Maven, simply copy the following to appropriate places in your pom.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 parent scijava
pom (${scijava.natives.classifier}
) or manually filled in to match your platform.
Using from Python
The Python API is a ctypes-based wrapper around a few of the library functions.
pip install flimlib
import flimlib
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 lifetime determination)flimlib.GCI_Phasor()
(phasor analysis)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file flimlib-2.2.3.tar.gz
.
File metadata
- Download URL: flimlib-2.2.3.tar.gz
- Upload date:
- Size: 212.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cbbf2a727a378b6e3aff969ad264825fca7b5b7bb566cc00e8abf5c6d0fca62 |
|
MD5 | 4d921fe51569186bc44735e079a00f79 |
|
BLAKE2b-256 | 02c0f2a5bf5bb6be54c3c0b16bfd162d42d09f172f8f6cb873004fb2afd2fed0 |
File details
Details for the file flimlib-2.2.3-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 145.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0132b8063e4f3f9a801f3ee2b81f0fbbffe89970bf3ea2aa31ab890804baca |
|
MD5 | 897ba83436124d76bd2d61ea93e44676 |
|
BLAKE2b-256 | a2ccd253488e7aaa880aa43b7502a536de1705857f245ea6eaa02087ecb6eb2b |
File details
Details for the file flimlib-2.2.3-cp311-cp311-win32.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp311-cp311-win32.whl
- Upload date:
- Size: 113.8 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b41e88f14b71155958bfc7d18e8a8989bbaf498acd5f447dceddf3be8bc2fe |
|
MD5 | 29dd24eb6b9e8f3eb402e0375e7c0ac5 |
|
BLAKE2b-256 | 7298fc4e7ffde64473821a3667af7c788765d0c4b76693f7a8d8666c92473cab |
File details
Details for the file flimlib-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 508.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c03bcc8770075844a6843dd84ae6d7d9b36857b8a55d47155e3add6e907cab4b |
|
MD5 | ef8e04eb9ba4aedf679111f3f58f363e |
|
BLAKE2b-256 | 29398fa79e37b6fb788d11ed2f557b1e91780e1fc5db40e713531adc327ba88b |
File details
Details for the file flimlib-2.2.3-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 374.6 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaeea56de05a56b2dcc4107ffdb099d75bc2a4b2b4911aa47ce258e0bb257451 |
|
MD5 | f8da3a9d9304e484e01929d3fd975e59 |
|
BLAKE2b-256 | 6cf4041ebbd2c7bddde07c1a825d942f02fdceed0764d69d15437ccb56737cad |
File details
Details for the file flimlib-2.2.3-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 145.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07a4cabe2ea808fe778e92a1a8469234efe5e699b42ab08377ff35cb5a66c1d5 |
|
MD5 | 549520d4d1e0764615b1fca4b916dfbc |
|
BLAKE2b-256 | f5acf846ae05dce29b7fbf16de49e9c606806660212c092d1e22c4b155730790 |
File details
Details for the file flimlib-2.2.3-cp310-cp310-win32.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp310-cp310-win32.whl
- Upload date:
- Size: 113.8 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a16fd4daf5709e15fd67dfcb36a3e1fdb618fe26b0715db556955f7570f51b5e |
|
MD5 | b4c1ad9c180f34c285e6191fd090f352 |
|
BLAKE2b-256 | aaa84d2ce0889b2b925046e85300f9c332920a93e4358fa6d072b5236cf9059c |
File details
Details for the file flimlib-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 508.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b5e562034d2c6056e27fb1f16e06f07887ad9d06b6e2caa373ceebd9f60dc74 |
|
MD5 | b97f1ba836cf8bbefbf84e2eab311caa |
|
BLAKE2b-256 | 68dec58e740624f99189429c3ea487318ae57282a1456daae14433e55ca94b2f |
File details
Details for the file flimlib-2.2.3-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 374.6 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad495429d9b98a139a6db4758ebc9296758a297a10e908e33a2c4de94e611f5 |
|
MD5 | 124b34395040ca69910391a4d946c1ad |
|
BLAKE2b-256 | f7c35e8984096447bbbd4a589d5c895e0c6d650222d92799baab2c90d376dd8b |
File details
Details for the file flimlib-2.2.3-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 145.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2dc34dfcf6bd67746b0e570027fbab5cada84552626e6d72ae4fdacbc51a5ee |
|
MD5 | 53f3a0a527a7bf19b8b071658c956cdd |
|
BLAKE2b-256 | 5dd4fbd8bd9d0e552692e308b70a7168bb62ff93355c436c3f6e87cf4f066089 |
File details
Details for the file flimlib-2.2.3-cp39-cp39-win32.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp39-cp39-win32.whl
- Upload date:
- Size: 113.8 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0929f3d0d52a8c86aaf821490055f4333147f9d3003bbea24970bc150c21a6ac |
|
MD5 | b7fc40d5074785d249ec7b4239260a2a |
|
BLAKE2b-256 | 7779cc60890b27af373099536e95c0fffbd6a232d94e2ef17aa8cb508119a194 |
File details
Details for the file flimlib-2.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 508.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f136a443d1022519798e197090291d75d1aadb1bb6e71a3e335b659bd4be22ac |
|
MD5 | 74634e5bcdbe77113a0f89ec335dcb38 |
|
BLAKE2b-256 | e7e70875d8f7566d9dae5022466e76d537acb865eac7ab7043e85440252e350e |
File details
Details for the file flimlib-2.2.3-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 374.6 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36828b276f9b66b6eeeedb56d134a813bd354362f176d14b45f164fff3dcb118 |
|
MD5 | ced0ceec8f7ec209a9fb4c8182f94585 |
|
BLAKE2b-256 | ec58da66b41242831d0a3f65656a84e10439b339a1f9f5eb8a785ee4cfea8387 |
File details
Details for the file flimlib-2.2.3-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 145.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fb6cee29987b40472fa7845473e59c514ae2ca88c965fead90ddf938ec85e6 |
|
MD5 | 59940aeb172aa0bb5a777c112b07d462 |
|
BLAKE2b-256 | 8b0c95346ac2dfe8db8866f400c8bc1285ff00d35d1b443fbb4ce697ba7b4345 |
File details
Details for the file flimlib-2.2.3-cp38-cp38-win32.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp38-cp38-win32.whl
- Upload date:
- Size: 113.7 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fdf35b5419fd0876c9d6c5b0e4bec4390dacfa04ac610d1a584f2efa6b4d155 |
|
MD5 | cf5ae48751b57b1229d2e771c8a810f9 |
|
BLAKE2b-256 | 6db725539bbd805fa91365421cb9e4fa9fad32c57acb797f6656eeb22dd750f2 |
File details
Details for the file flimlib-2.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 508.4 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe052a50c84038ff0921fc2b038e9bb8630d9b397a137e09a80e475ffb2a0243 |
|
MD5 | 6d002442344db9a2454ab5dc2c6e1487 |
|
BLAKE2b-256 | 154a13062b822d836dc7aaf2fa4baee3d48c8c2ceeeafa555c01345dcc1131fb |
File details
Details for the file flimlib-2.2.3-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: flimlib-2.2.3-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 374.6 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a8922d6ceed279491bd096cbc03e4cfc2784340e743a6c2cafa9dd5837a4fe |
|
MD5 | 432ef7421cd64b80ee327c4acbc76c0e |
|
BLAKE2b-256 | 7920932b87d5c7dac69e576b232c44b251ec3ef7321b0365c4ad2901158bc3e8 |