Skip to content

binding

binding

ASL binding adapter for the shared fitting infrastructure.

BoundASLModel wraps the Buxton pCASL model with PLDs, M0, and labeling parameters, producing a FittableModel that the shared fitter can use without knowing about ASL-specific context.

BoundASLModel

BoundASLModel(params, fixed=None, model=None)

Bases: BaseBoundModel

ASL model with PLDs and labeling parameters bound.

Wraps the Buxton pCASL model so the fitter only sees predict_array_batch(free_params) -> output.

The model always predicts with unit M0 (M0=1). Callers must normalize observed delta-M by M0 before fitting so that the fitter works on M0-normalized data. This avoids per-voxel side-channels that are incompatible with active-voxel tracking in the LM fitter.

PARAMETER DESCRIPTION
params

ASL quantification parameters (PLDs, label duration, T1s, etc.).

TYPE: MultiPLDParams

fixed

Parameters to fix at constant values during fitting.

TYPE: dict[str, float] | None DEFAULT: None

model

ASL signal model to use. If None, defaults to BuxtonMultiPLDModel.

TYPE: BaseASLModel | None DEFAULT: None

ensure_device

ensure_device(xp)

Transfer PLD array to the target device.

predict_array_batch

predict_array_batch(free_params_batch, xp)

Predict M0-normalized delta-M for a batch of voxels.

PARAMETER DESCRIPTION
free_params_batch

Free parameter values, shape (n_free, n_voxels).

TYPE: NDArray

xp

Array module.

TYPE: module

RETURNS DESCRIPTION
NDArray

Predicted delta-M/M0, shape (n_plds, n_voxels).

get_initial_guess_batch

get_initial_guess_batch(observed_batch, xp)

Get initial parameter guesses from signal shape.

PARAMETER DESCRIPTION
observed_batch

Observed data, shape (n_plds, n_voxels).

TYPE: NDArray

xp

Array module.

TYPE: module

RETURNS DESCRIPTION
NDArray

Initial guesses, shape (n_free, n_voxels).