Mask generation uses the same affine transformation as the tensor