I've worked out some of the problems recently, so I'm hoping this helps. There are a few ways to warp from the template space to the original native space (your B0 space). One important consideration is the overlapping of the grids. Bob has done a lot of work to make this work properly, but you have to use 3dNwarpApply to concatenate the warps; otherwise, transformations aren't defined outside the grid with the other methods of concatenating nonlinear warps (3dNwarpCat and 3dNwarpCalc), partly because there is no "master" dataset. Inverting the nonlinear warp transformation in-line gives the equivalent of using the pre-made one out 3dQwarp , but it's slower if you have to do this more than once.
# good way
3dNwarpApply -prefix T2_template_al2sub_nwapply -nwarp 'T2_sub_shft_inv.aff12.1D awpy/anat.un.aff.qw_WARPINV.nii' \
-source T2_template.nii -master T2_subject_shft.nii
# maybe good, but not off-grid
3dNwarpCat -prefix T2_template_al2subWARPINV -overwrite -warp2 'awpy/anat.un.aff.qw_WARPINV.nii' -warp1 T2_sub_shft_inv.aff12.1D
3dNwarpApply -prefix T2_template_al2sub_nwcat2 -nwarp T2_template_al2subWARPINV+tlrc \
-source T2_template.nii -master T2_subject_shft.nii
# also maybe good, but not off-grid
cat_matvec T2_subject_shft_al2T2template_mat.aff12.1D -I > T2_sub_inv_matrix.1D
3dNwarpCalc "&readwarp(awpy/anat.un.aff.qw_WARPINV.nii)" "&read4x4(T2_sub_inv_matrix.1D)" \
"&compose" "&write(T2_template_al2sub_nwcalc_WARPINV)"
3dNwarpApply -prefix T2_template_al2sub_nwcalc -nwarp T2_template_al2sub_nwcalc_WARPINV+tlrc. \
-source T2_template.nii -master T2_subject_shft.nii
Edited 1 time(s). Last edit at 01/06/2015 04:01PM by Daniel Glen.