deepmr.iwt

Contents

deepmr.iwt#

deepmr.iwt(input, shape, device=None, wave_name='db4', level=None)[source]#

Inverse wavelet transform.

Adapted from Sigpy [1].

Parameters:
  • input (np.ndarray | torch.Tensor) – Input wavelet decomposition.

  • shape (Iterable[int], optional) – Spatial matrix size of output signal (nx) (1D signals), (ny, nx) (2D) or (nz, ny, nx) (3D).

  • device (str, optional) – Computational device for Wavelet transform. If not specified, use input.device. The default is None.

  • wave_name (str, optional) – Wavelet name. The default is "db4".

  • axes (Iterable[int], optional) – Axes to perform wavelet transform. The default is None (all axes).

  • level (int, optional) – Number of wavelet levels. The default is None.

Returns:

output – Output signal of shape (…, nz, ny, nx).

Return type:

np.ndarray | torch.Tensor

Examples

>>> import torch
>>> import deepmr

First, generate a 2D phantom and add some noise:

>>> img0 = deepmr.shepp_logan(128) + 0.05 * torch.randn(128, 128)

Now, run wavelet decomposition:

>>> coeff, shape = deepmr.fwt(img0)

The image can be synthesized from coeff and shape as:

>>> img = deepmr.iwt(coeff, shape)

References

[1] mikgroup/sigpy