mr2.algorithms.denoising.analysis_denoising

mr2.algorithms.denoising.analysis_denoising(idata: Image, analysis_operator: LinearOperator, regularization_weight: float | Tensor, *, initial_image: Tensor | None = None, max_iterations: int = 100, tolerance: float = 0) → Image[source]

Denoise by minimizing an analysis sparsity objective with PDHG.

Solves \(\min_x \frac12\|x-y\|_2^2 + \sum_i w_i |(Ax)_i|\). Complex coefficients are penalized by magnitude, preserving phase under shrinkage. For convolutional denoising, compose a ConvolutionOp with RearrangeOp('... -> 1 ...') to add a singleton input channel. The convolution’s padding mode determines the boundary behavior. This analysis model is generally different from synthesis sparse coding.

Operators are used as supplied and must support the image’s device and dtype. The initial image is promoted to the image and coefficient dtypes when necessary.

Parameters:
  • idata (TypeVar(Image, Tensor, IData)) – Noisy image, as a tensor or IData. The output retains its shape and header.

  • analysis_operator (LinearOperator) – Linear map from images to coefficients, with a true Hermitian adjoint.

  • regularization_weight (float | Tensor) – Nonnegative finite scalar or map broadcasting to, without expanding, the coefficient shape.

  • initial_image (Tensor | None, default: None) – Initial image of exactly the input shape. Defaults to the noisy image.

  • max_iterations (int, default: 100) – Maximum number of PDHG iterations (positive).

  • tolerance (float, default: 0) – Nonnegative relative primal-change tolerance. Zero disables early stopping.

Returns:

Denoised image of the same container type as the input.