Older versions of DSI studio (ca. 2017) exported registration between T1w and DTI in the form of an affine transformation matrix looking like (*.mapping.txt):
0.499873 -0.0111112 -0.00188683 -10.9918
0.0100949 0.478641 -0.144224 -0.204301
0.00501123 0.144149 0.478744 -63.3525
0 0 0 1
This came in very handy for automatic generation in Matlab of ROIs for SEEG intracranial electrodes starting from their T1w coordinates as provided by the surgical planning software, where this affine transformation matrix could be directly applied to the voxel coordinates of the contacts to obtain ROIs that could be used right away from within DSI Studio.
However, newer versions of DSI studio no longer save mapping (aka "slice registration") in the form of an affine transform, but instead there are four rows in "linear_reg.txt" listing the translocation/rotation/scaling/affine values:
translocation: 0.594491 -23.8401 -29.8809
rotation: -0.290323 -0.00218621 -0.0166282
scaling: 1 1 1
affine: 0 0 0
What are the mathematical allowing to derive the affine transformation matrix (as saved by earlier DSI Studio versions) from the values in the linear_reg.txt registration file saved by newer versions.
Thanks in advance,
Andrei