SuperElastix / SimpleElastix

Multi-lingual medical image registration library
http://simpleelastix.github.io
Apache License 2.0
511 stars 149 forks source link

Shearing Matrix in Affine Transform #475

Open o-fares opened 2 years ago

o-fares commented 2 years ago

Hello,

I want to apply an affine transform on a 3D MRI volume and recover the parameters used with the affine matrix, such as:

I am struggling with the shearing matrix, that is usually defined with 6 coefficients: [1 sxy sxz] [syx 1 syz] [szx szy 1]

But I can only recover the initial coefficients with the initial matrix if the shearing is applied only on one direction in each place (syx = szx = szy = 0). Then the shearing matrix is written this way : [1 sxy sxz] [0 1 syz] [0 0 1]

I wanted to used the AffineDTI3DTransform to get directly the shearing coefficients, but then the matrix used is of the form:

[1 sx*sz sx] [sy 1 0] [0 sz 0]

Do you know how the shearing is applied with the Affine Transform matrix (3 shearing parameters or 6 parameters) ? Do you know if the AffineDTITransform could be suitable for other MRI images ? Do you know the order of the transormations (translation, rotation, scaling, shearing) in the Affine Transform ?

Thank you.