fix padding in rescaling to use reflect correctly #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
And it edges after shifting are indeed reduced: