apps.pics

apps.pics#

bartorch.apps.pics()#

Parallel-imaging compressed-sensing reconstruction.

The pipeline BART’s pics command runs, assembled here: the sampling pattern applied to the k-space, the modulation into the convention BART iterates in, the scaling estimated from what is left, and then an encoding from bartorch.linop under an iteration from bartorch.optim.

Parameters:
  • kspace (torch.Tensor) – Under-sampled k-space, C order: (coils, z, y, x) on a grid, and (coils, *encoding, shots, samples) off it.

  • sensitivities (torch.Tensor) – Coil sensitivities, as ecalib() produces them.

  • regularizers (Regularizer or iterable of Regularizer, default=None) – bartorch.priors terms. Their axes index the image’s shape.

  • l2 (float, default=None) – Plain Tikhonov weight.

  • solver ({'cg', 'ist', 'fista', 'admm', 'pridu'}, default=None) – None chooses from the terms, as the application does. IST and FISTA apply a term’s proximal operator to the image, so a first term over a transform – FourierL1, Laplace – for which the application chooses FISTA is refused here; 'admm' and 'pridu' take it.

  • maxiter (int, default=None) – Iterations; BART’s default is thirty.

  • step (float, default=None) – Step size for the gradient iterations.

  • admm_rho (float, default=None) – ADMM penalty; setting it selects ADMM unless solver says otherwise.

  • cg_maxiter (int, default=None) – Inner conjugate-gradient steps for ADMM.

  • traj (torch.Tensor, default=None) – Non-Cartesian trajectory, in grid units.

  • pattern (torch.Tensor, default=None) – Sampling pattern or weights; on a grid it is read off kspace when it is not given.

  • basis (torch.Tensor, default=None) – Subspace basis over frames and coefficients.

  • initial (torch.Tensor, default=None) – An image to start the iteration from, in the units the solve works in – that is, already divided by scaling. pics -W reads it the same way: it rescales the warm start only under -S, where the answer is put back into the data’s units at the end.

  • eigen_step (bool, default=False) – Take the step size from the largest eigenvalue of the normal operator rather than from step, estimated by thirty power iterations as pics -e estimates it. The starting vector comes from BART’s process-global generator, so this is the one setting under which two runs in a process do not agree to the bit.

  • toeplitz (bool, default=None) – False applies the encoding and its adjoint rather than the normal operator’s convolution.

  • scaling (float, default=None) – The data scaling to divide by; estimated when it is not given, which is what makes a regularization weight transferable.

Returns:

The reconstructed image.

Return type:

torch.Tensor

Examples

>>> image = pics(kspace, maps, l2=0.01, maxiter=50)
>>> image = pics(kspace, maps, regularizers=priors.Wavelet((-1, -2), 0.005))

Examples using pics#

From k-space to image

From k-space to image

Coil sensitivity calibration

Coil sensitivity calibration

Noise prewhitening

Noise prewhitening

Regularized reconstruction

Regularized reconstruction

Operators and solvers

Operators and solvers

Radial SENSE reconstruction

Radial SENSE reconstruction