[python-dtcwt] 68/497: import dtwavexfm3 documentation
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:05:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.
commit 4f958feaba28252419764308e87672d0627a2914
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date: Thu Aug 8 19:04:30 2013 +0100
import dtwavexfm3 documentation
---
dtcwt/transform3d.py | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/dtcwt/transform3d.py b/dtcwt/transform3d.py
index 9825030..21f7286 100644
--- a/dtcwt/transform3d.py
+++ b/dtcwt/transform3d.py
@@ -10,14 +10,18 @@ from dtcwt.lowlevel import colfilter, coldfilt, colifilt
def dtwavexfm3(X, nlevels=3, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, ext_mode=4):
"""Perform a *n*-level DTCWT-3D decompostion on a 3D matrix *X*.
- :param X: 3D real matrix/Image of shape (N, M)
+ :param X: 3D real array-like object
:param nlevels: Number of levels of wavelet decomposition
:param biort: Level 1 wavelets to use. See :py:func:`biort`.
:param qshift: Level >= 2 wavelets to use. See :py:func:`qshift`.
:param ext_mode: Extension mode. See below.
:returns Yl: The real lowpass image from the final level
- :returns Yh: A tuple containing the (N, M, 7) shape complex highpass subimages for each level.
+ :returns Yh: A tuple containing the complex highpass subimages for each level.
+
+ Each element of *Yh* is a 4D complex array with the 4th dimension having
+ size 28. The 3D slice ``Yh[l][:,:,:,d]`` corresponds to the complex higpass
+ coefficients for direction d at level l where d and l are both 0-indexed.
If *biort* or *qshift* are strings, they are used as an argument to the
:py:func:`biort` or :py:func:`qshift` functions. Otherwise, they are
@@ -34,13 +38,20 @@ def dtwavexfm3(X, nlevels=3, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, ext_mod
2nd level onwards, the coeffs can be divided by 8. If any dimension size is
not a multiple of 8, append extra coeffs by repeating the edges twice.
+ .. note::
+
+ The *ext_mode* == 8 behaviour has not yet been implemented in
+ :py:func:`dtwaveifm3`.
+
Example::
- # Performs a 3-level transform on the real image X using the 13,19-tap
+ # Performs a 3-level transform on the real 3D array X using the 13,19-tap
# filters for level 1 and the Q-shift 14-tap filters for levels >= 2.
Yl, Yh = dtwavexfm3(X, 3, 'near_sym_b', 'qshift_b')
.. codeauthor:: Rich Wareham <rjw57 at cantab.net>, Aug 2013
+ .. codeauthor:: Huizhong Chen, Jan 2009
+ .. codeauthor:: Nick Kingsbury, Cambridge University, July 1999.
"""
X = np.atleast_3d(X)
@@ -82,6 +93,7 @@ def dtwaveifm3(Yl, Yh, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, ext_mode=4):
:param Yh: A sequence containing the complex highpass subband for each level.
:param biort: Level 1 wavelets to use. See :py:func:`biort`.
:param qshift: Level >= 2 wavelets to use. See :py:func:`qshift`.
+ :param ext_mode: Extension mode. See below.
:returns Z: Reconstructed real image matrix.
@@ -91,6 +103,15 @@ def dtwaveifm3(Yl, Yh, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, ext_mode=4):
case, this should be (h0o, g0o, h1o, g1o). In the *qshift* case, this should
be (h0a, h0b, g0a, g0b, h1a, h1b, g1a, g1b).
+ There are two values for *ext_mode*, either 4 or 8. If *ext_mode* = 4,
+ check whether 1st level is divisible by 2 (if not we raise a
+ ``ValueError``). Also check whether from 2nd level onwards, the coefs can
+ be divided by 4. If any dimension size is not a multiple of 4, append extra
+ coefs by repeating the edges. If *ext_mode* = 8, check whether 1st level is
+ divisible by 4 (if not we raise a ``ValueError``). Also check whether from
+ 2nd level onwards, the coeffs can be divided by 8. If any dimension size is
+ not a multiple of 8, append extra coeffs by repeating the edges twice.
+
Example::
# Performs a 3-level reconstruction from Yl,Yh using the 13,19-tap
@@ -98,6 +119,8 @@ def dtwaveifm3(Yl, Yh, biort=DEFAULT_BIORT, qshift=DEFAULT_QSHIFT, ext_mode=4):
Z = dtwaveifm3(Yl, Yh, 'near_sym_b', 'qshift_b')
.. codeauthor:: Rich Wareham <rjw57 at cantab.net>, Aug 2013
+ .. codeauthor:: Huizhong Chen, Jan 2009
+ .. codeauthor:: Nick Kingsbury, Cambridge University, July 1999.
"""
# Try to load coefficients if biort is a string parameter
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git
More information about the debian-science-commits
mailing list