linop.CartesianSense

linop.CartesianSense#

bartorch.linop.CartesianSense()#

Cartesian SENSE encoding operator.

\[A = P F S\]

with \(S\) the coil sensitivities, \(F\) the centred unitary FFT over the spatial axes and \(P\) the sampling pattern. With a temporal basis \(\Phi\) (coeffs, frames) the image holds subspace coefficients (T2 shuffling):

\[y[c, t] = P[t] \odot \sum_a \Phi[a, t] \, F(S[c] \odot x[a])\]

The pattern and the basis are applied inside the coil-slab loop of NoncartesianSense, whose remaining keyword arguments are accepted.

Parameters:
  • sensitivities (tensor) – Coil sensitivities ([batch, sets,] coils, [z,] y, x), or k-space kernels with kernels=True.

  • image_shape (tuple of int) – (*batches, [batch,] [sets,] [coeffs,] [z,] y, x). The samples are (*batches, [batch,] coils, [frames,] [z,] y, x).

  • pattern (tensor, default=None) – Binary sampling mask broadcast over one coil’s samples ([frames,] [z,] y, x); (y, 1) samples whole readouts.

  • positions (tensor, default=None) – Alternative to pattern: integer indices of the acquired phase encodes, ([frames,] shots, d) with d indexing (y,) in 2D or (z, y) in 3D, and -1 padding frames with fewer shots. The samples are then (*batches, [batch,] coils, [frames,] shots, x).

  • readout ({"kspace", "image"}, default='kspace') – With positions, whether the samples are in k-space along the readout or already inverse-transformed along it (hybrid space).

  • basis (tensor, default=None) – Temporal subspace basis (coeffs, frames).

  • toeplitz (bool, default=True) – With a pattern, positions or a basis, apply the normal in closed form (see Notes) rather than as the forward and adjoint applications.

  • kernels (bool, default=False) – Read sensitivities as k-space kernels.

  • coil_batch (int, default=1) – Coils per slab; 0 applies all coils at once.

  • modulated (bool, default=False) – Use BART’s uncentred sample convention (an fftmod on the sample axes) instead of the centred one bartorch.fft() produces.

  • device (torch.device or str, default=None) – Device the operator is built and computes on; None takes the sensitivities’.

  • ndim (int, default=None) – Number of spatial axes (2 or 3) where the sensitivities and the image do not determine it.

  • kspace_shape (tuple of int, default=None) – Sample shape, which must be the default above.

  • fold_maps (bool, default=True) – Apply the sensitivities inside the normal’s transform where possible.

Return type:

LinearOperator

Raises:
  • ValueError – When traj is given, when both pattern and positions are, or when readout is "image" without positions.

  • NotImplementedError – For positions with modulated=True.

Notes

The Toeplitz normal is

\[(A^H A x)[a'] = \sum_a \Big( \sum_t |P[t]|^2 \, \overline{\Phi[a', t]} \, \Phi[a, t] \Big) x[a]\]

with the kernel in parentheses applied in k-space, between transforms along only the axes the pattern varies on. The sum over frames is computed once at build time, so iterations never form the frames, and a pattern constant along the readout is never transformed along it. The modulated convention differs by a unit-modulus phase on the samples and leaves the normal unchanged.

Examples

>>> A = CartesianSense(maps, (y, x), pattern=mask)          # mask (y, 1)
>>> x = bartorch.optim.CG(maxiter=30)(kspace, A)
>>> A = CartesianSense(maps, (4, y, x), pattern=mask, basis=phi)
>>> A.ishape, A.oshape                                       # phi (4, 64)
((4, y, x), (coils, 64, y, x))

Examples using CartesianSense#

6. Custom encoding and solver

6. Custom encoding and solver

9. Nonlinear inversion for T2 mapping

9. Nonlinear inversion for T2 mapping

10. Plug-and-play reconstruction

10. Plug-and-play reconstruction

11. Training an unrolled network

11. Training an unrolled network

Staged training of an unrolled network

Staged training of an unrolled network

Training without a reference

Training without a reference

Annealed plug-and-play

Annealed plug-and-play

Uncertainty estimation

Uncertainty estimation