Do not round images on resample.#126
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #125 by removing rounding during image resampling operations, allowing interpolated image values to be preserved more accurately. The change affects the _resample_image helper function which is used when resampling images to match DWI data dimensions.
Key changes:
- Removed
np.round()from the resampling pipeline to preserve continuous interpolated values - Cleaned up trailing whitespace in docstrings for
RoiImageandGQImageclasses
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
LGTM! |
|
Do you happen to remember why that round was there in the first place? |
|
The blame says it was put in in 2022, when i first added the definitions file. It is possible I copied it over from whatever code was doing that previously. I am not sure why I initially added it. My guess is that it was naively there to preserve either labels or binary images. In the case of labels, any input labels in the current code get converted to binary first. In the case of binary, arguably you don't want to round. So, I don't really see its use, and it is definitely wrong for any floating point image. |
Fixes #125.