nlop.NonlinearSense#

class bartorch.nlop.NonlinearSense#

Bases: NonlinearOperator

Joint image and coil-sensitivity forward model, BART’s noir.

The operator has two inputs, the image and the coil representation, and one output, the data. Its derivative with respect to either input is a linear operator (linearize()), and a Gauss-Newton step solves the linearized problem over both jointly.

The coil unknown is not the sensitivity maps. It is a k-space representation \(\hat{s}\) of them, from which the maps follow by the Sobolev weighting

\[S = \mathcal{F}^{-1} \left[ \, \kappa \, (1 + a |k|^2)^{-b/2} \, \hat{s} \, \right]\]

with sobolev giving \((a, b)\) and c the scale \(\kappa\) (BART’s noir_calc_weights). The weighting is part of the model, so the estimated variable is smoothness-regularized by construction and the Gauss-Newton step needs no separate penalty on the coils. coils is the linear operator mapping fitted coefficients to sensitivities.

Off the grid the model is asymmetric, as BART builds it: it returns gridded coil images rather than samples, so a measurement must be gridded to match. prepare() does that, and is a no-op on a grid, where the model returns k-space directly.

Parameters:
  • image_shape (tuple of int) – Coil-image shape, (coils, *spatial), C order – the same shape the linear encodings take. The image itself is this with one coil.

  • pattern (tensor, default=None) – Binary sampling mask, one at acquired positions and zero elsewhere, on a grid. Without one the acquisition is treated as fully sampled.

  • trajectory (tensor, default=None) – Trajectory (..., samples, 3) in grid units, kx, ky, kz, as bartorch.tools.traj() produces. Giving one selects the non-Cartesian model.

  • kspace_shape (tuple of int, default=None) – Sample shape. Off the grid it defaults to the trajectory’s with the image’s coil axes in front, as the NUFFT’s does; on the grid it is the coil-image shape.

  • coil_shape (tuple of int, default=None) – Where the sensitivities live and where their coefficients do; both default to the coil-image shape.

  • coefficient_shape (tuple of int, default=None) – Where the sensitivities live and where their coefficients do; both default to the coil-image shape.

  • weights (tensor, default=None) – Diagonal in k-space applied to the samples, off the grid; its conjugate is applied on the adjoint.

  • basis (tensor, default=None) – Temporal subspace basis (coeffs, frames) over the last encoding axis, off the grid. The Cartesian model does not take one.

  • mask (tensor, default=None) – A support the image is restricted to.

  • sobolev (tuple of float, default=(220.0, 32.0)) – (a, b) of the coil weighting c (1 + a |k|^2)^(-b/2); BART’s 220, 32.

  • c (float, default=1.0) – The scale on that weighting, BART’s 1.

  • real (bool, default=False) – Constrain the image to be real.

  • sos (bool, default=False) – BART’s sum-of-squares variant of the coil weighting.

  • oversampling_coils (float, default=None) – Fit the coils on a finer grid than the image. By default whichever nlinv uses: two off the grid, one on it.

  • oversampled_coils (bool, default=False) – Return them on that grid rather than on the image’s.

  • toeplitz (bool, default=True) – Apply the normal in closed form rather than as the forward and adjoint applications: a convolution with a point spread function, off the grid.

  • optimized (bool, default=False) – BART’s noir2_noncart_optimized_create, off the grid.

Examples

>>> F = NonlinearSense((8, 128, 128), pattern=mask)
>>> F.ishapes
((1, 128, 128), (8, 128, 128))
>>> image, coefficients = nlop.IRGNM()(kspace, F)
property coils#

the Sobolev weighting and the transform.

A fit returns coefficients; applying this operator gives the sensitivity maps they represent.

Type:

Coil coefficients to sensitivities

property image#

The image’s own linear part – the mask, and the real constraint if asked for.

property data#

From what the model returns to the measurement.

Off the grid this is the NUFFT, whose adjoint grids a measurement into the coil images the model returns; on the grid it is the identity. prepare() is the one call that matters.

property transform#

The transform from coil images to k-space, without the model in front of it.

prepare()#

The measurement in the shape the model returns.

Off the grid this is nufft^H(kspace), as noir2_recon applies before the first Gauss-Newton step; on the grid the measurement is returned unchanged.

Also has the methods and properties of NonlinearOperator.

Examples using NonlinearSense#

Nonlinear inversion

Nonlinear inversion