Skip to content

Commit 94fa860

Browse files
committed
Reverted the traits "fix" workaround.
1 parent f7df203 commit 94fa860

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

nipype/interfaces/ants/registration.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,13 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
183183
desc="Note that the metricWeight is currently not used. \
184184
Rather, it is a temporary place holder until multivariate \
185185
metrics are available for a single stage.")
186-
## This is interpreted as number_of_bins for MI and Mattes, and as radius for all other metrics
186+
### This is interpreted as number_of_bins for MI and Mattes, and as radius for all other metrics
187187
radius_or_number_of_bins = traits.List(traits.Int(5), usedefault=True,
188188
requires=['metric_weight'], desc='')
189189
sampling_strategy = traits.List(trait=traits.Enum("Dense","Regular", "Random", None), value=['Dense'], minlen=1, usedefault=True,
190190
requires=['metric_weight'], desc='')
191-
sampling_percentage = traits.List(value=[None],minlen=1,
191+
sampling_percentage = traits.List(trait=traits.Either(traits.Range(low=0.0, high=1.0),None),value=[None],minlen=1,
192192
requires=['sampling_strategy'], desc='')
193-
194193
use_estimate_learning_rate_once = traits.List(traits.Bool(), desc='')
195194
use_histogram_matching = traits.List(traits.Bool(argstr='%s'), default=True, usedefault=True)
196195
# Interpolation flag
@@ -212,7 +211,13 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
212211
'TimeVaryingBSplineVelocityField', 'SyN', 'BSplineSyN',
213212
'Exponential', 'BSplineExponential'), argstr='%s', mandatory=True)
214213
# TODO: transform_parameters currently supports rigid, affine, composite affine, translation, bspline, gaussian displacement field (gdf), and SyN -----ONLY-----!
215-
transform_parameters = traits.List()
214+
transform_parameters = traits.List(
215+
traits.Either(
216+
traits.Float(),
217+
traits.Tuple(traits.Float()),
218+
traits.Tuple(traits.Float(), # gdf & syn
219+
traits.Float(),
220+
traits.Float())))
216221
# Convergence flags
217222
number_of_iterations = traits.List(traits.List(traits.Int()))
218223
smoothing_sigmas = traits.List(traits.List(traits.Int()))
@@ -221,8 +226,8 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
221226
convergence_window_size = traits.List(trait=traits.Int(), value=[10],minlen=1, requires=['convergence_threshold'], usedefault=True)
222227
# Output flags
223228
output_transform_prefix = traits.Str("transform", usedefault=True, argstr="%s", desc="")
224-
output_warped_image = traits.Any(hash_files=False, desc="")
225-
output_inverse_warped_image = traits.Any(hash_files=False, requires=['output_warped_image'], desc="")
229+
output_warped_image = traits.Either(traits.Bool, File(), hash_files=False, desc="")
230+
output_inverse_warped_image = traits.Either(traits.Bool, File(), hash_files=False, requires=['output_warped_image'], desc="")
226231

227232
class RegistrationOutputSpec(TraitedSpec):
228233
forward_transforms = traits.List(File(exists=True), desc='List of output transforms for forward registration')

0 commit comments

Comments
 (0)