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
This wiki post aims to introduce the concepts and terminology associated with modifications of the voxel grid of an image and with changing the real-world location of its content and to highlight related tools within MRtrix3.
TL/DR
In image regridding, the grid of the image data is modified but the relation between the content of the image and the real-world location is preserved. Regridding entails interpolation which can cause a loss of information and introduce bias between images if perform…
The mrtransform allows the spatial transformation of images when provided with a suitable linear or nonlinear transformation (“warp”). For linear transformations, MRtrix3 uses homogeneous transformation matrices stored as plain text. These can be converted from FSL and ITK-based (plain text) convention with the command transformconvert . The MRtrix3 tools expect nonlinear transformations in an image format where each voxel defines the scanner space location in the other image.
This transformatio…