Dear list,
I notice I took this off-list for no apparent reason…. Maybe it can be useful..
best Sebastian
Begin forwarded message:
From: Sebastian Moeller sebastian.moeller1@rwth-aachen.de Subject: Re: [Freesurfer] Applying two registration matrices Date: January 20, 2014 15:09:45 GMT+01:00 To: "Caspar M. Schwiedrzik" cschwiedrz@mail.rockefeller.edu
On Jan 20, 2014, at 14:36 , "Caspar M. Schwiedrzik" cschwiedrz@mail.rockefeller.edu wrote:
Hi Freesurfer Experts, I was wondering what the best way to apply two registration matrices to the same data set would be, ideally without re-slicing after the first registration?
Just multiply the matrices and apply the result?
From http://en.wikipedia.org/wiki/Transformation_matrix
Composing and inverting transformations[edit]
One of the main motivations for using matrices to represent linear transformations is that transformations can then be easily composed (combined) and inverted. Composition is accomplished by matrix multiplication. If A and B are the matrices of two linear transformations, then the effect of applying first A and then B to a vector x is given by:
(This is called the associative property.) In other words, the matrix of the combined transformation A followed by B is simply the product of the individual matrices. Note that the multiplication is done in the opposite order from the English sentence: the matrix of "A followed by B" is BA, not AB. A consequence of the ability to compose transformations by multiplying their matrices is that transformations can also be inverted by simply inverting their matrices. So, A−1 represents the transformation that "undoes" A.
You could use the attached m files to read and write free surfer registration matrices and do the multiplication in matlab. (You probably could also apply the matrix in matlab or feed the matrix into tkregister2 or whatever script/binary was supposed to work on the original registration matrices…)
best Sebastian
Thanks, Caspar
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
freesurfer@nmr.mgh.harvard.edu