i believe this is the key to unlock your transforms:

trans_mni2anat="  -i anat2mni_Affine.txt anat2mni_InverseWarp.nii.gz  "
trans_anat2func="-i raiders_func2anat_Affine.txt"
trans_mni2func=" $trans_anat2func $trans_mni2anat "

switch both aff/inv  and the  trans  order ....

On Fri, Jul 16, 2010 at 5:28 PM, Yaroslav Halchenko
<[email protected]> wrote:
> Package: ants
> Version: 1.9+svn532-3
> Severity: normal
>
> P.S. CCing all possibly interested parties ;)
>
> According to docstring of WarpTimeSeriesImageMultiTransform sequence of
> necessary transformations could be arbitrarily long.  Having applied a 
> sequence
>
> MNI -> inverse warp -> inverse affine -> inverse affine
>
> produces different (and looks like incorrect) result from if I do 
> transformations in two steps, e.g.
>
> MNI -> inverse warp -> inverse affine
>
> and then result of previous given for the final inverse affine.
>
> Here is output of running reproduce.sh.  All data, script and
> results are available from
>
> http://www.onerussian.com/Linux/bugs/ants.2steps/
>
> I investigate the result by comparing mni2bold.nii.gz  and mni2bold-2.nii.gz
> overlayed on top of epi_template.nii.gz. mni2bold.nii.gz seems to be offset
> toward anterior
>
> $> ./reproduce.sh
> I: Lets do directly all the steps at once
>  Running: WarpTimeSeriesImageMultiTransform 4 mni.nii.gz mni2bold.nii.gz -R 
> epi_template.nii.gz anat2mni_InverseWarp.nii.gz  -i anat2mni_Affine.txt -i 
> raiders_func2anat_Affine.txt --use-NN
> FIELD: anat2mni_InverseWarp.nii.gz
> AFFINE-INV: anat2mni_Affine.txt
> AFFINE-INV: raiders_func2anat_Affine.txt
> moving_image_filename: mni.nii.gz
> output_image_filename: mni2bold.nii.gz
> reference_image_filename: epi_template.nii.gz
> [0/3]: FIELD: anat2mni_InverseWarp.nii.gz
> [1/3]: AFFINE-INV: anat2mni_Affine.txt
> [2/3]: AFFINE-INV: raiders_func2anat_Affine.txt
>  Four-D image size: [182, 218, 182, 1]
>  4D-In-Spc [1, 1, 1, 1]
>  4D-In-Org [-90, 126, -72, 0]
>  4D-In-Size [182, 218, 182, 1]
>  4D-In-Dir 1 0 0 0
> 0 -1 0 0
> 0 0 1 0
> 0 0 0 1
>
>  ......
>  4D-Out-Spc [3, 3, 3, 1]
>  4D-Out-Org [-70.5, -75.759, 93.1085, 0]
>  4D-Out-Size [64, 64, 48, 1]
>  4D-Out-Dir -0 0 1 0
> 1 -0 0 0
> 0 -1 -0 0
> 0 0 0 1
>
>  Use Nearest Neighbor interpolation
> 0 % done ... -0 0 1
> 1 -0 0
> 0 -1 -0
>
>  100 % complete
> I: Lets do directly all the steps at once
>  Step 1 mni->anat: WarpTimeSeriesImageMultiTransform 4 mni.nii.gz 
> mni2anat.nii.gz -R brain_avg.nii.gz anat2mni_InverseWarp.nii.gz  -i 
> anat2mni_Affine.txt --use-NN
> FIELD: anat2mni_InverseWarp.nii.gz
> AFFINE-INV: anat2mni_Affine.txt
> moving_image_filename: mni.nii.gz
> output_image_filename: mni2anat.nii.gz
> reference_image_filename: brain_avg.nii.gz
> [0/2]: FIELD: anat2mni_InverseWarp.nii.gz
> [1/2]: AFFINE-INV: anat2mni_Affine.txt
>  Four-D image size: [182, 218, 182, 1]
>  4D-In-Spc [1, 1, 1, 1]
>  4D-In-Org [-90, 126, -72, 0]
>  4D-In-Size [182, 218, 182, 1]
>  4D-In-Dir 1 0 0 0
> 0 -1 0 0
> 0 0 1 0
> 0 0 0 1
>
>  ......
>  4D-Out-Spc [1, 1, 1, 1]
>  4D-Out-Org [-86.8253, -128, 132.723, 0]
>  4D-Out-Size [256, 256, 176, 1]
>  4D-Out-Dir -0 0 1 0
> 1 -0 0 0
> 0 -1 -0 0
> 0 0 0 1
>
>  Use Nearest Neighbor interpolation
> 0 % done ... -0 0 1
> 1 -0 0
> 0 -1 -0
>
>  100 % complete
>  Step 2 anat->mni: WarpTimeSeriesImageMultiTransform 4 mni2anat.nii.gz 
> mni2bold-2.nii.gz -R epi_template.nii.gz -i raiders_func2anat_Affine.txt 
> --use-NN
> AFFINE-INV: raiders_func2anat_Affine.txt
> moving_image_filename: mni2anat.nii.gz
> output_image_filename: mni2bold-2.nii.gz
> reference_image_filename: epi_template.nii.gz
> [0/1]: AFFINE-INV: raiders_func2anat_Affine.txt
>  Four-D image size: [256, 256, 176, 1]
>  4D-In-Spc [1, 1, 1, 1]
>  4D-In-Org [-86.8253, -128, 132.723, 0]
>  4D-In-Size [256, 256, 176, 1]
>  4D-In-Dir -0 0 1 0
> 1 -0 0 0
> 0 -1 -0 0
> 0 0 0 1
>
>  ......
>  4D-Out-Spc [3, 3, 3, 1]
>  4D-Out-Org [-70.5, -75.759, 93.1085, 0]
>  4D-Out-Size [64, 64, 48, 1]
>  4D-Out-Dir -0 0 1 0
> 1 -0 0 0
> 0 -1 -0 0
> 0 0 0 1
>
>
>
>
> -- System Information:
> Debian Release: squeeze/sid
>  APT prefers unstable
>  APT policy: (901, 'unstable'), (900, 'testing'), (300, 'experimental')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
> Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages ants depends on:
> ii  libc6                        2.11.2-2    Embedded GNU C Library: Shared 
> lib
> ii  libgcc1                      1:4.4.4-6   GCC support library
> ii  libinsighttoolkit3.18        3.18.0-3+b1 Image processing toolkit for 
> regis
> ii  libstdc++6                   4.4.4-6     The GNU Standard C++ Library v3
>
> ants recommends no packages.
>
> Versions of packages ants suggests:
> ii  fsl                           4.1.6-1    analysis tools for FMRI, MRI and 
> D
> pn  gridengine-client             <none>     (no description available)
>
> -- no debconf information
>
> --
>                                  .-.
> =------------------------------   /v\  ----------------------------=
> Keep in touch                    // \\     (yoh@|www.)onerussian.com
> Yaroslav Halchenko              /(   )\               ICQ#: 60653192
>                   Linux User    ^^-^^    [175555]
>
>
>
>
>



-- 
ß®∫∆π



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to