Nonlinear transform EPI data

I am attempting to nonlinearly transform T1 images and their previously aligned EPI datasets to MNI space. Should I use on the T1 and EPI datasets individually, or should I use on the T1 images and then use 3dNwarpApply on the EPI data with the -nwarp ‘anat_un.aff.qw_WARP.nii’ option? This is new for me, so thanks for your help.

You should use[/url] to normalize your T1 to MNI space. And then use [url=]3dNwarpApply to apply that transform to your EPI data.

There is a new tool: @SSwarper[/url] that will take care of the skull stripping and nonlinear warping (via 3dQwarp) your T1 to MNI space, and then you can use 3dNwarpApply to apply the transformation to your EPI dataset. You’ll see in the help, there are also hooks in [url=] for taking the output of @SSwarper and doing all the other processing on your EPI datasets.


Thank you. I am having trouble finding the correct 3d warp dataset to use with the -nwarp option in 3dNwarpApply. I tried the following: 3dNwarpApply -nwarp anat.un.aff.qw_WARP.nii (from, but the output’s alignment is way off.

It’s unclear to me where I can find the correct 3d warp transform to apply to my epi data. Is this dataset available in the output?

The result has 2 transformations, an affine and a non-linear one, and they need to be concatenated. In your case, expect to do something like:

3dNwarpApply ... -nwarp "anat.un.aff.qw_WARP.nii anat.un.aff.Xat.1D"  ...

You can also see how this is handled in the context of an script, in AFNI_data6/FT_analysis/

  • rick

I noticed that you didn’t include the “-align_opts_aea -cost lpc+ZZ” option in the above script.
Is there a reason for not including this?

This option is included in example 11.


Those files should be updated to match the current help, I
do not always think to do that. lpc+ZZ is what I generally

Thank you for looking closely.

  • rick

Hi AFNI Experts,

I had a subject that I ran once and the outputs had some line/vein artifacts. I took that output and ran once more and the results came out great. When I concatenated the second set of transforms to apply to the original output of the first things looked great. (3dNwarpApply -nwarp ‘ anat.aff.Xat.1D’ -source …/ -prefix -interp wsinc5).

The problem comes when I want to concatenate all sets of warps together (3dNwarpApply -nwarp ‘ anat.aff.Xat.1D …/ …/anat.aff.Xat.1D’ -source …/anat.nii -prefix anat.final1.nii -interp wsinc5) I still get some line/vein artifact. I would like to combine all transforms so I can apply this warp to other data such as the T2 or BOLD imaging etc.

I also tried to run (second time) and pass an -iniwarp of the original anat.aff.Xat.1D and then a second time turning affine off so I just get a nonlinear warp and running with iniwarp and in all cases I still get the artifact. The only way this does not occur is if I warp the files once using the original transform and then warping that output again using the newer warp/affine parameters. Could it be a precision error when using a small patch size(minpatch 5) and combining warps? Does 3dNwarpApply use the affine matrix as part of the qform/sform in the same fashion as when writing the file out?

Is there a different way to implement combining warps when using multiple sets of transforms or better way to use iniwarp? I played around with adding IDENT( and different combos of this with no success.

Any suggestions would be much appreciated.


Have you taken a look at either 3dNwarpCat[/url] or [url=]3dNwarpCalc?

I tend to use 3dNwarpCat more, and then you can apply it with 3dNwarpApply.

Hi Peter,
I also tried using 3dNwarpCat to combine the transforms and warp and had the same issue. Do 3dNwarpCat and 3dNwarpCalc function differently? I


I don’t understand what you mean by “line/vein” artifact. Do you mean that you get some WM squished down to little tiny threads?