Skip to content

Commit

Permalink
ENH: identity init transform for (bspline)syn-only
Browse files Browse the repository at this point in the history
If using -t so or -t bo, the COM initialization is usually not wanted
  • Loading branch information
cookpa committed Dec 11, 2024
1 parent 2f51243 commit 47bb386
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
21 changes: 19 additions & 2 deletions Scripts/antsRegistrationSyN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ Optional arguments:
-n: Number of threads (default = ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS if defined, otherwise 1)
-i: initial transform(s) --- order specified on the command line matters
-i: initial transform(s) --- order specified on the command line matters. If not specified, a
default initialization is used, based on the transform type.
For "syn only" and "b-spline syn only" transforms, the initial transform is the identity
matrix. For other transforms, it is a translation that aligns the input centers of mass.
-t: transform type (default = 's')
t: translation (1 stage)
Expand Down Expand Up @@ -131,7 +135,11 @@ Optional arguments:
-n: Number of threads (default = ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS if defined, otherwise 1)
-i: initial transform(s) --- order specified on the command line matters
-i: initial transform(s) --- order specified on the command line matters. If not specified, a
default initialization is used, based on the transform type.
For "syn only" and "b-spline syn only" transforms, the initial transform is the identity
matrix. For other transforms, it is a translation that aligns the input centers of mass.
-t: transform type (default = 's')
t: translation (1 stage)
Expand Down Expand Up @@ -506,6 +514,15 @@ if [[ $REPRO -eq 1 ]];

INITIALSTAGE="--initial-moving-transform [ ${FIXEDIMAGES[0]},${MOVINGIMAGES[0]},1 ]"

if [[ ${TRANSFORMTYPE} == 'so' ]] || [[ ${TRANSFORMTYPE} == 'bo' ]];
then
# Could just set to an empty string but this is more explicit and also keeps transform
# numbering consistent with other use cases
#
# Default to identity if we are doing "syn only" or "b-spline syn only"
INITIALSTAGE="--initial-moving-transform Identity"
fi

if [[ ${#INITIALTRANSFORMS[@]} -gt 0 ]];
then
INITIALSTAGE=""
Expand Down
21 changes: 19 additions & 2 deletions Scripts/antsRegistrationSyNQuick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ Optional arguments:
-n: Number of threads (default = ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS if defined, otherwise 1)
-i: initial transform(s) --- order specified on the command line matters
-i: initial transform(s) --- order specified on the command line matters. If not specified, a
default initialization is used, based on the transform type.
For "syn only" and "b-spline syn only" transforms, the initial transform is the identity
matrix. For other transforms, it is a translation that aligns the input centers of mass.
-t: transform type (default = 's')
t: translation (1 stage)
Expand Down Expand Up @@ -134,7 +138,11 @@ Optional arguments:
-n: Number of threads (default = ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS if defined, otherwise 1)
-i: initial transform(s) --- order specified on the command line matters
-i: initial transform(s) --- order specified on the command line matters. If not specified, a
default initialization is used, based on the transform type.
For "syn only" and "b-spline syn only" transforms, the initial transform is the identity
matrix. For other transforms, it is a translation that aligns the input centers of mass.
-t: transform type (default = 's')
t: translation (1 stage)
Expand Down Expand Up @@ -510,6 +518,15 @@ if [[ $REPRO -eq 1 ]];

INITIALSTAGE="--initial-moving-transform [ ${FIXEDIMAGES[0]},${MOVINGIMAGES[0]},1 ]"

if [[ ${TRANSFORMTYPE} == 'so' ]] || [[ ${TRANSFORMTYPE} == 'bo' ]];
then
# Could just set to an empty string but this is more explicit and also keeps transform
# numbering consistent with other use cases
#
# Default to identity if we are doing "syn only" or "b-spline syn only"
INITIALSTAGE="--initial-moving-transform Identity"
fi

if [[ ${#INITIALTRANSFORMS[@]} -gt 0 ]];
then
INITIALSTAGE=""
Expand Down

0 comments on commit 47bb386

Please sign in to comment.