ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.21k stars 381 forks source link

Warping MNI Atlas to Native Space Through Single Subject Template #1691

Closed hgstephe closed 8 months ago

hgstephe commented 8 months ago

Hello!

I'm trying to use ANTs for a longitudinal pipeline with the following intended steps:

1) Make single subject templates with multivariate template construction 2) Use Syn Registration to register the template with FSL's MNI152 template (prefix MNI_) 3) Pull MNI co-registered atlas labels back to native space (image_a.nii) through the template using the following command: antsApplyTransforms -d 3 -i HarvardOxford-sub-maxprob-thr0-1mm.nii.gz -r image_a.nii -t [ MNI_0GenericAffine.mat , 1] -t MNI_1InverseWarp.nii.gz -t [ image_a_00GenericAffine.mat , 1 ] -t image_a_01InverseWarp.nii.gz -n GenericLabel -o atlas_to_native.nii.gz

However, the resulting image looks a little wonky (see attached image showing poor alignment of hippocampus with atlas labels).

Just applying the first set of transforms to get atlas labels for the template gives the expected results (see other attached image), so I'm wondering if I'm messing up the order of the template to native transforms.

atlas_to_native atlas_to_template

Much appreciated!

cookpa commented 8 months ago

Good hypothesis, but we need the registration commands to evaluate the correct order of transforms

hgstephe commented 8 months ago

Hello, here are the commands and the resultant atlas image warped from MNI to native space:

temp_call reg_call atlas_to_native atlas
cookpa commented 8 months ago

OK thanks. Yes, I think you have the transforms backwards, the MNI_ pair should be on the right side.

https://github.com/ANTsX/ANTs/wiki/Forward-and-inverse-warps-for-warping-images,-pointsets-and-Jacobians#standard-space-through-an-intermediate-template

Also, you should know that the template is updated after every pairwise registration in antsMultivariateTemplateConstruction*.sh. So if you are using the warps left in the working directory, they are one template iteration behind. This might be a very small difference (see the intermediateTemplates directory to check) but ideally you would run antsRegistrationSyN.sh for each input to the final template.

Running antsRegistrationSyNQuick.sh might not be optimal for the template to MNI registration. I would try antsRegistrationSyN.sh as well.

The quality of the final registration will depend on all the steps in the pipeline, so to judge results you have to look at

  1. The overlap of labels with anatomy in the MNI space (this can vary quite a bit)
  2. The quality of registration from the MNI template to the local template.
  3. The quality of registration from the local template to the individual subject image.
hgstephe commented 8 months ago

Thank you, Philip! That clears things right up. Thanks for your help!