binding
binding
¶
IVIM binding adapter for the shared fitting infrastructure.
BoundIVIMModel wraps an IVIMModel together with b-values,
producing a FittableModel that the shared fitter can use without
knowing about IVIM-specific context.
Provides an analytical Jacobian for efficient Levenberg-Marquardt optimization.
BoundIVIMModel
¶
Bases: BaseBoundModel
IVIM model with b-values bound.
Wraps an IVIMModel so the fitter only sees
predict_array_batch(free_params) -> output.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
IVIM signal model.
TYPE:
|
b_values
|
Diffusion weighting values in s/mm^2.
TYPE:
|
fixed
|
Parameters to fix at constant values during fitting.
TYPE:
|
b_threshold
|
b-value threshold for segmented initial guess estimation.
TYPE:
|
predict_array_batch
¶
Predict signal for a batch of voxels.
| PARAMETER | DESCRIPTION |
|---|---|
free_params_batch
|
Free parameter values, shape
TYPE:
|
xp
|
Array module.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray
|
Predicted signal, shape |
get_initial_guess_batch
¶
Get initial parameter guesses using segmented approach.
Uses log-linear fit at high b-values for D, heuristic for f and D*, and b=0 signal for S0.
| PARAMETER | DESCRIPTION |
|---|---|
observed_batch
|
Observed data, shape
TYPE:
|
xp
|
Array module.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray
|
Initial guesses, shape |
compute_jacobian_batch
¶
Compute analytical Jacobian for IVIM bi-exponential model.
Only computes columns for free (non-fixed) parameters.
| PARAMETER | DESCRIPTION |
|---|---|
params_batch
|
Free parameter values, shape
TYPE:
|
predicted
|
Predicted signal, shape
TYPE:
|
xp
|
Array module.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray
|
Jacobian, shape |