mdreg.fit_pixels#

mdreg.fit_pixels(ydata, model=None, xdata=None, func_init=<function _func_init>, bounds=(-inf, inf), p0=None, parallel=False, progress_bar=False, **kwargs)[source]#

Fit a model pixel-wise

Parameters:
  • ydata (numpy.ndarray) – 2D or 3D array of signal intensities

  • model (function) – Model function to fit to the data

  • xdata (numpy.ndarray) – Independent variable for the model

  • func_init (function) – Function to initialize the model parameters

  • bounds (tuple) – Bounds for the model parameters

  • p0 (numpy.ndarray) – Initial guess for the model parameters

  • parallel (bool) – Option to perform fitting in parallel

  • progress_bar (bool) – Option to display a progress bar

  • **kwargs (Additional arguments to pass to the curve_fit function)

Returns:

  • fit (numpy.ndarray) – Fitted model to the data

  • par (numpy.ndarray) – Fitted model parameters