open-discussion > RE: How to apply transformation matrix
Dec 3, 2013  06:12 PM | John Harwell
RE: How to apply transformation matrix
From the GIFTI document:

2.8 MatrixData2.8.1 Description – Contains 16 text values representing a double- precision 4x4 transformation matrix. The values are listed as a one- dimensional array in row-major order which is used by most programming languages with the exception of FORTRAN and MATLAB. Note that OpenGL uses column-major order for its matrices.For example, the matrix below would appear as "m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15 m16" is the MatrixData11 element.

m1 m2 m3 m4
m5 m6 m7 m8
m9 m10 m11 m12
m13 m14 m15 m16


Since the GIFTI transformation matrix is in row-major order, the translation values are in the bottom row (m13, m14, m15).  I believe the NIFTI SFORM is column-major order (translation values are in the right-most column).

Threaded View

TitleAuthorDate
Marc Lalancette Dec 3, 2013
RE: How to apply transformation matrix
John Harwell Dec 3, 2013
Marc Lalancette Dec 3, 2013
John Harwell Dec 3, 2013
Marc Lalancette Dec 3, 2013
Richard Reynolds Dec 4, 2013
Richard Reynolds Dec 4, 2013
Marc Lalancette Dec 4, 2013