apps.pics

apps.pics#

bartorch.apps.pics()#

Parallel-imaging compressed-sensing reconstruction, BART’s pics -S.

The steps of the command: the sampling pattern applied to the k-space, on a grid the modulation into BART’s uncentred convention, division by the data scaling, the solve with an encoding from bartorch.linop and an iteration from bartorch.optim, and multiplication of the image by the scaling. Regularization weights are therefore relative to the scaled data, and the image is in the units of kspace. On a grid the result equals the command’s to the bit.

Parameters:
  • kspace (torch.Tensor) – k-space, C order: (coils, z, y, x) on a grid, (coils, *encoding, shots, samples) along a trajectory.

  • sensitivities (torch.Tensor) – Coil sensitivities (coils, [1,] z, y, x), as ecalib() returns them.

  • regularizers (Regularizer or iterable of Regularizer, default=None) – Terms from bartorch.priors; their axes index the image.

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

  • solver ({'cg', 'ist', 'fista', 'admm', 'pridu', 'niht'}, default=None) – Iteration. None chooses as the command does: ADMM when admm_rho is given, otherwise from the terms.

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

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

  • admm_rho (float, default=None) – ADMM penalty (-u).

  • cg_maxiter (int, default=None) – Conjugate-gradient iterations inside each ADMM step (-C).

  • traj (torch.Tensor, default=None) – Trajectory (..., samples, 3) in grid units; selects the non-Cartesian encoding.

  • pattern (torch.Tensor, default=None) – Sampling pattern (-p). On a grid, None takes the support of kspace. Along a trajectory it weights the data term, ||W (A x - y)||^2, and is typically the square root of estimate_density().

  • basis (torch.Tensor, default=None) – Subspace basis (-B), along a trajectory only.

  • initial (torch.Tensor, default=None) – Starting image (-W), in the units of the result: of kspace with rescale, of the scaled data without.

  • toeplitz (bool, default=None) – Along a trajectory, False applies the NUFFT and its adjoint instead of the normal operator’s Toeplitz convolution (--no-toeplitz); None keeps the convolution. Ignored on a grid.

  • eigen_step (bool, default=False) – Step size from the largest eigenvalue of the normal operator, by 30 power iterations (-e). The start vector comes from BART’s process-global generator, so repeated runs in one process differ.

  • scaling (float, default=None) – Data scaling (-w); None or zero estimates it with bartorch.optim.data_scaling(), and an estimate of zero is replaced by one.

  • rescale (bool, default=True) – Multiply the image by the scaling (-S). False returns the image of the scaled data, as pics without -S.

Returns:

Image of the shape image_shape() gives.

Return type:

torch.Tensor

Raises:

ValueError – If solver is unknown; if basis is given on a grid; if 'cg' gets more than one L2 term, or both l2 and an L2 term; if eigen_step is set with 'cg'; if 'ist' or 'fista' gets a first term over a transform other than the identity, such as FourierL1, which the command would threshold on the image itself ('admm' and 'pridu' take it).

Notes

Without solver, the command’s rule (italgo_choose) applies: no term or an L2 term alone gives CG; WaveletNIHT and ImageNIHT give normalized iterative hard thresholding; total variation, the other terms italgo_choose assigns to ADMM, and any second term give ADMM; any other first term gives FISTA.

Examples

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

Examples using pics#

2. From k-space to an image

2. From k-space to an image

3. Coil sensitivities

3. Coil sensitivities

5. Choosing a regularizer

5. Choosing a regularizer

6. Custom encoding and solver

6. Custom encoding and solver

8. Radial SENSE

8. Radial SENSE

Noise prewhitening

Noise prewhitening