cg#

mrinufft.extras.gradient.cg(operator, kspace_data, x_init=None, num_iter=10, tol=0.0001)[source]#

Perform conjugate gradient (CG) optimization for image reconstruction.

The image is updated using the gradient of a data consistency term, and a velocity vector is used to accelerate convergence.

Parameters:
  • kspace_data (numpy.ndarray) – The k-space data to be used for image reconstruction.

  • x_init (numpy.ndarray, optional) – An initial guess for the image. If None, an image of zeros with the same shape as the expected output is used. Default is None.

  • num_iter (int, optional) – The maximum number of iterations to perform. Default is 10.

  • tol (float, optional) – The tolerance for convergence. If the norm of the gradient falls below this value or the dot product between the image and k-space data is non-positive, the iterations stop. Default is 1e-4.

Returns:

image – The reconstructed image after the optimization process.

Return type:

numpy.ndarray

Examples using mrinufft.extras.gradient.cg#

Reconstruction with conjugate gradient

Reconstruction with conjugate gradient