bartorch.tools.pics

Contents

bartorch.tools.pics#

bartorch.tools.pics(kspace, sensitivities, *, regularizers=None, l2=None, solver=None, maxiter=None, step=None, admm_rho=None, cg_maxiter=None, traj=None, pattern=None, basis=None, initial=None, psf=None, toeplitz=None, lowmem=False, real=False, eigen_step=False, **extra)#

Parallel-imaging compressed-sensing reconstruction.

Parameters:
  • kspace (torch.Tensor) – Under-sampled k-space, C order.

  • sensitivities (torch.Tensor) – Coil sensitivities, as ecalib() or caldir() produce them.

  • regularizers (Regularizer or iterable of Regularizer, optional) – bartorch.prox terms (-R). Their axes index kspace’s shape, negative ones counting from the last axis. A setting pics takes once for every term – randshift, family, a LocallyLowRank block – has to agree across the terms.

  • l2 (float, optional) – Plain Tikhonov weight (-r).

  • solver ({'ist', 'fista', 'admm', 'pridu', 'eulermaruyama'}, optional) – None lets pics choose from the regularizers.

  • maxiter (int, optional) – Iterations (-i).

  • step (float, optional) – Step size (-s).

  • admm_rho (float, optional) – ADMM penalty (-u); setting it selects ADMM unless solver says otherwise.

  • cg_maxiter (int, optional) – Inner conjugate-gradient steps for ADMM (-C).

  • traj (tensor, optional) – Non-Cartesian trajectory (-t), in grid units.

  • pattern (tensor, optional) – Sampling pattern or weights (-p).

  • basis (tensor, optional) – Subspace basis over frames and coefficients (-B).

  • initial (tensor, optional) – Warm start (-W).

  • psf (tensor, optional) – A point spread function computed elsewhere (--psf_import), which is how a normal operator built outside BART is brought in.

  • toeplitz (bool, optional) – False passes --no-toeplitz; None leaves BART’s default.

  • lowmem (bool) – Hold one set of frequencies of the point spread function at a time (--lowmem).

  • real (bool) – Constrain the image to be real (-c).

  • eigen_step (bool) – Scale the step size by the largest eigenvalue (-e).

  • **extra – Further BART pics options, by name. One that picks dimensions (L, shared_img_dims) takes axes of kspace.

Returns:

The reconstructed image.

Return type:

torch.Tensor

Examples

>>> image = pics(kspace, maps, l2=0.01, maxiter=50)
>>> image = pics(kspace, maps, regularizers=prox.Wavelet((-1, -2), 0.005), solver="fista")
>>> image = pics(kspace, maps, traj=trajectory, basis=subspace)