Skip to content

Commit cd4abbc

Browse files
committed
BUG: antsRegistration command line failure
The antsRegistration program does not have a named sampling strategy called "Dense". In order to get the 1 sample per voxel sampling strategy (aka dense sampling) the user must either not supply anything, or explicitly supply the "None" name. Perhaps this should have been called the "subSamplingStrategy", but that is too invasive of a change to ants.
1 parent b60262b commit cd4abbc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/interfaces/ants/registration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
233233
requires=['metric_weight'],
234234
desc='the number of bins in each stage for the MI and Mattes metric, '
235235
'the radius for other metrics')
236-
sampling_strategy_item_trait = traits.Enum("Dense", "Regular", "Random", None)
236+
sampling_strategy_item_trait = traits.Enum("None", "Regular", "Random", None)
237237
sampling_strategy_stage_trait = traits.Either(
238238
sampling_strategy_item_trait, traits.List(sampling_strategy_item_trait))
239239
sampling_strategy = traits.List(
@@ -390,9 +390,9 @@ class Registration(ANTSCommand):
390390
>>> reg5.inputs.sampling_strategy = ['Random', None] # use default strategy in second stage
391391
>>> reg5.inputs.sampling_percentage = [0.05, [0.05, 0.10]]
392392
>>> reg5.cmdline
393-
'antsRegistration --collapse-linear-transforms-to-fixed-image-header 0 --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric CC[ fixed1.nii, moving1.nii, 1, 4, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 32, Dense, 0.05 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, Dense, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1'
393+
'antsRegistration --collapse-linear-transforms-to-fixed-image-header 0 --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric CC[ fixed1.nii, moving1.nii, 1, 4, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1'
394394
"""
395-
DEF_SAMPLING_STRATEGY = 'Dense'
395+
DEF_SAMPLING_STRATEGY = 'None'
396396
"""The default sampling stratey argument."""
397397

398398
_cmd = 'antsRegistration'

0 commit comments

Comments
 (0)