WaveletTransformBase¶
- class odl.trafos.wavelet.WaveletTransformBase(*args, **kwargs)[source]¶
Bases:
OperatorBase class for discrete wavelet transforms.
This abstract class is intended to share code between the forward, inverse and adjoint wavelet transforms.
- Attributes:
adjointAdjoint of this operator (abstract).
domainSet of objects on which this operator can be evaluated.
implImplementation back-end of this wavelet transform.
inverseReturn the operator inverse.
is_biorthogonalWhether or not the wavelet basis is bi-orthogonal.
is_functionalTrueif this operator's range is aField.is_linearTrueif this operator is linear.is_orthogonalWhether or not the wavelet basis is orthogonal.
nlevelsNumber of scaling levels in this wavelet transform.
pad_constValue for extension used in
'constant'padding mode.pad_modePadding mode used for extending input beyond its boundary.
rangeSet in which the result of an evaluation of this operator lies.
waveletName of the wavelet used in this wavelet transform.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).derivative(point)Return the operator derivative at
point.norm([estimate])Return the operator norm of this operator.
scales()Get the scales of each coefficient.
- __init__(space, wavelet, nlevels, variant, pad_mode='constant', pad_const=0, impl='pywt', axes=None)[source]¶
Initialize a new instance.
- Parameters:
- space
DiscretizedSpace 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. Usepywt.wavelistto 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 withpad_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 withimpl='pywt', Seepywt.Modes.modes.'reflect': Reflect at the boundary, without repeating the outmost values.'antisymmetric': Anti-symmetric variant ofsymmetric.'antireflect': Anti-symmetric variant ofreflect.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 thepywtback-end.- impl{'pywt'}, optional
Back-end for the wavelet transform.
- axessequence of ints, optional
Axes over which the DWT that created
coeffswas performed. The default value ofNonecorresponds to all axes. When not all axes are included this is analagous to a batch transform inlen(axes)dimensions looped over the non-transformed axes. In orther words, filtering and decimation does not occur along any axes not inaxes.
- space
References