Workaround for ndimage.affine_transform endianness bug

Fixes #275.
Here you are byteswapping in place. Just to check, has the data been copied before this happens? Elsewhere the function will have a side effect, which we need to avoid.