Skip to content

Commit b38879d

Browse files
authored
Merge pull request #3463 from ghisvail/ants-reg-seed
ENH: Add random seed option to ANTs registration
2 parents f662acf + 77b3da1 commit b38879d

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

nipype/interfaces/ants/registration.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,11 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
585585
usedefault=True,
586586
desc="The Lower quantile to clip image ranges",
587587
)
588-
588+
random_seed = traits.Int(
589+
argstr="--random-seed %d",
590+
desc="Fixed seed for random number generation",
591+
min_ver="2.3.0",
592+
)
589593
verbose = traits.Bool(
590594
argstr="-v", default_value=False, usedefault=True, nohash=True
591595
)
@@ -1708,6 +1712,11 @@ class RegistrationSynQuickInputSpec(ANTSCommandInputSpec):
17081712
desc="precision type (default = double)",
17091713
usedefault=True,
17101714
)
1715+
random_seed = traits.Int(
1716+
argstr="-e %d",
1717+
desc="fixed random seed",
1718+
min_ver="2.3.0",
1719+
)
17111720

17121721

17131722
class RegistrationSynQuickOutputSpec(TraitedSpec):

nipype/interfaces/ants/tests/test_auto_Registration.py

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def test_Registration_inputs():
115115
requires=["metric_weight"],
116116
usedefault=True,
117117
),
118+
random_seed=dict(
119+
argstr="--random-seed %d",
120+
min_ver="2.3.0",
121+
),
118122
restore_state=dict(
119123
argstr="--restore-state %s",
120124
extensions=None,

nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def test_RegistrationSynQuick_inputs():
3939
argstr="-p %s",
4040
usedefault=True,
4141
),
42+
random_seed=dict(
43+
argstr="-e %d",
44+
min_ver="2.3.0",
45+
),
4246
spline_distance=dict(
4347
argstr="-s %d",
4448
usedefault=True,

0 commit comments

Comments
 (0)