Skip to content
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

Peak positions can be out-of-frame #71

Open
matbryan52 opened this issue Dec 27, 2023 · 0 comments
Open

Peak positions can be out-of-frame #71

matbryan52 opened this issue Dec 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@matbryan52
Copy link
Member

While testing #70 we've noticed that in certain situations evaluate_correlations can give peak coordinates which are outside of the frame if the input peaks are close to the frame edges and the crop_size therefore overlaps the border. This happens because we simply _shift the coordinate in the crop to the coordinate in the frame, without applying any bounds checking.

This doesn't have much impact on internal code as we refine/evaluate in the coordinate system of the crops, but could affect downstream code which might assume results will lie in the frame. I'd argue this is unexpected because the cropping / refinement process is quite opaque to the user (it's mostly just the search parameter on a MatchPattern and that isn't really clear in itself).

Another potential error (which I haven't actually observed!) is the fact we create the centers buffer as np.uint16, so this could overflow in some situations.

One option might be to supply float32 / np.nan results even for the integer centers to make this error case easier to identify.

@matbryan52 matbryan52 added the bug Something isn't working label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant