ANTsX / ANTs

Advanced Normalization Tools (ANTs)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected antsRegistrationSynQuick Result

hgstephe opened this issue · comments

Hello,

I have a question about a result I'm getting using antsRegistrationSynQuick. I use the command to align an input image to FSL's MNI152 template brain and pull the MNI template back to moving space using the following commands:

antsRegistrationSyNQuick.sh -d 3 -m input_image.nii.gz -f MNI152lin_T1_1mm.nii.gz -o test_

antsApplyTransforms -d 3 -i MNI152lin_T1_1mm.nii.gz -r input_image.nii.gz -t [ test_0GenericAffine.mat, 1 ] -t test_1InverseWarp.nii.gz -o fixed_to_moving.nii.gz

The resulting image is not in voxel-to-voxel alignment with the moving space image, as shown in the first screenshot, but is when viewed in ITK-SNAP in the second screenshot.

I'm guessing this is expected behavior given that ANTs is using ITK coordinates in general. But I'm wondering if I can get more insight into why the resulting image doesn't map voxel-to-voxel with the moving space image (i.e. why world-space seems to be mapping to a different image than the input, and what steps might have gone into that).

Thank for for taking the time to answer, and thank you for the excellent tools!

screenshot_1 screenshot_2

My first guess is that fsleyes is interpreting the header differently. In the NIFTI standard, the qform and sform can represent a transform to MNI space, but ITK doesn't use these, it looks for NIFTI_XFORM_SCANNER_ANAT. ITK also requires a rigid transform + voxel scaling transform between voxel and physical coordinates, it doesn't allow a generalized affine transform.

https://github.com/ANTsX/ANTs/wiki/How-does-ANTs-handle-qform-and-sform-in-NIFTI-1-images%3F

You can look at your headers with PrintHeader