For whatever reason, the scipy implementation of affine transformation requires an inverse transformation matrix: https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.affine_transform.html
How can I know in advance whether a certain combination of scaling/rotation/shearing will give me a non-invertible matrix, and what would that look like geometrically?