Transformation matrix from T1w to DWI

8 views
Skip to first unread message

Andrei Barborica

unread,
Dec 7, 2025, 9:20:59 PM (14 days ago) Dec 7
to DSI Studio
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

Frank Yeh

unread,
Dec 7, 2025, 9:22:35 PM (14 days ago) Dec 7
to andrei.b...@unibuc.ro, DSI Studio
I will revise the code to output additional matrix that is the same as the previous one.

Once ready, I will let you know.
Frank

--
You received this message because you are subscribed to the Google Groups "DSI Studio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dsi-studio/7f551767-e62f-4f8b-bbf4-6a14272843cen%40googlegroups.com.

Frank Yeh

unread,
Dec 11, 2025, 5:39:37 AM (10 days ago) Dec 11
to andrei.b...@unibuc.ro, DSI Studio
DSI Studio is updated to output additional matrices. Please update and
see if it works for you.
Frank

Andrei Barborica

unread,
Dec 11, 2025, 10:45:20 AM (10 days ago) Dec 11
to Frank Yeh, andrei.b...@unibuc.ro, DSI Studio
Thank you Frank,
I can confirm that the affine registration matrix is now saved as an additional line in the *mapping.txt saved using the menu Slices -> Save slice registration.

However, when attempting to save the registration from Slices -> Adjust slice registration -> Files -> Save registration, which is what I normally do in order to verify and refine registration, the additional line is missing. You may want to fix that as well, since it is confusing to have two different output formats for the same piece of functionality.

Thanks again,
Andrei
Reply all
Reply to author
Forward
0 new messages