Skip to content

bayesian_ivim

bayesian_ivim

Two-stage Bayesian IVIM fitting with empirical priors.

Implements the Barbieri et al. (MRM 2020) approach: 1. Stage 1: Least-squares fit on all voxels 2. Build empirical per-parameter priors from the population of Stage 1 fits 3. Stage 2: MAP fitting with empirical priors and per-voxel initial guesses

References

.. [1] Barbieri S et al. MRM 2020;83(6):2160-2172. doi:10.1002/mrm.28060

TwoStageBayesianIVIMFitter

TwoStageBayesianIVIMFitter(
    noise_std=None,
    compute_uncertainty=False,
    prior_scale=1.5,
    stage1_max_iter=100,
)

Two-stage Bayesian IVIM fitter with empirical priors.

Stage 1 runs a standard Levenberg-Marquardt fit to obtain point estimates. Those estimates are used to build per-parameter empirical priors (mean + std). Stage 2 runs a Bayesian MAP fit using those priors as regularization.

PARAMETER DESCRIPTION
noise_std

Assumed noise standard deviation. If None, estimated from data.

TYPE: float | None DEFAULT: None

compute_uncertainty

If True, compute posterior uncertainty maps via Laplace approximation after Stage 2.

TYPE: bool DEFAULT: False

prior_scale

Scale factor applied to empirical prior standard deviations. Larger values create weaker priors. Default 1.5.

TYPE: float DEFAULT: 1.5

stage1_max_iter

Maximum iterations for Stage 1 LM fitting.

TYPE: int DEFAULT: 100

fit_image

fit_image(
    model,
    data,
    mask=None,
    bounds_override=None,
    progress_callback=None,
)

Fit IVIM model using two-stage Bayesian approach.

PARAMETER DESCRIPTION
model

Bound IVIM model.

TYPE: FittableModel

data

Image data, shape (x, y, z, n_observations).

TYPE: NDArray

mask

Boolean mask.

TYPE: NDArray[bool_] | None DEFAULT: None

bounds_override

Per-parameter bound overrides.

TYPE: dict DEFAULT: None

progress_callback

Progress callback (0.0 to 1.0).

TYPE: Callable DEFAULT: None

RETURNS DESCRIPTION
dict[str, ParameterMap]

Parameter maps.