Skip to main content

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:

  1. A triple integral method that does a very fast estimate of a single exponential lifetime component.
  2. 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.
  3. 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

  1. Copy the executable to the test_files folder for convenience

    cp target/build/bin/flimlib-cmd ./test_files
    
  2. 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

flimlib-2.2.4.tar.gz (214.9 kB view details)

Uploaded Source

Built Distributions

flimlib-2.2.4-cp313-cp313-win_amd64.whl (145.2 kB view details)

Uploaded CPython 3.13Windows x86-64

flimlib-2.2.4-cp313-cp313-win32.whl (115.3 kB view details)

Uploaded CPython 3.13Windows x86

flimlib-2.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

flimlib-2.2.4-cp313-cp313-macosx_10_13_universal2.whl (368.5 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

flimlib-2.2.4-cp312-cp312-win_amd64.whl (145.2 kB view details)

Uploaded CPython 3.12Windows x86-64

flimlib-2.2.4-cp312-cp312-win32.whl (115.3 kB view details)

Uploaded CPython 3.12Windows x86

flimlib-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

flimlib-2.2.4-cp312-cp312-macosx_10_13_universal2.whl (368.5 kB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

flimlib-2.2.4-cp311-cp311-win_amd64.whl (145.2 kB view details)

Uploaded CPython 3.11Windows x86-64

flimlib-2.2.4-cp311-cp311-win32.whl (115.3 kB view details)

Uploaded CPython 3.11Windows x86

flimlib-2.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

flimlib-2.2.4-cp311-cp311-macosx_10_9_universal2.whl (367.2 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

flimlib-2.2.4-cp310-cp310-win_amd64.whl (145.2 kB view details)

Uploaded CPython 3.10Windows x86-64

flimlib-2.2.4-cp310-cp310-win32.whl (115.3 kB view details)

Uploaded CPython 3.10Windows x86

flimlib-2.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

flimlib-2.2.4-cp310-cp310-macosx_10_9_universal2.whl (367.2 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

flimlib-2.2.4-cp39-cp39-win_amd64.whl (145.1 kB view details)

Uploaded CPython 3.9Windows x86-64

flimlib-2.2.4-cp39-cp39-win32.whl (115.3 kB view details)

Uploaded CPython 3.9Windows x86

flimlib-2.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

flimlib-2.2.4-cp39-cp39-macosx_10_9_universal2.whl (367.2 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file flimlib-2.2.4.tar.gz.

File metadata

  • Download URL: flimlib-2.2.4.tar.gz
  • Upload date:
  • Size: 214.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4.tar.gz
Algorithm Hash digest
SHA256 19666ca4f13174bd50ca7d42992a72b87e1492a0f6ddba7f4bbe20c47b267185
MD5 2e25736533c0ff2c3ecc58d2c15eee60
BLAKE2b-256 1a5909f7a37b05b0a19407c02397ce441f9991e8e7b8c092595e9fa0ddcefd29

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 26fde1c8fae57921a86af55be998a345820636a64283d9bfa58b7db99757ca3e
MD5 a463513e437e4eb4798ce2e07ff5932a
BLAKE2b-256 7a4b0d1265e5606dd1357e1c06b30a410d95fb26ca2dec3b0a9dc2c1afcc13f3

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp313-cp313-win32.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp313-cp313-win32.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 0f85f428f1dd0861cbd2614351f6532582f33a25f0f9ea8863129ae8eb933ce2
MD5 974ca8b0290ed05c305e5d7ef9c719d6
BLAKE2b-256 b4f2df350020ca22034eaedb18ada9049327f99aa11c7eb3cebfaa075ceda7fa

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67d2c690f7b6d417102129938faeea0d02fc8304e71af36c75874919ad28ad6c
MD5 118e823aa4dd49a7d7dfd67b43ab4b49
BLAKE2b-256 d06278aa7cc611564bc6c820bfdbf61b75bddd239810ec05a00152c11edb2423

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c18d2a9c0fd34d437c8fe4f40fb7254c4263cbb816bb00591a9fa2d9d256728f
MD5 d6fdf854367bd44ea36b58e7a0bb4b3b
BLAKE2b-256 9eb4addfba29545ee12ff4334123f96745cd69a0758194f2162943d64ced7302

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9963f3079911819bd1a463725239c7c1d5dcdc713177af6ff508028e415e2d1b
MD5 ad937ee29fd297ec2edaafb4f6e92e19
BLAKE2b-256 c4053a420dba69bc0ba763e2a5f847ce4b0f2bbfca27ffd07abc1aa6ad325a2f

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp312-cp312-win32.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp312-cp312-win32.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 edfc10f9abe662bb3f208bfce1578acc2d63cfd79bd26d87615f273d90e45239
MD5 bc1af9c9e7e7457d9c0a9f17575e2f9e
BLAKE2b-256 880f95638fc5ceb19c04c5f8967864d99a483e9ec0807cd2a7a423a7edb3ba32

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5039c2e81c5a544281504892ebc29c953fce7d427883d1ce0940af738f4e58dd
MD5 a9929d8f8f10b4b4e17d8174591991d7
BLAKE2b-256 278ed1dc42e33489569ec741b22a2c0c374c7b12cb6c89102134fc67319c42ef

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e3a7329fc872d07ce3441f31dedf11292b2c2c7c2ea19f9c0ec4f1f53ed6f321
MD5 8f8ec70ffccb4abec629787b3820b8f8
BLAKE2b-256 db6f2f1135d294d204fd6f8396a4c59a9b9d897cd0c1325a9260010557bcb251

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a3dfb0c97ba42fd0ca5839793072e11b9fcda92921c4cc1323b2915dad0bfb9b
MD5 53a50713eb5ab2384eb7130de809cb23
BLAKE2b-256 83e25ec20486df33c36e5e365d087c93deae848383e3591306ea49d1113ff3f1

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp311-cp311-win32.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp311-cp311-win32.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 70da1c4518a324a9b775a22cd6a0ed798ceea93be4a71edf150e8353e2909bd7
MD5 5f4b8b8f283126044ce2fc9265b78c1e
BLAKE2b-256 7c9f09610fab1c4de83d7c644a75c4ae2d1a638e9cb660ef40007920d7d7c8b7

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af3c3fec83009733f898ad2cddec04e8949f8c76742e2e49b5601164bf61c79d
MD5 a04c4854ab4849cc5ac1d79c3581c65a
BLAKE2b-256 ee44e5357a4ef160e1b549d230964ff18a9a45be18f47ea58db01fa78265673a

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 84b28e519a416c193b9926f00ff95c49a3989d3f8abea6197a60d53f5a82d8f7
MD5 c610dd6d784b0e6e18aefc63967b12b5
BLAKE2b-256 7bbcea91640a09291d6ea16b6c0403ada412f6b5e1f0f9b180e0d9c8de6be133

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4e545a6e316b9550f75a30273caa50e1f61547afa7034e25be26c595acecec26
MD5 2ae6ba300e39c79ee58a6874269b4d49
BLAKE2b-256 831ea4ab9f615537a0439b55bd6e5c167eb6920f4d80abe5a70c4ce2fd73bdd1

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp310-cp310-win32.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp310-cp310-win32.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 7b78445f199f712445d7d5af341079eae92091f1ca091f09c869642f55b34c68
MD5 35fbcb811a2558c06350b4b79a8d5938
BLAKE2b-256 df4f33195063dfc2dabca97de448d34529c69c902652ee1c4104108e80925c61

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6fc12161097a7d9ad24225a3cbe54556a48d1fe26ef2e2bdf704246fee9a843
MD5 5155a993e00305b52cdf3d5c8426b6ab
BLAKE2b-256 9d3c88de8572c10a2a0d82004b65a0876f101b6b1659a6ae0b77bd6874f9dea0

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5e8a769f0d62f28a495a956e5ed16f11622248368c974cd32e1510cf9c2ee0bc
MD5 fd6dc06197c03773b0a4a1068178d48d
BLAKE2b-256 f330305dc5fe343aec46b3d4e6da67138e5a226f89c4f278a5e4d04eec83bd7d

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 145.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d22ff1551801e1eecc90e3b5dc1d367a499703cdbd6f9e98c0ab00e3ee21a1ba
MD5 335638c56bd1bfdcc6d564914d77b3ef
BLAKE2b-256 461c622fc6036c48b02e4310685ee9ff069e905bab4118e5e9a1b3031b22fbee

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp39-cp39-win32.whl.

File metadata

  • Download URL: flimlib-2.2.4-cp39-cp39-win32.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for flimlib-2.2.4-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 293862188d05b52d9e7f04d2bfe76ee7f0f20a41441239ce4c0a142c9daa22d0
MD5 8dae8f1fb065bfe88e1e67ffd21db5a9
BLAKE2b-256 773895902b1295fa961fd82ad19fbd46195b894febd5dbf1355af5457150028d

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc9227aa959ffab5d8093f701b3e4031abe69ab8f73f90a15ee304f18c3168ae
MD5 095d1011df9fb7bdc212cb94c918056f
BLAKE2b-256 a55da39e9b3879e5323329369cde13c83a517d85afaa9307fc4316d96c568b35

See more details on using hashes here.

File details

Details for the file flimlib-2.2.4-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for flimlib-2.2.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9471baef11157ce994b5e57a6814ec7b23292de1ac138450ca288d5253d2baed
MD5 a6c39765db8ffae864f808d61ffc1426
BLAKE2b-256 c589784767413c573af8a7642063528cf08bd3d68f5562e45d2349fa4de8a69f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page