Skip to content

Commit

Permalink
Merge pull request #1541 from ANTsX/actRandomSeed
Browse files Browse the repository at this point in the history
ANTsCT random seed
  • Loading branch information
cookpa authored May 22, 2023
2 parents 43765dc + da61ae5 commit f25d8ea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Scripts/antsBrainExtraction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ Optional arguments:
Without this option, this script calls antsAI to search for a good initial moving
transform.
-s: Image file suffix Any of the standard ITK IO formats e.g. nrrd, nii.gz, mhd (default = $OUTPUT_SUFFIX)
-u: Use random seeding Use random number generated from system clock (1) or a fixed seed (0). Using
"-u 0" overrides a system setting of ANTS_RANDOM_SEED. To produce identical results,
multi-threading must also be disabled by setting the environment variable
-u: Use random seeding Use random number generated from system clock (1) or a fixed seed (0). To produce identical
results, multi-threading must also be disabled by setting the environment variable
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1. Default = $USE_RANDOM_SEEDING.
-k: Keep temporary files Keep brain extraction/segmentation warps, etc (default = $KEEP_TMP_IMAGES).
-q: Use single floating point precision Use antsRegistration with single (1) or double (0) floating point precision (default = $USE_FLOAT_PRECISION).
Expand Down
18 changes: 14 additions & 4 deletions Scripts/antsCorticalThickness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ We use *label* to denote a label image with values in range 0 to N.
* Registration metric mask (-f)
* Thickness prior image (-r).
-m: Brain extraction probability mask Brain *probability* mask in the segmentation template space. A binary mask
-m: Brain extraction probability mask Brain *probability* mask in the segmentation template space. A binary mask
is an acceptable probability image.
-p: Brain segmentation priors Tissue *probability* priors corresponding to the image specified
Expand Down Expand Up @@ -127,7 +127,7 @@ Optional arguments:
https://github.com/ANTsX/ANTs/wiki.
-f: extraction registration mask Binary metric mask defined in the segmentation template space (-e). During the
registration for brain extraction, the similarity metric is only computed within
registration for brain extraction, the similarity metric is only computed within
this mask.
-k: keep temporary files Keep brain extraction/segmentation warps, etc (default = 0).
Expand All @@ -147,7 +147,10 @@ Optional arguments:
-j: use floating-point precision Use single float precision in registrations (default = 0).
-u: use random seeding Use random number generated from system clock in Atropos (default = 1).
-u: use random seeding Use random number generated from system clock (default = 1). If 0, a fixed
random seed is used. To set your own seed, set this option to 0 and export the
environment variable ANTS_RANDOM_SEED. To achieve exactly identical results, you must
also set ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS to 1.
-v: use b-spline smoothing Use B-spline SyN for registrations and B-spline exponential mapping in DiReCT (default = 0).
Expand All @@ -173,7 +176,7 @@ Optional arguments:
Another example would be computing cortical thickness in the presence
of white matter lesions. We can accommodate this by specifying a lesion mask
posterior as an additional posterior (suppose label '7'), combining this with
normal white matter in the thickness estimation by specifying '-c "WM[ 7 ]"'
normal white matter in the thickness estimation by specifying '-c "WM[ 7 ]"'
or '-c "3[ 7 ]"'.
-q: Use quick registration parameters If = 1, use antsRegistrationSyNQuick.sh as the basis for registration
Expand Down Expand Up @@ -540,6 +543,13 @@ if [[ $DEBUG_MODE -gt 0 ]];

fi

if [[ ${USE_RANDOM_SEEDING} -eq 0 ]]; then
# Use fixed random seed unless one is already defined
if [[ -z $ANTS_RANDOM_SEED ]] ; then
export ANTS_RANDOM_SEED=19650218
fi
fi

################################################################################
#
# Preliminaries:
Expand Down

0 comments on commit f25d8ea

Please sign in to comment.