New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow separate wavelet/mode for each axis in routines based on dwtn/idwtn #272
Conversation
Current coverage is 86.35% (diff: 93.33%)@@ master #272 diff @@
==========================================
Files 20 21 +1
Lines 3056 3085 +29
Methods 45 45
Messages 0 0
Branches 525 532 +7
==========================================
+ Hits 2637 2664 +27
+ Misses 369 368 -1
- Partials 50 53 +3
|
The one failure for 3.5 on Travis looks like a fluke. The error was related to curl failing to download python-3.5. |
@@ -218,10 +227,12 @@ def idwtn(coeffs, wavelet, mode='symmetric', axes=None): | |||
Dictionary as in output of `dwtn`. Missing or None items | |||
will be treated as zeroes. | |||
wavelet : Wavelet object or name string | |||
Wavelet to use | |||
mode : str, optional | |||
Wavelet to use. This can also be a list containing a wavelet to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: "list" --> "tuple" for consistency with the other functions
If a single Wavelet is provided, it will used for all axes. Otherwise | ||
one Wavelet per axis must be provided. | ||
axes : list | ||
The list of axes to be transormed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "transormed"
Returns | ||
------- | ||
wavelets : list of Wavelet objects | ||
A list of Wavlets equal in length to axes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "Wavlets"
Is there a reason you left out |
There was no good reason not to add Otherwise, I made the suggested changes and also updated the docstrings in |
LGTM, merged. Thanks @grlee77! |
The |
An example where this could be useful is in video processing (or volume+time medical imaging applications) where it may make sense to use a different wavelet or edge mode on the time axis as opposed to the spatial axes.
This is also functionality that is needed for implementing the dual-tree complex DWT. The n-dimensional dual-tree CDWT involves
2**n
seperatewavedecn
decompositions with different choices among two different filters along each axis. e.g. in 2D if the two dual-tree wavelets arew0
andw1
, there are 4 separate decompositions using wavelets(w0, w0), (w0, w1), (w1, w0), (w1, w1)
where the elements of the tuple indicate which filter to apply along each axis.The primary change is implemented in
dwtn
andidwtn
. It was then easy to extend to the following routines that are built on top ofdwtn
andidwtn
: