[vtkusers] ITK transformation matrix format?

David Gobbi david.gobbi at gmail.com
Mon Apr 1 19:43:05 EDT 2013


Hi Seung-Goo,

Your question is really an ITK question, but I'll see if I can give it a
shot.

The answer lies in the code for the base class for ITK affine transforms,
i.e. in itkMatrixOffsetTransformBase.hxx, specifically in the following
methods:

  SetParameters()
  SetFixedParameters()
  ComputeOffset()
  TransformPoint()

 T = [
 a b c o
 d e f p
 g h i q
 0 0 0 1
 ]

The "o p q" are the "offset", which actually is not given in the file.  The
offset is computed from the 3x3 matrix (the first 9 parameters), from the
translation "l m n" (the last three parameters), and from the center "x y z"
(the three fixed parameters).   To see how this is done, look at the code
for ComputeOffset() itkMatrixOffsetTransformBase.hxx.  I'm not going
to write out the math here in this email because chances are that I would
make a mistake.

 - David


On Mon, Apr 1, 2013 at 5:14 AM, SG KIM <solleo at gmail.com> wrote:

> Dear ITK/VTK experts,
>
> I have a question on the format of :itk: transformation file.
>
> In such a text file for affine matrix (generated by ANTS):
> #Insight Transform File V1.0
> # Transform 0
> Transform: MatrixOffsetTransformBase_double_3_3
> Parameters: a b c d e f g h i l m n
> FixedParameters: x y z
>
> Does it mean a transformation matrix as
>
> T = [a b c x;
>      d e f y;
>      g h i z;
>      l m n 1]
>
> in such that
> T * [x y z 1]^T = [x'/s y'/s z'/s 1]^T
> where [x,y,z] is original coordinates and [x/s', y'/s, z'/s] is
> transformed coordinate with s as global scaling factor?
>
> or something else?
>
>
> Best,
>   ---
> Seung-Goo KIM
>
> PhD student
> Research group "Cortical Networks and Cognitive Functions"
> Max Planck Institute for Human Cognitive and Brain Sciences
> Stephanstraße 1A, 04103 Leipzig, Germany
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130401/1c1efc11/attachment.htm>


More information about the vtkusers mailing list