{"action":"created","issue":{"url":"https://api.github.com/repos/PyAbel/PyAbel/issues/225","repository_url":"https://api.github.com/repos/PyAbel/PyAbel","labels_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/225/comments","events_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/225/events","html_url":"https://github.com/PyAbel/PyAbel/issues/225","id":355670375,"node_id":"MDU6SXNzdWUzNTU2NzAzNzU=","number":225,"title":"Enable Tikhonov regularization in BASEX","user":{"login":"DanHickstein","id":1107796,"node_id":"MDQ6VXNlcjExMDc3OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1107796?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHickstein","html_url":"https://github.com/DanHickstein","followers_url":"https://api.github.com/users/DanHickstein/followers","following_url":"https://api.github.com/users/DanHickstein/following{/other_user}","gists_url":"https://api.github.com/users/DanHickstein/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHickstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHickstein/subscriptions","organizations_url":"https://api.github.com/users/DanHickstein/orgs","repos_url":"https://api.github.com/users/DanHickstein/repos","events_url":"https://api.github.com/users/DanHickstein/events{/privacy}","received_events_url":"https://api.github.com/users/DanHickstein/received_events","type":"User","site_admin":false},"labels":[{"id":172687757,"node_id":"MDU6TGFiZWwxNzI2ODc3NTc=","url":"https://api.github.com/repos/PyAbel/PyAbel/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"DanHickstein","id":1107796,"node_id":"MDQ6VXNlcjExMDc3OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1107796?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHickstein","html_url":"https://github.com/DanHickstein","followers_url":"https://api.github.com/users/DanHickstein/followers","following_url":"https://api.github.com/users/DanHickstein/following{/other_user}","gists_url":"https://api.github.com/users/DanHickstein/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHickstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHickstein/subscriptions","organizations_url":"https://api.github.com/users/DanHickstein/orgs","repos_url":"https://api.github.com/users/DanHickstein/repos","events_url":"https://api.github.com/users/DanHickstein/events{/privacy}","received_events_url":"https://api.github.com/users/DanHickstein/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanHickstein","id":1107796,"node_id":"MDQ6VXNlcjExMDc3OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1107796?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHickstein","html_url":"https://github.com/DanHickstein","followers_url":"https://api.github.com/users/DanHickstein/followers","following_url":"https://api.github.com/users/DanHickstein/following{/other_user}","gists_url":"https://api.github.com/users/DanHickstein/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHickstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHickstein/subscriptions","organizations_url":"https://api.github.com/users/DanHickstein/orgs","repos_url":"https://api.github.com/users/DanHickstein/repos","events_url":"https://api.github.com/users/DanHickstein/events{/privacy}","received_events_url":"https://api.github.com/users/DanHickstein/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/PyAbel/PyAbel/milestones/4","html_url":"https://github.com/PyAbel/PyAbel/milestone/4","labels_url":"https://api.github.com/repos/PyAbel/PyAbel/milestones/4/labels","id":1631340,"node_id":"MDk6TWlsZXN0b25lMTYzMTM0MA==","number":4,"title":"Version 0.9","description":"","creator":{"login":"DanHickstein","id":1107796,"node_id":"MDQ6VXNlcjExMDc3OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1107796?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHickstein","html_url":"https://github.com/DanHickstein","followers_url":"https://api.github.com/users/DanHickstein/followers","following_url":"https://api.github.com/users/DanHickstein/following{/other_user}","gists_url":"https://api.github.com/users/DanHickstein/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHickstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHickstein/subscriptions","organizations_url":"https://api.github.com/users/DanHickstein/orgs","repos_url":"https://api.github.com/users/DanHickstein/repos","events_url":"https://api.github.com/users/DanHickstein/events{/privacy}","received_events_url":"https://api.github.com/users/DanHickstein/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":3,"state":"open","created_at":"2016-03-08T19:02:49Z","updated_at":"2018-08-30T16:51:46Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2018-08-30T16:51:34Z","updated_at":"2018-09-19T06:33:46Z","closed_at":null,"author_association":"MEMBER","body":"In a discussion with Mikhail Ryazanov, I realized that we have disabled the Tikhonov regularization factor in the `basex` algorithm. This occurs on [line 184 of basex.py](https://github.com/PyAbel/PyAbel/blob/master/abel/basex.py#L184):\r\n```python\r\n    q_vert, q_horz = 0, 0  # No Tikhonov regularization\r\n```\r\nAs I recall, we originally thought that this factor didn't significantly affect the output. However, I think that this parameter can have a large effect on the transform in the presence of noise, greatly suppressing the nose at small r-values.\r\n\r\nYou can see here the difference between `q_vert, q_horz = 0, 0 ` (left) and `q_vert, q_horz = 100, 100` (right). \r\n\r\n![image](https://user-images.githubusercontent.com/1107796/44866130-98ba5480-ac41-11e8-8107-0233f6db5ddd.png)\r\n\r\nI think that many users of the old BASEX.exe enjoyed this smoothing, and this is one of the reasons that BASEX became so popular. So, I think that we need to re-activate this feature.\r\n\r\nHowever, in our current implementation, the \"basis set\" that is saved (pre-cached) already has the tikhonov regularization factor included. So, we would either need to change the naming convention of the saved files to include the tikhonov factor in the file name (in addition to the image size), or we would need to slightly re-work the algorithm to save the basis sets at a slightly earlier stage, and include the tikhonov factor in the computation of the transform (instead of in the computation of the basis sets). This would result in somewhat slower transform times, but allow users the most flexibility to try several tikhonov regularization factors. We should likely investigate how much this slows down the transform before making a decision.\r\n\r\nAdditionally, Mikhail suggested that we look into using one of the linear algebra \"solve\" functions instead of matrix inversion and other matrix algebra steps. I think that the appropriate numpy function is this one:\r\nhttps://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.solve.html\r\n"},"comment":{"url":"https://api.github.com/repos/PyAbel/PyAbel/issues/comments/422672583","html_url":"https://github.com/PyAbel/PyAbel/issues/225#issuecomment-422672583","issue_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/225","id":422672583,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjY3MjU4Mw==","user":{"login":"MikhailRyazanov","id":12854133,"node_id":"MDQ6VXNlcjEyODU0MTMz","avatar_url":"https://avatars1.githubusercontent.com/u/12854133?v=4","gravatar_id":"","url":"https://api.github.com/users/MikhailRyazanov","html_url":"https://github.com/MikhailRyazanov","followers_url":"https://api.github.com/users/MikhailRyazanov/followers","following_url":"https://api.github.com/users/MikhailRyazanov/following{/other_user}","gists_url":"https://api.github.com/users/MikhailRyazanov/gists{/gist_id}","starred_url":"https://api.github.com/users/MikhailRyazanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikhailRyazanov/subscriptions","organizations_url":"https://api.github.com/users/MikhailRyazanov/orgs","repos_url":"https://api.github.com/users/MikhailRyazanov/repos","events_url":"https://api.github.com/users/MikhailRyazanov/events{/privacy}","received_events_url":"https://api.github.com/users/MikhailRyazanov/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T06:33:46Z","updated_at":"2018-09-19T06:33:46Z","author_association":"NONE","body":"> My only concern (discussion point) is that global basex basis arrays remain even when the basex method is no longer used.\r\n\r\nWell, if we had `Transform` creating an object, they would be killed with it. ;–)\r\n\r\nWith the half-width transform, a 1023×1023 image requires three 512×512 arrays, which is 6 MiB + Python/numpy overhead. I think, this is not a big problem. But I can add a `cleanup=False` parameter to `abel.Transform()` and `abel.basex.get_bs_basex_cached()`, such that those who care could specify `cleanup=True` to get rid of these arrays. Then other methods that need caching can honor it as well.\r\n\r\n> BTW, long is not part of python3\r\n\r\nDo we actually need that stuff? Non-\"auto\" bases never worked, I do not have plans to implement them (I do not really know the details, and \"broad\" bases are relatively useless), and it is unlikely that anybody will soon. The removal of the vertical transform has already changed the calling conventions (not the default ones, but it broke some tests), so maybe we should ignore `nbf` also (completely remove it or print a warning \"not used\", if compatibility is needed)?\r\n\r\n> Any chance that you can implement the anisotropy parameter calculation that was available in the original basex program?\r\n\r\nIt was painfully slow (~40 seconds on my computer). I think, calculating it from the reconstructed image using a common procedure is better in every sense."}}
{"actor":{"display_login":"MikhailRyazanov"}}