You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Applying an Affine transformation modifies the object in a non-equivalent manner #296
It's because translations are handled differently than rotation or scaling. While the latter two are actually applied, translations are just saved as an offset. So by applying the affine (consisting of all three), it applies two and just stores the translate (again).
Forgot to answer here (we discussed this in Zulip). It is because as he said the translations are not applied to the image (since we don't modify the coordinates), but also because when calling transform(), a rotated image is "padded" around the corners with a fill value (default 0), and this requires to prepend a new translation.
Anyway, both behaviors are weird because we don't update the xarray coordinates, but after the transformation refactoring this will be addressed, so closing.
Activity
giovp commentedon Jun 22, 2023
this is quite interesting, @LucaMarconato do you have any clue on why would that be the case?
timtreis commentedon Jun 26, 2023
It's because translations are handled differently than rotation or scaling. While the latter two are actually applied, translations are just saved as an offset. So by applying the affine (consisting of all three), it applies two and just stores the translate (again).
LucaMarconato commentedon Jun 27, 2023
Forgot to answer here (we discussed this in Zulip). It is because as he said the translations are not applied to the image (since we don't modify the coordinates), but also because when calling
transform(), a rotated image is "padded" around the corners with a fill value (default 0), and this requires to prepend a new translation.Anyway, both behaviors are weird because we don't update the xarray coordinates, but after the transformation refactoring this will be addressed, so closing.