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

fix padding in rescaling to use reflect correctly #71

Merged
merged 4 commits into from
Mar 8, 2024

Conversation

McHaillet
Copy link
Collaborator

The imaged I attached in #63 showed a strong edge artifact, which I first though came from shifting. Turns out it originates from rescaling. Apparently the padding with zeros during rescaling created lines in my tilt-series, as visible in the top left corner of this image:

rescale_edges_from_zero_padding

I made a small fix in _pad_to_best_fft_shape_2d as it was not correctly switching to 'reflect' mode. Also a suggested change to pad images with the image mean as the constant value for too much padding to still somewhat reduce edges. Now rescaling looks like this:

rescale_edges_with_reflection

And it edges after shifting are indeed reduced:

reduced_edge_artifact_after_shift

Copy link
Collaborator

@alisterburt alisterburt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thanks for catching these

One minor nit, let me know what you think we should do about that but otherwise let's get this in!

@McHaillet McHaillet requested a review from alisterburt March 8, 2024 08:53
@alisterburt
Copy link
Collaborator

alisterburt commented Mar 8, 2024

Having trouble merging this from mobile, not sure what's up - will sort when back at a PC unless you want to rebase yourself?

Edit: ignore above

@alisterburt alisterburt merged commit dd6b07f into teamtomo:main Mar 8, 2024
@McHaillet McHaillet deleted the fix_rescale_padding branch March 8, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants