Nipype workflow example for ANTS for registering DTI --> Struct --> MNI (and applying inverse xfms)

Is anyone aware of any validated workflows that use NiPype +Ants to perform a two step registration? I tried to google around but didn’t find any good examples…

I have been able to register my DTI --> Struct (Affine Only) and then Struct --> MNI (Affine+Warp) using Nipype… and the results look good…

The syntax for ANTS itself is pretty confusing, and when you add in concatenating multiple affine and nonlinear warp fields, it’s even more difficult. Since this seems like a fairly typical issue, I wanted to see if anyone could point me towards an existing workflow that accomplishes a similar task so I could compare…

I created a GIST here which shows the initial pipeline. This generates the ants Registration from my DTI space -->Struct–>MNI1mm, and also applies an inverse registration to take an example ROI in MNI space and convert it to the DTI image space… This was using some data I downloaded from the Human Connectome Project for testing.

In this example, I am using WarpImageMultiTransform and I want to make sure I am getting things correct… the program will warp image MOVING --> REF regardless of whether or not I am actually applying the transformations in the right order… so wanted to see if I could use an existing example to validate my workflow.

I’ve not computed the XFMS, I want to now convert the nodif_brain to MNI Space to make sure the registration looks good…

WarpImageMultiTransform 3 nodif_brain.nii.gz nodif_to_mni_debug_warp_strucToMNI_dtiToStruct.nii.gz -R ./MNI152_T1_1mm.nii.gz --use-NN ./structToMNI1Warp.nii.gz ./structToMNI0GenericAffine.mat ./dtiToStruct0GenericAffine.mat

Also try it the reverse way i.e. take the MNI–> nodif_brain (i.e. DTI Space)

WarpImageMultiTransform 3 MNI152_T1_1mm.nii.gz mni1mm_to_dti.nii.gz -R nodif_brain.nii.gz --use-NN ./structToMNI1InverseWarp.nii.gz -i ./structToMNI0GenericAffine.mat -i ./dtiToStruct0GenericAffine.mat