ANTs icon indicating copy to clipboard operation
ANTs copied to clipboard

how to use unbiased_pairwise_registration

Open stnava opened this issue 7 years ago • 0 comments

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:

  1. compute two affine maps A to B and B to A

  2. average these to get a midpoint affine mapping

  3. estimate affine maps to this mid-point ( new mid point maps )

  4. do deformable registration with initial transforms from step 3

  5. 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.

r16slice.nii.gz r64slice.nii.gz

stnava avatar Feb 21 '17 11:02 stnava