-
-
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
masked phase_cross_correlation not working in 1D #5458
Comments
Thanks for reporting. I will take a look. We do generally try to support n-dimensional images when possible. |
Could this relate to #5138? |
I think this has since been resolved (probably by #5559). I just ran the following example and it worked: import numpy as np
from pywt import data
from skimage import registration
x = data.ecg()
x2 = np.roll(x, 25)
shifts = registration.phase_cross_correlation(
x, x2, upsample_factor=1, space="real", return_error=False,
reference_mask=None, moving_mask=None
)
print(f"shifts={shifts}")
mask_x = np.ones_like(x)
mask_x[:10] = 0
mask_x[-10:] = 0
shifts = registration.phase_cross_correlation(
x, x2, upsample_factor=1, space="real", return_error=False,
reference_mask=mask_x, moving_mask=mask_x
)
print(f"shifts (masked)={shifts}") Both the masked and unmasked cases give shifts of I will close, but please reopen if you find a case where this does not work. |
That is a separate issue and still exists. In the unmasked case you get three outputs when |
When working with 1D array, phase_cross_correlation without any mask works.
But when adding masks (reference_mask or moving_mask), the
cross_correlate_masked()
called function makes the calculation failed.Indeed, this function seems to be designed typically for 2D arrays.
Is it possible to extend this function to any dimension (or at less to 1D) ?
Thanks
scikit-image : version 1.8.2
The text was updated successfully, but these errors were encountered: