Description
Description
I recently needed a weighed phase unwrapping algorithm in Python. Although an pretty good algorithm for phase unwrapping is implemented in scikit-image, it does not support the use of weights, which I needed in my use case involving phase unwrapping of noisy complex data, where the absolute value of the data forms a natural set of weights.
I could not find any Python implementation, so I implemented an algorithm as described here: https://doi.org/10.1364/JOSAA.11.000107 in pure numpy/scipy.
A binder showcasing the implementation can be found here: https://mybinder.org/v2/gh/TAdeJong/weighed_phase_unwrap/master?urlpath=lab/tree/weighed_phase_unwrap.ipynb.
By suggestion of @emmanuelle on Twitter, I am opening this issue to discuss whether a Pull Request to add this algorithm to scikit-image would be welcome and if so, what would be needed?
I personally feel that one of the strengths of the scientific Python eco-system is the wide availability of algorithms in larger libraries with consistent behaviour, and therefore feel that inclusion in scikit-image would be beneficial, even if phase-unwrapping is not the most widely used feature.
As for actual implementation, I would propose to extent the existing unwrap_phase()
function with "weights" and/or "algorithm" keywords and some logic to select the appropriate/wanted algorithm.
My current implementation does not support the 3D case, but extension should be pretty straight forward.