tfmri.recon.least_squares

least_squares(kspace, image_shape, extra_shape=None, mask=None, trajectory=None, density=None, sensitivities=None, phase=None, sens_norm=True, dynamic_domain=None, regularizer=None, optimizer=None, optimizer_kwargs=None, filter_corners=False, return_optimizer_state=False, toeplitz_nufft=False)[source]

Reconstructs an MR image using a least-squares formulation.

This is an iterative reconstruction method which formulates the image reconstruction problem as follows:

\[\hat{x} = {\mathop{\mathrm{argmin}}_x} \left (\left\| Ax - y \right\|_2^2 + g(x) \right )\]

where \(A\) is the MRI LinearOperator, \(x\) is the solution, y is the measured k-space data, and \(g(x)\) is an optional ConvexFunction used for regularization.

This operator supports Cartesian and non-Cartesian k-space data.

This operator supports linear and non-linear reconstruction, depending on the selected regularizer. The MRI operator is constructed internally and does not need to be provided.

This operator supports batched inputs. All batch shapes should be broadcastable with each other.

Parameters
  • kspace – A Tensor. The k-space samples. Must have type complex64 or complex128. kspace can be either Cartesian or non-Cartesian. A Cartesian kspace must have shape [..., *extra_shape, num_coils, *image_shape], where ... are batch dimensions. A non-Cartesian kspace must have shape [..., *extra_shape, num_coils, num_samples].

  • image_shape – A TensorShape or a list of ints. Must have length 2 or 3. The shape of the reconstructed image[s].

  • extra_shape – An optional TensorShape or list of ints. Additional dimensions that should be included within the solution domain. Note that extra_shape is not needed to reconstruct independent batches of images. However, it should be provided when performing a reconstruction that operates along non-spatial dimensions, e.g. for temporal regularization. Defaults to [].

  • mask – An optional Tensor of type bool. The sampling mask. Must have shape [..., image_shape]. mask should be passed for reconstruction from undersampled Cartesian k-space. For each point, mask should be True if the corresponding k-space sample was measured and False otherwise.

  • trajectory – An optional Tensor of type float32 or float64. Must have shape [..., num_samples, rank]. trajectory should be passed for reconstruction from non-Cartesian k-space.

  • density – An optional Tensor of type float32 or float64. The sampling densities. Must have shape [..., num_samples]. This input is only relevant for non-Cartesian MRI reconstruction. If passed, the MRI linear operator will include sampling density compensation. If None, the MRI operator will not perform sampling density compensation.

  • sensitivities – An optional Tensor of type complex64 or complex128. The coil sensitivity maps. Must have shape [..., num_coils, *image_shape]. If provided, a multi-coil parallel imaging reconstruction will be performed.

  • phase – An optional Tensor of type float32 or float64. Must have shape [..., *image_shape]. A phase estimate for the reconstructed image. If provided, a phase-constrained reconstruction will be performed. This improves the conditioning of the reconstruction problem in applications where there is no interest in the phase data. However, artefacts may appear if an inaccurate phase estimate is passed.

  • sens_norm

    A boolean. Whether to normalize coil sensitivities. Defaults to True.

  • dynamic_domain – A str. The domain of the dynamic dimension, if present. Must be one of 'time' or 'frequency'. May only be provided together with a non-scalar extra_shape. The dynamic dimension is the last dimension of extra_shape. The 'time' mode (default) should be used for regular dynamic reconstruction. The 'frequency' mode should be used for reconstruction in x-f space.

  • regularizer – A ConvexFunction. The regularization term added to least-squares objective.

  • optimizer

    A str. One of 'cg' (conjugate gradient), 'admm' (alternating direction method of multipliers) of 'lbfgs' (limited-memory Broyden-Fletcher-Goldfarb-Shanno). If None, the optimizer is selected heuristically depending on other inputs. Note that this heuristic may change in the future, so specify an optimizer if you wish to ensure it will always be used in future versions. Not all optimizers are compatible with all configurations.

  • optimizer_kwargs – An optional dict. Additional arguments to pass to the optimizer.

  • filter_corners

    A boolean. Whether to filter out the k-space corners in reconstructed image. This may be done for trajectories with a circular k-space coverage. Defaults to False.

  • return_optimizer_state

    A boolean. If True, returns the optimizer state along with the reconstructed image.

  • toeplitz_nufft

    A boolean. If True, uses the Toeplitz approach [5] to compute \(F^H F x\), where \(F\) is the non-uniform Fourier operator. If False, the same operation is performed using the standard NUFFT operation. The Toeplitz approach might be faster than the direct approach but is slightly less accurate. This argument is only relevant for non-Cartesian reconstruction and will be ignored for Cartesian problems.

Returns

A Tensor. The reconstructed image. Has the same type as kspace and shape [..., *extra_shape, *image_shape], where ... is the broadcasted batch shape of all inputs.

If return_optimizer_state is True, returns a tuple containing the reconstructed image and the optimizer state.

Raises

ValueError – If passed incompatible inputs.

Notes

Reconstructs an image by formulating a (possibly regularized) least squares problem, which is solved iteratively. Since the problem may be ill-posed, different types of regularizers may be used to incorporate prior knowledge. Depending on the regularizer, the optimization problem may be linear or nonlinear. For sparsity-based regularizers, this is also called a compressed sensing reconstruction. This is a powerful operator which can often produce high-quality images even from highly undersampled k-space data. However, it may be time-consuming, depending on the characteristics of the problem.

References

1

Pruessmann, K.P., Weiger, M., Börnert, P. and Boesiger, P. (2001), Advances in sensitivity encoding with arbitrary k-space trajectories. Magn. Reson. Med., 46: 638-651. https://doi.org/10.1002/mrm.1241

2

Block, K.T., Uecker, M. and Frahm, J. (2007), Undersampled radial MRI with multiple coils. Iterative image reconstruction using a total variation constraint. Magn. Reson. Med., 57: 1086-1098. https://doi.org/10.1002/mrm.21236

3

Feng, L., Grimm, R., Block, K.T., Chandarana, H., Kim, S., Xu, J., Axel, L., Sodickson, D.K. and Otazo, R. (2014), Golden-angle radial sparse parallel MRI: Combination of compressed sensing, parallel imaging, and golden-angle radial sampling for fast and flexible dynamic volumetric MRI. Magn. Reson. Med., 72: 707-717. https://doi.org/10.1002/mrm.24980

4

Tsao, J., Boesiger, P., & Pruessmann, K. P. (2003). k-t BLAST and k-t SENSE: dynamic MRI with high frame rate exploiting spatiotemporal correlations. Magnetic Resonance in Medicine: An Official Journal of the International Society for Magnetic Resonance in Medicine, 50(5), 1031-1042.

5

Fessler, J. A., Lee, S., Olafsson, V. T., Shi, H. R., & Noll, D. C. (2005). Toeplitz-based iterative image reconstruction for MRI with correction for magnetic field inhomogeneity. IEEE Transactions on Signal Processing, 53(9), 3393-3402.