Bug - Mantid Imaging - Rotating after cropping causes loss of data

This one’s not huge, because as long as I remember, I can rotate before cropping, but it sometimes bites me when I forget.

Thanks!

Expected behavior

When performing operations on a stack, if you choose to crop the stack to a non-square aspect ratio and then rotate the stack, you would expect that the “aspect ratio” also “rotates”, e.g. if you have a stack that has been cropped to have a width of 2 and a height of 1, and you rotate it by 90 degrees, you would expect the width to become 1 and the height to become 2, and all of the original data to still be represented.

Actual behavior

The aspect ratio of the final image (after rotation) is kept identical to before rotation, combined with a loss of data and addition of black bars to fill the space.

Steps to reproduce the behavior

Open an image in Mantid Imaging. Go to Workflow → Operations. Perform a crop to some non-square aspect ratio. Perform a 90 degree rotation.

Platforms affected

I am using this on IDAaaS at the moment, I believe the same happens in either the stable or unstable builds that are present on IDAaaS right now.

Images for clarification:

Fig 1 - Perform a non-square crop

Fig 2 - Attempt a subsequent 90 degree rotation

Thanks for the report. (And thanks to Mial for passing it on). We are tracking it at Mantid Imaging - Rotating after cropping causes loss of data · Issue #1805 · mantidproject/mantidimaging · GitHub . Looks like something we should fix.

Do you ever use the Rotate tool for small angles, or only for 90 degree changes?

Hi Sam,

I would certainly be interested in using the rotate for “non-90 degree” rotations, yes. I have had a dataset recently that wanted a rotation of 271 degrees, so very slightly under a clockwise 90 degree rotation.

Thanks!