Skip to content

config

config

Registry-driven config models for IVIM selection points.

Each IVIM selection point — the fitting strategy (segmented / full / Bayesian) and the signal model (bi-exponential / simplified) — declares its tunable knobs as a :class:~osipy.common.config.MethodConfig. These compose into discriminated unions for the CLI config (so selecting a method/model surfaces exactly that option's parameters and rejects cross-method keys), and the matching registries build the live component from a validated config instance.

Mirrors :mod:osipy.asl.config and :mod:osipy.dce.config. Adding @register_ivim_fitter / @register_ivim_model plus an entry here automatically surfaces the new option (and its knobs) as a CLI toggle that both validates input and builds the component — an option can never be "collected but silently ignored".

Notes
  • The fitting strategy is discriminated by method. Shared knobs (max_iterations, tolerance, bounds, initial_guess, normalize_signal) live on every strategy; b_threshold appears only on the methods that use it (segmented + Bayesian — the full strategy fits all b-values jointly and sets the threshold to 0 internally), and the Bayesian prior knobs (prior_scale, noise_std, compute_uncertainty) appear only for Bayesian.
  • The signal model is discriminated by model. The bi-exponential model carries no constructor knobs; the simplified model exposes its b_threshold (above which the perfusion term is treated as negligible).
References

.. [1] OSIPI CAPLEX, https://osipi.github.io/OSIPI_CAPLEX/ .. [2] Le Bihan D et al. (1988). Radiology 168(2):497-505. .. [3] Dickie BR et al. MRM 2024;91(5):1761-1773. doi:10.1002/mrm.29840

SegmentedFittingConfig

Bases: _IVIMFittingBase

Two-step (segmented) IVIM fitting.

FullFittingConfig

Bases: _IVIMFittingBase

Full bi-exponential IVIM fitting (all b-values jointly).

The full strategy fits every b-value at once and uses no segmentation threshold, so b_threshold is intentionally absent.

BayesianFittingConfig

Bases: _IVIMFittingBase

Two-stage Bayesian MAP IVIM fitting with empirical priors.

BiexponentialModelConfig

Bases: MethodConfig

IVIM bi-exponential signal model: S0, D, D*, f.

SimplifiedModelConfig

Bases: MethodConfig

IVIM simplified signal model: S0, D, f (assumes D* >> D).