get_operator#

mrinufft.operators.get_operator(backend_name: Literal['stacked'], wrt_data: bool = False, wrt_traj: bool = False, paired_batch: bool = False) partial[MRIStackedNUFFT][source]#
mrinufft.operators.get_operator(backend_name: str, wrt_data: Literal[False] = False, wrt_traj: Literal[False] = False, paired_batch: bool = False) type[FourierOperatorBase]
mrinufft.operators.get_operator(backend_name: str, wrt_data: Literal[False] = False, wrt_traj: Literal[False] = False, paired_batch: bool = False, *args: Any, **kwargs: Any) FourierOperatorBase
mrinufft.operators.get_operator(backend_name: str, wrt_data: Literal[True] = True, wrt_traj: bool = False, paired_batch: bool = False) partial[MRINufftAutoGrad]
mrinufft.operators.get_operator(backend_name: str, wrt_data: bool = False, wrt_traj: Literal[True] = True, paired_batch: bool = False) partial[MRINufftAutoGrad]
mrinufft.operators.get_operator(backend_name: str, wrt_data: Literal[True] = True, wrt_traj: bool = False, paired_batch: bool = False, *args: Any, **kwargs: Any) MRINufftAutoGrad

Return an MRI Fourier operator interface using the correct backend.

Tip

Don’t be scared of by the huge type signature, it is here to help IDEs and linters to understand the return type of this function.

Parameters:
  • backend_name (str) – Backend name

  • wrt_data (bool, default False) – if set gradients wrt to data and images will be available.

  • wrt_traj (bool, default False) – if set gradients wrt to trajectory will be available.

  • paired_batch (bool, default False) – if set, the autograd will be done with paired batchs of data and smaps.

  • *args – Arguments to pass to the operator constructor.

  • **kwargs – Arguments to pass to the operator constructor.

Returns:

class or instance of class if args or kwargs are given.

Return type:

FourierOperator

Raises:

ValueError if the backend is not available.

Examples

>>> from mrinufft import get_operator
# Return a constructor for the finufft backend with autograd support for data.
>>> nufftKlass = get_operator("finufft", wrt_data=True, wrt_traj=False)
# create an instance of this operator with the given samples and shape
>>> nufft = nufftKlass(samples, shape, density=True)

Alternatively, you can create an instance directly by passing the arguments to get_operator:

>>> nufft = get_operator("finufft", wrt_data=True, wrt_traj=False, samples=samples,    shape=shape, density=True. ...)