{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-image/scikit-image/issues/760","repository_url":"https://api.github.com/repos/scikit-image/scikit-image","labels_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/760/labels{/name}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/760/comments","events_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/760/events","html_url":"https://github.com/scikit-image/scikit-image/pull/760","id":20586318,"number":760,"title":"Implemented wavelet filter","user":{"login":"thearn","id":1128468,"avatar_url":"https://avatars.githubusercontent.com/u/1128468?v=3","gravatar_id":"","url":"https://api.github.com/users/thearn","html_url":"https://github.com/thearn","followers_url":"https://api.github.com/users/thearn/followers","following_url":"https://api.github.com/users/thearn/following{/other_user}","gists_url":"https://api.github.com/users/thearn/gists{/gist_id}","starred_url":"https://api.github.com/users/thearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thearn/subscriptions","organizations_url":"https://api.github.com/users/thearn/orgs","repos_url":"https://api.github.com/users/thearn/repos","events_url":"https://api.github.com/users/thearn/events{/privacy}","received_events_url":"https://api.github.com/users/thearn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-image/scikit-image/labels/new%20feature","name":"new feature","color":"8a64ae"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-image/scikit-image/milestones/6","html_url":"https://github.com/scikit-image/scikit-image/milestones/0.13","labels_url":"https://api.github.com/repos/scikit-image/scikit-image/milestones/6/labels","id":1467848,"number":6,"title":"0.13","description":null,"creator":{"login":"ahojnnes","id":134307,"avatar_url":"https://avatars.githubusercontent.com/u/134307?v=3","gravatar_id":"","url":"https://api.github.com/users/ahojnnes","html_url":"https://github.com/ahojnnes","followers_url":"https://api.github.com/users/ahojnnes/followers","following_url":"https://api.github.com/users/ahojnnes/following{/other_user}","gists_url":"https://api.github.com/users/ahojnnes/gists{/gist_id}","starred_url":"https://api.github.com/users/ahojnnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahojnnes/subscriptions","organizations_url":"https://api.github.com/users/ahojnnes/orgs","repos_url":"https://api.github.com/users/ahojnnes/repos","events_url":"https://api.github.com/users/ahojnnes/events{/privacy}","received_events_url":"https://api.github.com/users/ahojnnes/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":9,"state":"open","created_at":"2015-12-19T16:45:03Z","updated_at":"2016-08-05T05:13:24Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2013-10-06T21:16:28Z","updated_at":"2016-08-05T05:55:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/760","html_url":"https://github.com/scikit-image/scikit-image/pull/760","diff_url":"https://github.com/scikit-image/scikit-image/pull/760.diff","patch_url":"https://github.com/scikit-image/scikit-image/pull/760.patch"},"body":"Relevant to #602: I've implemented a basic discrete wavelet transform filter for scikit-image.\r\nAt the moment, it's importing pywavelets directly, but it sounds like there will be a closer integration of source to come.\r\n\r\n### The basics:\r\nAn n-level [discrete wavelet transform](http://en.wikipedia.org/wiki/Discrete_wavelet_transform) decomposes a digital image into 1 + 3*n coefficient matrices. The first is called the *approximation subband*, which captures the mean (and other low-frequency information) of the original image, and is essentially a down-sampled representation of it.\r\n\r\nThe remaining coefficient matrices are called the *detail subbands*. Thresholding functions are applied to these matrices. The wavelet transform is then reversed, to give the denoised result. Thresholding can either be [*soft* or *hard*](http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xlghtmlnode93.html).\r\n\r\nThe main variation between the wavelet denoising methods that are out there in the literature are in how the thresholding values for each detail subband is determined (whether it is uniform across all detail subbands, or individual for each, etc).\r\n\r\nThe function implemented here allows a user to specify the detail thresholds either uniformly, or by level, or by individual subband. This way, this function can be used to implement the majority of wavelet denoising methods out there (BayesShrink. SureShrink. etc) by writing short wrapping functions which pre-compute the thresholds accordingly.\r\n\r\nI'll work on more thorough documentation / examples before moving to implement BayesShrink/VisuShrink/SureShrink. Couldn't hurt to have more tests either. If it desirable to have these things done before issuing a pull request, no problem. I will wait until I have it all together, if desired. \r\n\r\nI also have some methods of my own that are pre-publication, but would be happy to include.\r\n\r\nUsage is pretty simple. Arguments to `wavelet_filter` are the image to be denoised, threshold value(s), and all arguments which could be passed to `pywt.wavedec2`. Note that in `wavelet_filter`, the wavelet function to use is an optional arguement, and defaults to `haar`.\r\n```python\r\nfrom skimage.filters import wavelet_filter\r\nfrom scipy.misc import lena\r\nA = lena()\r\n# 1-level db4 transform, soft threshold all detail subbands at t=10.\r\nB = wavelet_filter(A, 10.,  wavelet=\"db4\")\r\n# 3-level Haar transform, hard threshold each level with its own value\r\nt = [10., 8., 3.]\r\nB = wavelet_filter(A, t, thresh_type=\"hard\", level=3)\r\n# 2-level sym14 transform, with each subband getting its own threshold\r\nt = [[10., 80., 30.], [80., 17., 19.]]\r\nB = wavelet_filter(A, t, wavelet=\"sym14\", level=2)\r\n```\r\n\r\n[Here](http://i.imgur.com/69ac1Bh.png) are results for\r\n```python\r\nwavelet_filter(A, 25., wavelet=\"sym14\", level=10)\r\n```\r\nArtifacts can be reduced by finer tuning of the thresholds, and careful selection of the wavelet function."},"comment":{"url":"https://api.github.com/repos/scikit-image/scikit-image/issues/comments/237762521","html_url":"https://github.com/scikit-image/scikit-image/pull/760#issuecomment-237762521","issue_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/760","id":237762521,"user":{"login":"ahojnnes","id":134307,"avatar_url":"https://avatars.githubusercontent.com/u/134307?v=3","gravatar_id":"","url":"https://api.github.com/users/ahojnnes","html_url":"https://github.com/ahojnnes","followers_url":"https://api.github.com/users/ahojnnes/followers","following_url":"https://api.github.com/users/ahojnnes/following{/other_user}","gists_url":"https://api.github.com/users/ahojnnes/gists{/gist_id}","starred_url":"https://api.github.com/users/ahojnnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahojnnes/subscriptions","organizations_url":"https://api.github.com/users/ahojnnes/orgs","repos_url":"https://api.github.com/users/ahojnnes/repos","events_url":"https://api.github.com/users/ahojnnes/events{/privacy}","received_events_url":"https://api.github.com/users/ahojnnes/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T05:55:56Z","updated_at":"2016-08-05T05:55:56Z","body":"+1!"}}
{"actor":{"display_login":"ahojnnes"}}