Plugins / FLIMKit / Configuration Reference · edit on GitHub
Configuration Reference
All defaults live in flimkit/configs.py and can be overridden via CLI args or the GUI.
Fitting Defaults
| Parameter | Default | Description |
|---|---|---|
Tau_min |
0.145 ns | Lower lifetime bound |
Tau_max |
45.0 ns | Upper lifetime bound |
n_exp |
3 | Number of exponential components |
D_mode |
'both' |
Fitting mode: 'summed', 'perPixel', or 'both' |
binning_factor |
1 | Spatial binning for per-pixel fitting |
Optimizer |
'de' |
'de' (Differential Evolution) or 'lm_multistart' |
MIN_PHOTONS_PERPIX |
10 | Minimum photons for per-pixel fitting |
OUT_NAME |
'flim_out' |
Default output prefix |
Phasor Filtering Defaults
| Parameter | Default | Description |
|---|---|---|
PHASOR_FILTER |
None |
Filter method: 'gaussian', 'median', 'wavelet', or None |
PHASOR_FILTER_SIGMA |
1.0 | Gaussian σ in pixels |
PHASOR_FILTER_SIZE |
3 | Median filter kernel size (pixels) |
PHASOR_FILTER_WAVELET |
'db4' |
Wavelet family for wavelet denoising |
PHASOR_FILTER_LEVEL |
1 | Wavelet decomposition level |
Optimiser Settings
| Parameter | Default | Description |
|---|---|---|
lm_restarts |
8 | Levenberg-Marquardt multi-start restarts |
de_population |
30 | DE population size |
de_maxiter |
5000 | DE maximum iterations |
n_workers |
-1 (source) / 1 (compiled) | CPU cores for DE; capped at 1 in the compiled app to avoid multiprocessing issues |
Display Range Settings
Pixel values outside the range are clamped to the boundary, not zeroed.
| Parameter | Default | Description |
|---|---|---|
TAU_DISPLAY_MIN |
None |
Min lifetime (ns) for tau images |
TAU_DISPLAY_MAX |
None |
Max lifetime (ns) for tau images |
INTENSITY_DISPLAY_MIN |
None |
Min photon count for intensity images |
INTENSITY_DISPLAY_MAX |
None |
Max photon count for intensity images |
Machine IRF Settings
| Parameter | Default | Description |
|---|---|---|
MACHINE_IRF_DIR |
flimkit/machine_irf (source) / ~/.flimkit/machine_irf (compiled) |
Storage directory |
MACHINE_IRF_DEFAULT_PATH |
The Preferences choice if set, else the user copy if present, else the bundled default | Resolved at startup, and again when Preferences are saved |
MACHINE_IRF_ALIGN_ANCHOR |
'peak' |
Alignment landmark during IRF construction |
MACHINE_IRF_REDUCER |
'median' |
Aggregation method across paired IRFs |
MACHINE_IRF_FIT_STRATEGY |
'fixed' |
Runtime fitting strategy |
MACHINE_IRF_FIT_BG |
True |
Fit background offset |
MACHINE_IRF_FIT_SIGMA |
False |
Fit Gaussian broadening |
MACHINE_IRF_FIT_TAIL |
False |
Fit exponential tail |
Cost Functions
| Function | Description |
|---|---|
poisson |
Poisson deviance (C-statistic). Recommended |
chi2 |
Neyman chi-squared (legacy) |
Fit Diagnostics
The cost function above selects the optimizer objective. The fields below are post-fit diagnostics and do not change how the model is fitted.
The existing reduced_chi2_pearson, reduced_chi2_tail_pearson, and per-pixel
chi2_r fields are retained for compatibility with historical Leica LAS X
comparisons. Their one-count model floor means they are not generally expected
to equal one for sparse decays.
calibrated_chi2_pearson, calibrated_chi2_tail_pearson, and the per-pixel
calibrated_chi2_r map divide the same residual sum by its expected
contribution under a fixed Poisson model:
$$Q_{\mathrm{cal}} = \frac{\sum_i (Y_i-m_i)^2/\max(m_i,1)}{\sum_i \min(m_i,1)}.$$
The fixed-model expectation is one. Parameter fitting and data-selected windows can introduce a smaller additional shift, so this diagnostic is not a classical chi-square p-value.
Parameter uncertainties
Every summed fit (reconvolution, tail and distribution) reports a 1σ standard
error for each lifetime, amplitude and amplitude fraction, both mean lifetimes,
the IRF shift and the fitted background, in fields ending _err. They come from
the curvature of the fit at its solution. The model's derivatives over the fit
window, weighted by the Poisson variance of each bin, give the Fisher
information, and its inverse is the covariance. A parameter sitting on one of
its bounds is treated as fixed and has no error. tau_corr holds the
correlation between the lifetimes.
On ATTO488 (2.46 million photons) the tail fit gives 4.187 ± 0.0034 ns, where SymPhoTime 64's bootstrap gives 4.189 ± 0.0029 ns. Over 20 simulated 1-exponential decays (τ = 2.5 ns, 200,000 photons) the predicted error was 0.0061 ns and the spread of the fitted values was 0.0057 ns. For 2-exponential decays (3.0 and 0.8 ns) the prediction was about 1.4 times the spread, so it errs large there.
These are local estimates. They can't see a different solution elsewhere that fits just as well, so for a 3-exponential fit they are a lower bound on the real uncertainty.
The bootstrap doesn't have that problem. It draws a new Poisson count for every
bin of the measured decay, refits with the same settings and fit window, and
repeats (25 times by default, seeded so the same data gives the same errors).
The spread of the refitted lifetimes is the error, and the 16th and 84th
percentiles give a range that doesn't have to be symmetric. The summary holds
them as taus_ns_boot_err, taus_ns_boot_lo and taus_ns_boot_hi
(tau_centers_ns_... for a distribution fit). The GUI, fit_cli.py and the
guided terminal UI run it by default for single FOV, stitched and ROI fits.
From Python it is off unless you pass bootstrap=25 to fit_summed,
fit_summed_tail or fit_summed_dist. Batch, timelapse and z-stack fits don't
run it.
For a synthetic 3-exponential decay (4.06, 1.36 and 0.71 ns, one million photons) fitted 16 times with fresh noise, τ2 scattered by 51% and τ3 by 24%. On one of those decays the curvature errors were 5.8% and 26%, and the bootstrap gave 24% and 33%, with both true values inside its 16th to 84th percentile range. On a 1-exponential decay the two agree (both 0.1%), and on ATTO488 the bootstrap gives ±0.0038 ns against SymPhoTime 64's ±0.0029 ns.
A lifetime with more than 10% relative error, or two lifetimes correlated beyond |r| = 0.95, adds a ⚠ row to the Fit Summary and a warning to the terminal output. When the bootstrap has run, these use its errors and correlations.