[MINC-users] xfm2param problem

Andrew Janke a.janke at gmail.com
Thu May 18 14:33:19 EDT 2006


Hi Ed,

First I presume you mean:

   param2xfm -translation (not -transform)

What you have to remember here is that xfm2param and param2xfm assume
a certain order of operations.  An affine transformation doesn't care
(or know) about translation, rotation and scale, it is just a matrix
operation.

So this means that if you wish to do the below, you just need to make
sure that you apply the operations in the same order as param2xfm
does. ie:

Instead of:

   xfmtool xT.xfm xR.xfm xS.xfm xTRS.xfm

use:

   xfmtool xS.xfm xR.xfm xT.xfm out.xfm

Your translation of ~300 came from a translation of 10 and then a
rotation (moves the initial translation out of plane) and then a scale
of 30 (effectively multiplies the translation by 30).

Andrew

On 5/18/06, EJ Nikelski <nikelski at bic.mni.mcgill.ca> wrote:
> Hi List,
>
>    I have a need to modify xfm files by extracting or retaining various
> transform types (transform, rescale, etc). For example, taking an xfm
> that transforms to Talairach, but keeping the rescale set to 1.0,
> providing me with an xfm that puts my volume into Talaiarch-ish
> orientation, while keeping the native brain dimensions (this can be
> useful for brain painting). Up until now I've used xfm2param/param2xfm
> to modify the xfms as needed -- without a problem.
>
>    However, while working on a new project, I noticed this rather
> strange phenomenon.If you create an xfm as follows ...
>
> param2xfm -transform 10 10 10 -rotation 20 20 20 -scale 30 30 30 x0.xfm
>
> ... you get as expected. Next, use the individual transformation type
> info, and then combine with xfmtool, i.e.,
>
> param2xfm -transform 10 10 10 xT.xfm
> param2xfm -rotation 20 20 20 xR.xfm
> param2xfm -scale 30 30 30 xS.xfm
> xfmtool xT.xfm xR.xfm xS.xfm xTRS.xfm
>
> ... "cat xTRS.xfm" shows the 3 appended xfms - OK. But an xfm2param of
> the file shows strange translation values ...
>
> jnikelski@[~/xxx]: xfm2param xTRS.xfm
> after parameter extraction
> -center         0.00000    0.00000    0.00000
> -translation  327.16223  309.88623  258.71875
> -rotation      20.00000   20.00000   20.00000
> -scale         30.00000   30.00000   30.00000
> -shear         -0.00000   -0.00000    0.00000
>
>
> Should this not work? Or am I missing something fundamental here? ..
> which is, of course, all too likely :(
>
>
> Thanks,
>
> -Jim
>
>
>
> --
> E. James Nikelski, Ph.D.
> Postdoctoral Research Fellow
> Bloomfield Centre for Research in Aging
> Lady Davis Institute for Medical Research
> Sir Mortimer B. Davis - Jewish General Hospital
> McGill University
> Tel: (514) 340-8222 x 2298
> Fax: (514) 340-8295
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


-- 
Andrew Janke   (a.janke at gmail.com || http://a.janke.googlepages.com/)
Canada->Montreal                                   Cell: +1 (514) 924 2012



More information about the MINC-users mailing list