ANTs
ANTs copied to clipboard
how to use unbiased_pairwise_registration
the script maps two images together through a midpoint space, not a midpoint image
this defines an unbiased registration geometry but not an average image. 2 different concepts.
unbiased_pairwise_registration.sh -d 2 -f r16slice.nii.gz -m r64slice.nii.gz -o /tmp/Example
if we break this down into steps, then we have:
-
compute two affine maps A to B and B to A
-
average these to get a midpoint affine mapping
-
estimate affine maps to this mid-point ( new mid point maps )
-
do deformable registration with initial transforms from step 3
-
apply full maps to get the registration results:
# this is the composite mapping - via the mid-point - to the A image
antsApplyTransforms -d $dim -i $B -o ${nm}_diffX.nii.gz \
-t [ $midaaff, 1 ] -t ${nm}1Warp.nii.gz -t $midbaff -r $A
# one can gain the inverse in a similar way
antsApplyTransforms -d $dim -i $A -o ${nminv}_diffX.nii.gz \
-t [ $midbaff, 1 ] -t ${nm}1InverseWarp.nii.gz -t $midaaff -r $B
if you inspect the above code, you will see the symmetry in how the final maps are applied.