pyfli.laguerre.laguerre_method#

Implement Laguerre-basis deconvolution for FLI decay reconstruction.

This module belongs to pyfli.laguerre and is part of PyFLI’s Laguerre-basis deconvolution and fitting method. Public API includes classes LaguerreFLI.

Classes

LaguerreFLI([n_components, n_laguerre, ...])

Run the laguerre FLI routine.

class LaguerreFLI(n_components=2, n_laguerre=None, alpha=0.85, dt=1.0, auto_alpha=False, taus_init=None, laser_period_ns=None, reg_strength=0.0, reg_power=2.0, nonneg=True, verbose=True)[source]#

Bases: object

Run the laguerre FLI routine. Laguerre basis, projects decays into coefficient space, reconstructs denoised decays, and supports lifetime estimation from the reconstructed signal.

Parameters:
  • n_components (int) – Number of exponential lifetime components to fit.

  • n_laguerre (Optional[int]) – Number of Laguerre basis functions used for reconstruction.

  • alpha (float) – Regularization strength or statistical threshold value, depending on context.

  • dt (float) – Sampling interval between adjacent decay bins.

  • auto_alpha (bool) – If True, estimate the Laguerre alpha parameter from the data.

  • taus_init (Optional[np.ndarray]) – Initial lifetime estimates used to seed exponential fitting.

  • laser_period_ns (Optional[float]) – Laser repetition period in nanoseconds.

  • reg_strength (float) – Regularization weight applied to higher-order Laguerre coefficients.

  • reg_power (float) – Exponent controlling how regularization increases across coefficient order.

  • nonneg (bool) – If True, constrain fitted coefficients or amplitudes to be non-negative.

  • verbose (bool) – If True, report progress and diagnostic messages during processing.

fit(decay, irf, mask=None)[source]#

Fit the model to decay and IRF data.

Parameters:
  • decay (np.ndarray) – Time-resolved decay signal or decay cube.

  • irf (np.ndarray) – Instrument response function aligned with the decay signal.

  • mask (Optional[np.ndarray]) – Boolean or labeled mask selecting pixels for the operation.

Returns:

Object produced by fit.

Return type:

'LaguerreFLI'

get_parameters(data_name='LaguerreFLI_Dataset')[source]#

Return parameters.

Parameters:

data_name (str) – Label assigned to the fitted or processed dataset.

Returns:

Dictionary containing the data produced by get parameters.

Return type:

dict

save_results(dataset, folder='results')[source]#

Save results.

Parameters:
  • dataset (dict) – Dataset dictionary or fit result collection to save.

  • folder (str) – Output directory used when saving results.

Returns:

No object is returned; the function save results.

Return type:

None

load_map(h5_path, map_name='tau1_map')[source]#

Load a map from a .h5 file.

Parameters:
  • h5_path (str) – Filesystem path used by the routine.

  • map_name (str) – Name of the saved parameter map to load.

Returns:

Map array loaded from disk.

Return type:

Optional[np.ndarray]

predict()[source]#

Return reconstructed value.

Returns:

Reconstructed decay array predicted from the fitted Laguerre model.

Return type:

np.ndarray