tfmri.signal.waverec

waverec(coeffs, wavelet, mode='symmetric', axes=None)[source]

Multilevel N-dimensional inverse discrete wavelet transform (wavelet reconstruction).

Parameters
  • coeffs – A list with the same structure as the output of tfmri.signal.wavedec.

  • wavelet

    A str or a `pywt.Wavelet`_, or a list thereof. When passed a list, different wavelets are applied along each axis in axes.

  • mode

    A str. The padding or signal extension mode. Must be one of the values supported by `tf.pad`_. Defaults to 'symmetric'.

  • axes

    A list of int. Axes over which to compute the IDWT. Axes may not be repeated. A value of None (the default) selects all axes.

Returns

A tf.Tensor containing the reconstructed signal.

Examples

>>> import tensorflow as tf
>>> import tensorflow_mri as tfmri
>>> coeffs = tfmri.signal.wavedec(tf.ones((4, 4)), 'db1')
>>> # Levels:
>>> len(coeffs)-1
2
>>> tfmri.signal.waverec(coeffs, 'db1')
<tf.Tensor: shape=(4, 4), dtype=float32, numpy=
array([[0.9999999, 0.9999999, 0.9999999, 0.9999999],
       [0.9999999, 0.9999999, 0.9999999, 0.9999999],
       [0.9999999, 0.9999999, 0.9999999, 0.9999999],
       [0.9999999, 0.9999999, 0.9999999, 0.9999999]], dtype=float32)>
Raises

ValueError – If passed invalid input values.