apps.mobafit

apps.mobafit#

bartorch.apps.mobafit()#

Fit a signal model to reconstructed contrast images, voxel by voxel.

Levenberg-Marquardt over every voxel at once, each with its own damping and its own small linear system solved directly, over the model of a ModelOperator. The model is BlochSim’s, in its bounded parameterization, so the result is named maps in physical units rather than BART’s coefficients, and no iterate leaves the bounds. The answer is a local minimum that depends on the starting point.

Parameters:
  • images (torch.Tensor) – Contrast images (contrasts, *voxels), C order, in the order of the model’s acquisition, in any intensity units.

  • model (bartorch.nlop.ModelOperator) – Signal model of the acquisition, on the voxel shape of images: MultiEcho(), InversionRecovery() or Bloch().

  • iterations (int, default=20) – Levenberg-Marquardt steps; a voxel stops earlier once it has converged.

  • magnitude (bool, default=False) – Fit the model’s magnitude to the images’ magnitude (-a).

  • start (torch.Tensor, default=None) – Starting point in the model’s domain, as initial() packs it, with the amplitude in the units of images; built from **values when None.

  • **values – Starting values name=value in physical units, as initial() takes them.

Returns:

Fitted maps in physical units, keyed by unknown. Voxels whose data is zero in every contrast keep their starting values.

Return type:

dict of str to torch.Tensor

Notes

For a model with an amplitude, the images are divided by their peak magnitude for the fit and the amplitude is scaled back.

Examples

>>> M = nlop.MultiEcho([12.5 * (echo + 1) for echo in range(8)], (128, 128))
>>> maps = mobafit(images, M, T2=80.0)
>>> maps["T2"]

Examples using mobafit#

9. Nonlinear inversion for T2 mapping

9. Nonlinear inversion for T2 mapping

Parameter maps from scanner images

Parameter maps from scanner images