hyri.measurement_operator.meas_op_nufft#

Define NUFFT-based measurement-operator abstractions.

This file provides the shared NUFFT measurement-operator class used by concrete backends (for example FINUFFT and TKBNUFFT implementations).

Class

MeasOpNUFFT

Base class for NUFFT-based measurement operators.

class hyri.measurement_operator.meas_op_nufft.MeasOpNUFFT(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: MeasOp

Base class for NUFFT-based measurement operators.

This class stores shared sampling pattern (trajectory) and weighting tensors, and defines the common forward/adjoint interfaces used by backend-specific NUFFT operators. It also provides get_op_norm_prime() for estimating the spectral norm of the effective operator when the image-weight term is applied twice, which is used for heuristic noise correction factor in the imaging pipeline.

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

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

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

_traj#

Stacked sampling trajectory in (v, u) order.

Type:

torch.Tensor

_natural_weight#

Natural weighting tensor.

Type:

torch.Tensor

_image_weight#

Imaging weighting tensor.

Type:

torch.Tensor

_data_weight#

Product of natural and imaging weights.

Type:

torch.Tensor

_precond_weight#

Data-space preconditioning tensor.

Type:

torch.Tensor

Initialise NUFFT trajectory and weighting state.

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) – Preconditioning tensor applied in data space. 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 – Backend-specific optional arguments accepted by subclasses.

abstract _nufft_op(x: Tensor) → Tensor#

Apply backend-specific forward NUFFT with imaging weighting.

Parameters:

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

Returns:

Visibility-domain output.

Return type:

torch.Tensor

abstract _nufft_adj_op(y: Tensor) → Tensor#

Apply backend-specific adjoint NUFFT with imaging weighting.

Parameters:

y (torch.Tensor) – Visibility-domain input.

Returns:

Image-domain adjoint output.

Return type:

torch.Tensor

forward_op(x: Tensor) → Tensor#

Apply the forward measurement operator.

Parameters:

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

Returns:

Visibility-domain output tensor.

Return type:

torch.Tensor

adjoint_op(y: Tensor) → Tensor#

Apply the adjoint measurement operator.

Parameters:

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

Returns:

Image-domain output tensor.

Return type:

torch.Tensor

set_precond_weight(precond_weight: Tensor) → None#

Set the data-space preconditioning weight.

Parameters:

precond_weight (torch.Tensor) – Preconditioning tensor.

Note

Updating this tensor invalidates the cached operator norm.

get_op_norm_prime(rel_tol: float = 1e-05, max_iter: int = 500, verbose: bool = False) → float#

Estimate the norm used for heuristic-noise correction.

This method temporarily sets the preconditioner to _image_weight and computes \(\|\Phi^\dagger \Phi\|_2\) using get_op_norm(). Under this substitution, the image-weight contribution is applied twice in the effective normal operator.

Parameters:
  • rel_tol (float, optional) – Relative tolerance for power-iteration stopping. Default: 1e-5.

  • max_iter (int, optional) – Maximum number of power iterations. Default: 500.

  • verbose (bool, optional) – Print iteration progress. Default: False.

Returns:

Spectral norm estimate for the twice-weighted operator.

Return type:

float