users > RE: Applying transformations to coordinates?
Aug 20, 2015  09:08 PM | Torsten Rohlfing
RE: Applying transformations to coordinates?
Thanks Gerry - that is exactly correct.

Let me just add a few details. When you are working with a series of concatenated transformations, you must invert each of them, and you must also reverse their order. That's because the inverse of A*B*C is C^-1*B^-1*A^-1.

So if reformatx gets: "a.xform b.xform c.xform", then streamxform would need to get "--inverse c.xform --inverse b.xform --inverse a.xform".

And keep in mind that when your transformations are B-spline FFDs (i.e., what comes out of, say, warp and warpx), then the inverse is approximated numerically, and this approximation may sometimes fail when the transformation is highly nonrigid and perhaps even folded.

Hope this helps.

Torsten


Originally posted by Gerry Sun:
Hey Owen,

Here I quote Greg from his reply to my similar post. streamxform works wonders
As Torsten says, the dof2mat tool will be the easiest way to get a homogeneous affine transformation matrix that you can then use. You also have the option to use the cmtk streamxform tool. You do however need to be a little careful about the directionality of the transform - you'll need the --inverse switch for the direction you mention above. You can see some examples of this here:
https://github.com/jefferislab/BridgingRegistrations

Threaded View

TitleAuthorDate
Owen Randlett Aug 20, 2015
Gerry Sun Aug 20, 2015
RE: Applying transformations to coordinates?
Torsten Rohlfing Aug 20, 2015
Owen Randlett Aug 21, 2015
Owen Randlett Aug 21, 2015
Greg Jefferis Aug 21, 2015