-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added in wrap_axes to cross_correlation_masked function #5573
base: main
Are you sure you want to change the base?
Conversation
Hello @CSSFrancis! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-09-24 15:56:20 UTC |
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.
Thanks, @CSSFrancis, this change looks reasonable to me.
Based on the linked pyxem/pyxem#750 issue, it looks like you want to rely on this function in a downstream package? That is great, but to make that more robust, we should also consider officially adding this function to our public API. Notice that it is not currently among the functions listed in skimage/registration/__init__.py
and doesn't show up in the online API docs. It is used by the public phase_cross_correlation
function, so it is unlikely to be removed, but adding to the public API would guarantee that the import path or arguments would not change abruptly without a deprecation cycle.
Co-authored-by: Gregory R. Lee <grlee77@gmail.com>
@grlee77 Thanks for the notes!
Yes, there are a couple of instances working with polar coordinates where this might be very useful for us.
I can add in an example into the doc string and then add it to Looking at this a bit more closely, it might be useful to add in the option for a This is kind of an edge case, but I think that wrapping the polar axis would be more correct in a polar example than the current implementation. |
@grlee77 @CSSFrancis Thanks for this improvement! But, imho, we should keep the public API the same, accessed through skimage.registration.phase_cross_correlation. So I agree with your assessment @CSSFrancis that we should add wrap_axis to phase_cross_correlation and pass through to your improvements here. |
Coming back to this I think that there are a couple of things that we could potentially improve on with regard to the There are a couple of inconsistencies between the masked and unmasked versions which would be easy to rectify
Additionally there an easy change that could be implemented and might be of interest would be applying the cross-correlation to only certain axes |
I'm definitely in favor of making things as consistent as possible across masked and unmasked cases. We are currently in the process of getting 0.19 out the door and have a list of quite a few things we want to clean up in the API after that. This seems in line with those goals. |
@CSSFrancis awesome suggestions! 👍 |
Hey everyone, |
Sorry for the slow response. Just hit the end of the semester so I'm only now getting time to come back to this. I think that we can close this in favor of #6077. |
Description
This PR adds in the ability to define which axes should be padded and which should wrap for the cross_correlation_masked function.
Specifically this is useful for polar unwrapped images where (some) edges of image should be wrapped to determine orientation and registration.
Example:
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.