Skip to content

Instantly share code, notes, and snippets.

@satra
Created July 21, 2011 00:50
Show Gist options
  • Select an option

  • Save satra/1096274 to your computer and use it in GitHub Desktop.

Select an option

Save satra/1096274 to your computer and use it in GitHub Desktop.

Revisions

  1. satra revised this gist Jul 21, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ c3d : http://www.itksnap.org/pmwiki/pmwiki.php?n=Convert3D.Convert3D

    ::

    c3d_affine_tool -ref [E] -src D flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt
    c3d_affine_tool -ref [E] -src [D] flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt

    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

  2. satra revised this gist Jul 21, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ c3d : http://www.itksnap.org/pmwiki/pmwiki.php?n=Convert3D.Convert3D

    ::

    c3d_affine_tool -ref [E] -src F flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt
    c3d_affine_tool -ref [E] -src D flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt

    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

  3. satra revised this gist Jul 21, 2011. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    ANTS : http://picsl.upenn.edu/ANTS/
    c3d : http://www.itksnap.org/pmwiki/pmwiki.php?n=Convert3D.Convert3D

    ::

    export PATH=/software/ANTS-dev:$PATH
  4. satra revised this gist Jul 21, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    - A = your structural brain/orig.mgz, but converted to nii. you should already have this in your ANTS output
    - B = con/t/z image that you want to warp
    bbreg.mat = when your bbregister node has out_fsl_file = True
    - bbreg.mat = when your bbregister node has out_fsl_file = True
    - C = warped con/t/z image
    - D = ANTS template or other template to which you computed the ANTS warp (unless you have another affine transform see note below)
    - A_Warp = should equal the Warp fields from running ANTS, they should be called sth_Warp[xyz]vec.nii.gz. you simply need to provide sth_Warp.nii.gz
  5. satra revised this gist Jul 21, 2011. 1 changed file with 9 additions and 13 deletions.
    22 changes: 9 additions & 13 deletions warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -6,25 +6,21 @@

    WarpImageMultiTransform 3 [B] [C] -R [D] [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    A = your structural brain/orig.mgz, but converted to nii. you should already have this in your ANTS output

    B = con/t/z image that you want to warp
    - A = your structural brain/orig.mgz, but converted to nii. you should already have this in your ANTS output
    - B = con/t/z image that you want to warp
    bbreg.mat = when your bbregister node has out_fsl_file = True

    C = warped con/t/z image

    D = ANTS template or other template to which you computed the ANTS warp (unless you have another affine transform see note below)

    A_Warp = should equal the Warp fields from running ANTS, they should be called sth_Warp[xyz]vec.nii.gz. you simply need to provide sth_Warp.nii.gz

    A_Affine = there should also be an affine transform in the place where ANTS was run.
    - C = warped con/t/z image
    - D = ANTS template or other template to which you computed the ANTS warp (unless you have another affine transform see note below)
    - A_Warp = should equal the Warp fields from running ANTS, they should be called sth_Warp[xyz]vec.nii.gz. you simply need to provide sth_Warp.nii.gz
    - A_Affine = there should also be an affine transform in the place where ANTS was run.

    .. note::
    if you also have an affine transform using flirt for your own template to MNI space and you did not use the MNI spaced template as your target
    if you also have an affine transform using flirt for your own template to MNI space and you did not use the MNI spaced template as your target

    ::

    c3d_affine_tool -ref [E] -src F flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt

    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    E = template in MNI space after flirting
    - E = template in MNI space after flirting
  6. satra revised this gist Jul 21, 2011. 1 changed file with 17 additions and 6 deletions.
    23 changes: 17 additions & 6 deletions warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,30 @@
    export PATH=/software/ANTS-dev:$PATH
    c3d_affine_tool -ref [A] -src [B] bbreg.mat -fsl2ras -oitk fsl2antsAffine.txt
    WarpImageMultiTransform 3 [B] [C] -R [D] [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt
    ::

    export PATH=/software/ANTS-dev:$PATH

    c3d_affine_tool -ref [A] -src [B] bbreg.mat -fsl2ras -oitk fsl2antsAffine.txt

    WarpImageMultiTransform 3 [B] [C] -R [D] [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    A = your structural brain/orig.mgz, but converted to nii. you should already have this in your ANTS output

    B = con/t/z image that you want to warp
    bbreg.mat = when your bbregister node has out_fsl_file = True

    C = warped con/t/z image

    D = ANTS template or other template to which you computed the ANTS warp (unless you have another affine transform see note below)

    A_Warp = should equal the Warp fields from running ANTS, they should be called sth_Warp[xyz]vec.nii.gz. you simply need to provide sth_Warp.nii.gz

    A_Affine = there should also be an affine transform in the place where ANTS was run.

    note:
    .. note::
    if you also have an affine transform using flirt for your own template to MNI space and you did not use the MNI spaced template as your target

    c3d_affine_tool -ref [E] -src F flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt
    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt
    ::
    c3d_affine_tool -ref [E] -src F flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt

    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    E = template in MNI space after flirting
  7. satra created this gist Jul 21, 2011.
    19 changes: 19 additions & 0 deletions warpinfo.rst
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    export PATH=/software/ANTS-dev:$PATH
    c3d_affine_tool -ref [A] -src [B] bbreg.mat -fsl2ras -oitk fsl2antsAffine.txt
    WarpImageMultiTransform 3 [B] [C] -R [D] [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    A = your structural brain/orig.mgz, but converted to nii. you should already have this in your ANTS output
    B = con/t/z image that you want to warp
    bbreg.mat = when your bbregister node has out_fsl_file = True
    C = warped con/t/z image
    D = ANTS template or other template to which you computed the ANTS warp (unless you have another affine transform see note below)
    A_Warp = should equal the Warp fields from running ANTS, they should be called sth_Warp[xyz]vec.nii.gz. you simply need to provide sth_Warp.nii.gz
    A_Affine = there should also be an affine transform in the place where ANTS was run.

    note:
    if you also have an affine transform using flirt for your own template to MNI space and you did not use the MNI spaced template as your target

    c3d_affine_tool -ref [E] -src F flirt.mat -fsl2ras -oitk fsl2antsTemplateAffine.txt
    WarpImageMultiTransform 3 [B] [C] -R [E] fsl2antsTemplateAffine.txt [A_Warp].nii.gz [A_Affine].txt fsl2antsAffine.txt

    E = template in MNI space after flirting