[MINC-users] mincresample - what is the expected behavior

Andrew Janke a.janke at gmail.com
Sat Jan 2 06:13:56 EST 2010


> Thank you very much! I am trying to debug a minctracc error I am getting and got confused when minctracc said the following:
>
> after parameter optimization
> -center      -508.71222    0.90644   -5.98667
> -translation  508.09448    0.51216   -1.63015
> -rotation      -3.84787    1.13791  -13.16369
> -scale          1.00000    1.00000    1.00000
> -shear          0.00000    0.00000    0.00000
>
> and xfm2param gave me the following on the transformation that was created by minctracc:
>
> -center         0.00000    0.00000    0.00000
> -translation  494.63181 -114.92624  -11.68648
> -rotation      -3.84787    1.13791  -13.16369
> -scale          1.00000    1.00000    1.00000
> -shear          0.00000   -0.00000   -0.00000
>
> When I saw that large difference in the translation, I tried to simulate the problem by using param2xfm and specifying the translation and rotation at the same time with the output of minctracc, but given your response I now found that this is indeed not where things go wrong.

Correct, or at least the above output is not incorrect, xfm2param has
to make assumptions when doing an Euler angle decomposition (3
rotations) of an affine transformation matrix.  One of these is that
it will assume the centre of rotation is 0,0,0. You can change this
with the -center argument and this then will give you a differing set
of rotations and transformations. Another assumption is that the
rotation can never be more than 90deg in any direction, this is not
always true in the general case but minctracc will not find a rotation
larger than this due to the "gimball lock" problem. (See:
http://en.wikipedia.org/wiki/Euler_angles).

That said minctracc optimises using an Euler angle representation and then
converts this to an affine matrix at the end in order to save the result.

> Things go wrong when I now use this transformation as input for a sequential minctracc call in order to refine the initial registration. That second transformation I get from minctracc is:
>
> -center         0.00000    0.00000    0.00000
> -translation  495.03180 -114.52625  -11.28648
> -rotation      -2.84787    2.13791  -16.16369
> -scale          1.00000    1.00000    1.00000
> -shear          0.00000   -0.00000    0.00000
>
> So minctracc seems to have mainly improved on the rotation side with respect to the input transformation, but the translation part looks mostly unchanged. Could it be that now there is a problem in terms of concatenating transforms?

I would dobt it.

> i.e., does minctracc concatenate the input transformation with the transformation it finds after the optimization?

Yes.

> Because when I use this second transformation on my source image it is lost/gone.

Depends on what you are doing with mincresample. When you resample you
are going to have to ensure that your output sampling will cover the
area where your image has been transformed too (in your case 500mm in
X).   The general formula is like this:

   minctracc source.mnc target.mnc out.xfm

   mincresample -like target.mnc -transformation out.xfm source.mnc out.mnc

Meaning the output sampling is taken from the target file.


--
Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883



More information about the MINC-users mailing list