-
Notifications
You must be signed in to change notification settings - Fork 2
1. Template
The final call to antsMultivariateTemplateConstruction2.sh
is as follows:
antsMultivariateTemplateConstruction2.sh -d 3 -o /data/output/${projectName}Template_ -n 0 -i 5 -c 2 -j 8 -g .15 -m CC[2] -q 500x500x500x500x500x500x500x500x500x500x500x500x500x500x500x500x225x75x25,1e-6,10 -f 8x8x8x8x8x8x8x8x8x8x8x8x7x6x5x4x3x2x1 -s 8.057374066034377x7.6320909504467975x7.206734452718699x6.781290764178728x6.355742375591618x5.930066746813941x5.5042343571715975x5.078205771322212x4.651927085986457x4.225322606736783x3.798282560433022x3.370641399941647x2.942137020149432x2.5123277660148595x2.0804050381276458x1.6447045940431997x1.2011224087864498x0.735534255037358x0.0mm -z /data/output/MNI-1x1x1Head_pad.nii.gz /data/output/tmp_subjlist.csv
Steps of the template construction (Ellyn's understanding as of February 22, 2021):
- Rigidly align all of the SSTs in
/data/output/tmp_subjlist.csv
to the reference template specified with-z
. - Perform pairwise deformable registrations from each SST to the reference template, where each image is downsampled according to
-f
(shrinkage, or how much the registered image is allowed to change per iteration), the number of deformable stages is specified using-q
, and the smoothing is specified using-s
(the number supplied is the sigma for a multivariate Gaussian distribution). This is performed in stages, according to the numbers specified between the x's. - Register the moving images (SSTs) pairwise to the template space and average them.
- Invert the average warp to the template space, and apply to the average of the registered SSTs. The inverse of the average warp is scaled in magnitude by
-g
, so lower values of-g
will result is less change (i.e., smaller deformations) between template iterations. The output of this is the template for the next round of pairwise registrations. - Repeat 2-4
-i
times.
Details:
-n 0
: No N4 bias field correction (was performed on the T1w images that comprise the SSTs)
-c 2
: Allow for parallel computation using pexec
-j 8
: Number of cpu cores (8) to use locally for pexec option
-g .15
: Gradient step size. Changes the shape of the template at each iteration (-i
). Lower values might help convergence, but will not improve pairwise registrations
-m CC[2]
: Similarity metric is cross-correlation (CC), with a radius of 2, which defines the volume over which the cross-correlation is computed
Notes
- Estimate how much the template is changing every iteration by calculating the Jacobian of
template0warp.nii.gz
- The average inverse warp is applied to try to change the shape of the template to better represent the population average. The best template has a mean transform close to 0 because the population transforms to the average point largely cancel out. It is also done to prevent small biases in pairwise registrations squishing the template over time.