mdreg.fit_2cm_lin#
- mdreg.fit_2cm_lin(signal: ndarray | Array, aif=None, time=None, baseline=1, path=None, memdim=2, parallel=False, progress_bar=False) Tuple[ndarray | Array, ndarray | Array] [source]#
Linearised 2-compartment model fit
- Parameters:
signal (numpy.ndarray | zarr.Array) – Array with signal intensities at different times. Dimensions are (x,y,t) or (x,y,z,t)
aif (numpy.ndarray) – Arterial input function. 1D array of input artery signal intensities, length equal to the number of time points in the signal data.
time (numpy.ndarray) – Timepoints of the signal data
baseline (int) – Baseline. Number of time points to use for the baseline signal. Default is 1.
path (str, optional) – Path on disk where to save the results. If no path is provided, the results are not saved to disk. Defaults to None.
memdim (int) – For zarrays, the number of array dimensions to be held in memory at any one time. This keyword is ignored when the argument is a numpy array. Possible values for memdim range from 0 (pixel-by-pixel processing) to ydata.ndim-1 (process the whole array at once). With memdim=1, data are loaded and processed row-by-row, with memdim=2 the are processed slice-by-slice, and so on. Default is 2.
parallel (bool) – Option to perform fitting in parallel. This is only available for zarrays when memdim is provided.
progress_bar (bool) – Set to True to display a progress bar during the computations. This is ignored if parallel=True.
- Returns:
fit (numpy.ndarray | zarr.Array) – Fit to the signal data with same dimensions as the signal array.
pars (numpy.ndarray | zarr.Array) – Fitted model parameters Fb, Tb, PS, Te. Dimensions are (x,y,4) or (x,y,z,4).