get_operator#

mrinufft.get_operator(backend_name: Literal['stacked'], wrt_data: bool = False, wrt_traj: bool = False, paired_batch: bool = False) partial[MRIStackedNUFFT][source]#
mrinufft.get_operator(backend_name: str, wrt_data: Literal[False] = False, wrt_traj: Literal[False] = False, paired_batch: bool = False) type[FourierOperatorBase]
mrinufft.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.get_operator(backend_name: str, wrt_data: Literal[True] = True, wrt_traj: bool = False, paired_batch: bool = False) partial[MRINufftAutoGrad]
mrinufft.get_operator(backend_name: str, wrt_data: bool = False, wrt_traj: Literal[True] = True, paired_batch: bool = False) partial[MRINufftAutoGrad]
mrinufft.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. ...)

Example using get_operator:#

Density Compensation Routines

Density Compensation Routines

Simple UNet model.

Simple UNet model.

Learn Sampling pattern

Learn Sampling pattern

Learn Sampling pattern for multi-coil MRI

Learn Sampling pattern for multi-coil MRI

Learn Straight line readout pattern

Learn Straight line readout pattern

Least Squares Image Reconstruction

Least Squares Image Reconstruction

Model-based iterative reconstruction

Model-based iterative reconstruction

Sensitivity maps estimation

Sensitivity maps estimation

Off-resonance corrected NUFFT operator

Off-resonance corrected NUFFT operator

Minimal example script

Minimal example script

Subspace NUFFT Operator

Subspace NUFFT Operator

Learning sampling pattern with decimation

Learning sampling pattern with decimation