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
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:
MeasOpBase 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:
- _natural_weight#
Natural weighting tensor.
- Type:
- _image_weight#
Imaging weighting tensor.
- Type:
- _data_weight#
Product of natural and imaging weights.
- Type:
- _precond_weight#
Data-space preconditioning tensor.
- Type:
Initialise NUFFT trajectory and weighting state.
- Parameters:
u (torch.Tensor) –
usampling coordinates in radians.v (torch.Tensor) –
vsampling coordinates in radians.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:
- 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:
- 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:
- 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:
- 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_weightand computes \(\|\Phi^\dagger \Phi\|_2\) usingget_op_norm(). Under this substitution, the image-weight contribution is applied twice in the effective normal operator.- Parameters:
- Returns:
Spectral norm estimate for the twice-weighted operator.
- Return type: