Closed jzhang-neuro closed 2 years ago
Hi Jay,
You either can edit the script to use the antsMultivariateTemplateConstruction2.sh script with the newer version of ANTS (as you noted yourself; recommended) or you can make the FOV larger by adding zero-valued slices in three dimensions.
Hi Jay,
You either can edit the script to use the antsMultivariateTemplateConstruction2.sh script with the newer version of ANTS (as you noted yourself; recommended) or you can make the FOV larger by adding zero-valued slices in three dimensions.
Thank you for your rapid reply. Actually, I have tried to use the antsMultivariateTemplateConstruction2.sh script with the newer version of ANTS. However, the following step after it reported error. The potential reason might be that I can't set the right options for antsMultivariateTemplateConstruction2.sh, since their options of two versions are slightly different (as said in usage). I tried to convert the command buildtemplateparallel.sh
in GBSS into the new antsMultivariateTemplateConstruction2.sh
, but I cannot find the corresponding options for -m 30x50x20 -t GR
in the old version. If I set the default option for Type of transformation model (SyN) and Max iterations for each pairwise registration (100x100x70x20) in the new version, the following step cannot move on because the names of output files are different from those produced by buildtemplateparallel.sh
. Even the name of D1_template.nii.gz
is different: D1_template0.nii.gz
, let alone the files with suffix SyN
(maybe caused by not using option -t GR
, because I can't find it in the new version).
In brief, could you provide me with the right conversion of antsMultivariateTemplateConstruction2.sh
for GBSS (especially Type of transformation model
and Max iterations
), which can work with the next commands in gbss_1_reg.sh
? Or, is there
any specific steps for other solutions for template drifts?
Here is the key infomation comparing two versions:
the buildtemplateparallel.sh -d 3 -j 1 -o D1_ -n 0 -s MI -i $ants_number -m 30x50x20 -t GR -z $template *_pseudoT1.nii.gz
-s: Type of similarity metric used for registration.
-m: Max-iterations in each registration, eg 30x90x30
-t: Type of transformation model used for registration.
antsMultivariateTemplateConstruction2.sh -d 3 -j 1 -o D1_ -n 0 -m MI -i $ants_number -z $template *_pseudoT1.nii.gz
-q: Max iterations for each pairwise registration (default = 100x100x70x20):
specified in the form ...xJxKxL where
J = max iterations at coarsest resolution (here, reduced by power of 2^2)
K = middle resolution iterations (here, reduced by power of 2)
L = fine resolution iteratioxns (here, full resolution).
Finer resolutions take much more time per iteration than coarser resolutions.
-t: Type of transformation model used for registration (default = SyN): Options are case
sensitive.
SyN = Greedy SyN
BSplineSyN = Greedy B-spline SyN
TimeVaryingVelocityField = Time-varying velocity field
TimeVaryingBSplineVelocityField = Time-varying B-spline velocity field
The transformations above are used after Rigid + Affine linear registration, unless linear
registration is disabled with "-l". To use linear registration only, options are:
Affine = Affine (runs Rigid + Affine)
Rigid = Rigid (runs Rigid only).
antsMultivariateTemplateConstruction2.sh has all the options that buildtemplateparallel.sh has.
For the number of iterations here is the default for antsMultivariateTemplateConstruction2.sh: -f 6x4x2x1 -s 4x2x1x0vox -q 50x100x70x20
It depends on your computation power. But, these should work even better than the ones already in the script. q is the number of iterations and -f (shrinkage factor) and -s is for smoothing:
-q: Max iterations for each pairwise registration (default = 100x100x70x20):
specified in the form ...xJxKxL where
J = max iterations at coarsest resolution (here, reduced by power of 2^2)
K = middle resolution iterations (here, reduced by power of 2)
L = fine resolution iteratioxns (here, full resolution).
Finer resolutions take much more time per iteration than coarser resolutions.
-f: Shrink factors (default = 6x4x2x1): Also in the same form as -q max iterations.
Needs to have the same number of components.
-s: Smoothing factors (default = 3x2x1x0): Also in the same form as -q max
iterations. Needs to have the same number of components.
For the transformation model: -t SyN is basically the same as GR
You probably need to run the script line by line after the template creation and change it accordingly. Unfortunately, I have not done that.
-Arash
Hello, Dear Expert,
As mentioned in #11, I noticed that you suggested to check the intermediate templates are saved for QC, because sometimes the template drifts partially out of the field of view. If that occurs, the option
-y 0
ofantsMultivariateTemplateConstruction2.sh
can be used; however, GBSS uses an older version of ANTs(buildtemplateparallel.sh)
. I look up the usage ofbuildtemplateparallel.sh
, However,buildtemplateparallel.sh
doesn't have the option-y 0
to avoid template drifts in translation or orientation. How to deal with template drifts (the frontal part of brain was lack in D1_template.nii.gz) in GBSS usingbuildtemplateparallel.sh
?Thank you very much!
Jay Chang