WaveletTransformBase

class odl.trafos.wavelet.WaveletTransformBase(*args, **kwargs)[source]

Bases: odl.operator.operator.Operator

Base class for discrete wavelet transforms.

This abstract class is intended to share code between the forward, inverse and adjoint wavelet transforms.

Attributes
adjoint

Adjoint of this operator (abstract).

domain

Set of objects on which this operator can be evaluated.

impl

Implementation back-end of this wavelet transform.

inverse

Return the operator inverse.

is_biorthogonal

Whether or not the wavelet basis is bi-orthogonal.

is_functional

True if this operator’s range is a Field.

is_linear

True if this operator is linear.

is_orthogonal

Whether or not the wavelet basis is orthogonal.

nlevels

Number of scaling levels in this wavelet transform.

pad_const

Value for extension used in 'constant' padding mode.

pad_mode

Padding mode used for extending input beyond its boundary.

range

Set in which the result of an evaluation of this operator lies.

wavelet

Name of the wavelet used in this wavelet transform.

Methods

_call(self, x[, out])

Implementation of the operator evaluation.

derivative(self, point)

Return the operator derivative at point.

norm(self[, estimate])

Return the operator norm of this operator.

scales(self)

Get the scales of each coefficient.

__init__(self, space, wavelet, nlevels, variant, pad_mode='constant', pad_const=0, impl='pywt', axes=None)[source]

Initialize a new instance.

Parameters
spaceDiscretizedSpace

Domain of the forward wavelet transform (the “image domain”). In the case of variant in ('inverse', 'adjoint'), this space is the range of the operator.

waveletstring or pywt.Wavelet

Specification of the wavelet to be used in the transform. If a string is given, it is converted to a pywt.Wavelet. Use pywt.wavelist to get a list of available wavelets.

Possible wavelet families are:

'haar': Haar

'db': Daubechies

'sym': Symlets

'coif': Coiflets

'bior': Biorthogonal

'rbio': Reverse biorthogonal

'dmey': Discrete FIR approximation of the Meyer wavelet

variant{‘forward’, ‘inverse’, ‘adjoint’}

Wavelet transform variant to be created.

nlevelspositive int, optional

Number of scaling levels to be used in the decomposition. The maximum number of levels can be calculated with pywt.dwtn_max_level. Default: Use maximum number of levels.

pad_modestring, optional

Method to be used to extend the signal.

'constant': Fill with pad_const.

'symmetric': Reflect at the boundaries, not repeating the outmost values.

'periodic': Fill in values from the other side, keeping the order.

'order0': Extend constantly with the outmost values (ensures continuity).

'order1': Extend with constant slope (ensures continuity of the first derivative). This requires at least 2 values along each axis where padding is applied.

'pywt_per': like 'periodic'-padding but gives the smallest possible number of decomposition coefficients. Only available with impl='pywt', See pywt.Modes.modes.

'reflect': Reflect at the boundary, without repeating the outmost values.

'antisymmetric': Anti-symmetric variant of symmetric.

'antireflect': Anti-symmetric variant of reflect.

For reference, the following table compares the naming conventions for the modes in ODL vs. PyWavelets:

======================= ==================
          ODL               PyWavelets
======================= ==================
symmetric               symmetric
reflect                 reflect
order1                  smooth
order0                  constant
constant, pad_const=0   zero
periodic                periodic
pywt_per                periodization
antisymmetric           antisymmetric
antireflect             antireflect
======================= ==================

See signal extension modes for an illustration of the modes (under the PyWavelets naming conventions).

pad_constfloat, optional

Constant value to use if pad_mode == 'constant'. Ignored otherwise. Constants other than 0 are not supported by the pywt back-end.

impl{‘pywt’}, optional

Back-end for the wavelet transform.

axessequence of ints, optional

Axes over which the DWT that created coeffs was performed. The default value of None corresponds to all axes. When not all axes are included this is analagous to a batch transform in len(axes) dimensions looped over the non-transformed axes. In orther words, filtering and decimation does not occur along any axes not in axes.

References