GrogLinearOp

Contents

GrogLinearOp#

class pygrog.interop.GrogLinearOp(op)[source]#

Bases: object

Wrap a pygrog operator as an mrpro.operators.LinearOperator.

Because mrpro is an optional dependency, the class is built lazily on first instantiation so importing this module does not fail when mrpro is absent.

Parameters:

op (SparseFFT-like) – Any operator with forward(kspace) -> image and adjoint(image) -> kspace methods, plus a natural_shape attribute whose last axis is the GROG kernel width.

Raises:

ImportError – If mrpro is not installed.

Examples

from pygrog.operator import SparseFFT
from pygrog.interop import GrogLinearOp
from mrpro.algorithms.optimizers import pgd

base = SparseFFT(plan=grog.plan, smaps=smaps)
mrpro_op = GrogLinearOp(base)
# mrpro_op now consumes/produces standard
# ``(*other, n_coils, k2, k1, k0)`` k-space and ``(*other, z, y, x)``
# images, ready for any mrpro algorithm.

Methods

__init__