Skip to main content

flimkit-mufle

Spectral-temporal fluorescence unmixing for FLIMKit, in the style of MuFLE (Adams et al., IEEE TBME 2023; Biomed. Opt. Express 17(4):2176, 2026). It takes a multi-channel time-resolved emission dataset, fits it with a small number of components where each component is an emission spectrum plus a single fluorescence lifetime, and returns the unmixed components.

What it does

Input is a stack of decays, one per wavelength channel, shape (n_channels, n_bins). Each component is a smooth emission spectrum (cubic B-splines over wavelength) multiplied by an IRF-reconvolved single-exponential decay. Lifetimes are fitted by non-linear least squares. The spectral amplitudes are solved by non-negative least squares inside each step (variable projection), so spectra come out non-negative without extra constraints. Poisson weighting is used throughout.

Install

pip install -e .        # from this folder
pip install -e .[gui]   # adds matplotlib for the results window

FLIMKit discovers it through the flimkit.plugins entry point, so there's nothing else to wire up. On start it appears under Tools > Unmixing.

In the GUI

Tools > Unmixing > Spectral-Temporal Unmixing... picks a multi-channel file, asks how many components, runs the fit and shows the emission spectra and lifetimes.

Tools > Unmixing > Synthetic Unmixing Demo runs the whole thing on generated data with a known answer, so you can check it works without a file.

From code

from flimkit_mufle import fitMufle, unmixFile, spectral_stack

result = unmixFile('scan.ptu', n_components=2)
print(result['taus'], result['chi2_reduced'])

fitMufle(data, wavelengths, tcspc_res, irf, n_components, ...) is the core. It returns a dict with taus, spectra, amplitudes, background, model, residual and chi2_reduced.

spectral_stack(source) pulls a per-channel decay stack from any FLIMKit reader, or passes a numpy array straight through.

Validated

On synthetic data with two components at 0.5 ns and 3.0 ns the fit recovers 0.498 ns and 2.997 ns, spectral correlation 0.9999 and 1.0, reduced chi-square 1.05. See tests/.

Known limits

Channel indexing follows the reader. PTU channels are 0-based, Becker and Hickl are 1-based, so pass channels= if the defaults pick the wrong ones.

The IRF for a real file currently defaults to a Gaussian placeholder. Wiring it to FLIMKit's IRF tools, and to a per-channel IRF, is the next step.

Wavelength calibration is not read from file metadata yet. Without it the channel index is used as the axis.

It fits one summed spectrum at a time, a point or an ROI. Per-pixel spectral-temporal maps would need the GPU path.

Release files for flimkit-mufle 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flimkit-mufle 0.1.0
File Size Uploaded
flimkit_mufle-0.1.0.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flimkit-mufle 0.1.0
File Interpreter ABI Platform
flimkit_mufle-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / flimkit_mufle-0.1.0.tar.gz

Download URL flimkit_mufle-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e31084af052b34c8623c94c18682124cd3b28035878bd96205ea3357e18c5839
BLAKE2b-256 checksum
How to use checksums
db6dbdcdb234f7416c080f28c92b8bc6d880142f56c521fab947c6c98d8ed349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / flimkit_mufle-0.1.0-py3-none-any.whl

Download URL flimkit_mufle-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a958dee993cf4c68661283010c67d266f03ad34e4213198cb0b63f3cbffd9a3
BLAKE2b-256 checksum
How to use checksums
d832414a6826ddc55cdd6ca64d03c2e4f0fc8a99c0519679806e7678f585d9ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page