hyri.measurement_operator.meas_op_nufft_finufft#

Define the FINUFFT-backed NUFFT measurement operator.

This implementation uses pytorch_finufft to evaluate nonuniform Fourier transforms for forward and adjoint measurement operations.

Class

MeasOpFinufft

Represent a NUFFT measurement operator backed by FINUFFT.

class hyri.measurement_operator.meas_op_nufft_finufft.MeasOpFinufft(u: Tensor, v: Tensor, img_size: tuple[int, int], natural_weight: Tensor = tensor([[[1.]]]), image_weight: Tensor = tensor([[[1.]]]), precond_weight: Tensor = tensor([[[1.]]]), real_flag: bool = True, device: device = device(type='cpu'), dtype: dtype = torch.float32, **kwargs: Any)#

Bases: MeasOpNUFFT

Represent a NUFFT measurement operator backed by FINUFFT.

This class evaluates nonuniform Fourier sampling with pytorch_finufft for single-channel measurement operators. It reuses the weighting and preconditioning logic defined in MeasOpNUFFT while adapting the shared trajectory representation to FINUFFT’s calling convention. The forward operator maps image-domain tensors to sampled visibilities, and the adjoint operator maps weighted visibilities back to the image domain.

Shape:
  • Image tensor – (1, 1, H, W).

  • Visibility tensor – (1, 1, N).

  • Sampling-pattern coordinates :math:`u` and :math:`v` – (1, 1, N).

_traj#

Sampling trajectory stored in FINUFFT-compatible (2, N) layout.

Type:

torch.Tensor

_data_weight#

Combined natural and imaging weights applied in measurement space.

Type:

torch.Tensor

_precond_weight#

Preconditioning weights applied around the backend NUFFT calls.

Type:

torch.Tensor

_finufft_type1#

Imported FINUFFT adjoint transform.

Type:

Callable

_finufft_type2#

Imported FINUFFT forward transform.

Type:

Callable

Example

>>> import torch
>>> u = (2 * torch.pi) * torch.rand(1, 1, 8) - torch.pi
>>> v = (2 * torch.pi) * torch.rand(1, 1, 8) - torch.pi
>>> op = MeasOpFinufft(
...     u=u,
...     v=v,
...     img_size=(16, 16),
... )
>>> image = torch.randn(1, 1, 16, 16)
>>> vis = op.forward_op(image)
>>> vis.shape
torch.Size([1, 1, 8])

References

Shih, Y.-H., Wright, G., Andén, J., Blaschke, J., & Barnett, A. H. (2021). cuFINUFFT: a load-balanced GPU library for general-purpose nonuniform FFTs. Proc. IEEE Int. Parallel Distrib. Process. Symp. Workshops, 688-697.

Barnett, A. H., Magland, J. F., & af Klinteberg, L. (2019). A parallel non-uniform fast Fourier transform library based on an “exponential of semicircle” kernel. SIAM J. Sci. Comput., 41(5), C479-C504.

Initialise the FINUFFT measurement operator.

Parameters:
  • u (torch.Tensor) – u sampling coordinates in radians.

  • v (torch.Tensor) – v sampling coordinates in radians.

  • img_size (Tuple[int, int]) – Target image size (H, W).

  • natural_weight (torch.Tensor, optional) – Natural weighting tensor. Default: torch.ones(1, 1, 1).

  • image_weight (torch.Tensor, optional) – Imaging weighting tensor. Default: torch.ones(1, 1, 1).

  • precond_weight (torch.Tensor, optional) – Data-space preconditioning tensor. Default: torch.ones(1, 1, 1).

  • real_flag (bool, optional) – If True, keep adjoint outputs real when applicable. Default: True.

  • device (torch.device, optional) – Execution device. Default: torch.device("cpu").

  • dtype (torch.dtype, optional) – Image-domain dtype. Default: torch.float.

  • **kwargs – Reserved for API compatibility with other backends.

Raises:

ImportError – If pytorch_finufft is unavailable.

_nufft_op(x: Tensor) → Tensor#

Apply forward FINUFFT and data weighting.

Parameters:

x (torch.Tensor) – Image-domain input tensor.

Returns:

Weighted measurement-domain tensor.

Return type:

torch.Tensor

_nufft_adj_op(y: Tensor) → Tensor#

Apply adjoint FINUFFT and data weighting.

Parameters:

y (torch.Tensor) – Measurement-domain input tensor.

Returns:

Image-domain adjoint output tensor.

Return type:

torch.Tensor