Replies: 2 comments
-
You may be interested in https://github.com/cobralab/optimized_antsMultivariateTemplateConstruction/ which has implemented a two-level (longitudinal) template construction pipeline, similar to what you're attempting to do manually. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try swapping the order of the affine and warp transforms:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using antsMultivariateTemplateConstruction.sh to create a participant specific template of longitudinal data in baseline space. My pipeline is as follows:
However, step 3 does not correctly concatenate the matrices from antsRegistration and antsMultivariateTemplateConstruction.sh. Does anyone know why? I am I applying the matrices wrong? (if I use antsApplyTransforms using only the matrices from step 1 or step 2 it works. But when i try to apply all the matrices in a single step it doesn't work.
Here is a sample code:
1. Rigidly Align all timepoints to baseline
antsRegistration --dimensionality 3 --output [timepoint1_reg2_baseline, timepoint1_rigid] --interpolation NearestNeighbor --transform Rigid[0.1] --metric MI[baseline.nii.gz, timepoint1.nii.gz,1,32,Regular,0.25] --convergence [1000x500x250x100,1e-6,10] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox
antsRegistration --dimensionality 3 --output [timepoint2_reg2_baseline, timepoint2_rigid] --interpolation NearestNeighbor --transform Rigid[0.1] --metric MI[baseline.nii.gz, timepoint2.nii.gz,1,32,Regular,0.25] --convergence [1000x500x250x100,1e-6,10] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox
2. Create template using baseline scan as the template space
antsMultivariateTemplateConstruction.sh -d 3 -o longitudinal_ -a 1 -c 0 -n 0 -z baseline.nii.gz -y 1 -r 1 baseline.nii.gz timepoint1_rigid.nii.gz timepoint2_rigid.nii.gz
the output matrices are:
longitudinal_baseline0Affine.txt
longitudinal_baseline0Warp.nii.gz
longitudinal_timepoint1_rigid1Affine.txt
longitudinal_timepoint1_rigid1Warp.nii.gz
longitudinal_timepoint2_rigid2Affine.txt
longitudinal_timepoint2_rigid2Warp.nii.gz
longitudinal_template0Affine.txt
longitudinal_template0warp.nii.gz
3. Concatenate and apply all matrices in a single step
antsApplyTransforms -d 3 -i timepoint1.nii.gz -r baseline.nii.gz -o timepoint1_final_reg.nii.gz -n NearestNeighbor -t timepoint1_reg2_baseline0GenericAffine.mat -t longitudinal_timepoint1_rigid1Affine.txt -t longitudinal_timepoint1_rigid1Warp.nii.gz
antsApplyTransforms -d 3 -i timepoint2.nii.gz -r baseline.nii.gz -o timepoint2_final_reg.nii.gz -n NearestNeighbor -t timepoint2_reg2_baseline0GenericAffine.mat -t longitudinal_timepoint2_rigid2Affine.txt -t longitudinal_timepoint2_rigid2Warp.nii.gz
Beta Was this translation helpful? Give feedback.
All reactions