Transformation

Could you please clarify what you are trying to achieve? Your error message indicates that the transformation is transposed but that might not be the only source of incompatibility wich affine3d. In general, transformations are typically specific to the software package.

You might find the following links helpful to get you started:
https://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html