Skip to content
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

Merged
merged 5 commits into from Jan 18, 2017

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jan 15, 2017

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 seperate wavedecn decompositions with different choices among two different filters along each axis. e.g. in 2D if the two dual-tree wavelets are w0 and w1, 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 and idwtn. It was then easy to extend to the following routines that are built on top of dwtn and idwtn:

  • dwt2, idwt2
  • wavedec2, waverec2
  • wavedecn, waverecn
  • swtn, iswtn

@grlee77 grlee77 added this to the v1.0 milestone Jan 15, 2017
@codecov-io
Copy link

codecov-io commented Jan 15, 2017

Current coverage is 86.35% (diff: 93.33%)

Merging #272 into master will increase coverage by 0.06%

@@             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   

Powered by Codecov. Last update 8bb4430...49e38b9

@grlee77
Copy link
Contributor Author

grlee77 commented Jan 16, 2017

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
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "Wavlets"

@rgommers
Copy link
Member

Is there a reason you left out swt2, idwt2?

@grlee77
Copy link
Contributor Author

grlee77 commented Jan 18, 2017

There was no good reason not to add swt2 and iswt2 so they have been updated now as well.

Otherwise, I made the suggested changes and also updated the docstrings in _multilevel.py that I missed the first time around.

@rgommers rgommers merged commit 49980ee into PyWavelets:master Jan 18, 2017
@rgommers
Copy link
Member

LGTM, merged. Thanks @grlee77!

@rgommers
Copy link
Member

The osx TravisCI build is suspiciously slow today, took 2 hours to start. Not the end of the world, but would be good to keep an eye on that to check that it doesn't get worse than that.

@grlee77 grlee77 deleted the multiwav branch July 20, 2018 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants