Workaround for ndimage.affine_transform endianness bug

Fixes #275.