@@ -418,6 +418,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
418418 "BSpline" ,
419419 "MultiLabel" ,
420420 "Gaussian" ,
421+ "GenericLabel" ,
421422 argstr = "%s" ,
422423 usedefault = True ,
423424 )
@@ -426,6 +427,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
426427 traits .Tuple (
427428 traits .Float (), traits .Float () # Gaussian/MultiLabel (sigma, alpha)
428429 ),
430+ traits .Tuple (traits .Str ()), # GenericLabel (interpolator)
429431 )
430432
431433 write_composite_transform = traits .Bool (
@@ -1291,15 +1293,12 @@ def _format_arg(self, opt, spec, val):
12911293 do_center_of_mass_init ,
12921294 )
12931295 elif opt == "interpolation" :
1294- if (
1295- self .inputs .interpolation
1296- in [
1297- "BSpline" ,
1298- "MultiLabel" ,
1299- "Gaussian" ,
1300- ]
1301- and isdefined (self .inputs .interpolation_parameters )
1302- ):
1296+ if self .inputs .interpolation in [
1297+ "BSpline" ,
1298+ "MultiLabel" ,
1299+ "Gaussian" ,
1300+ "GenericLabel" ,
1301+ ] and isdefined (self .inputs .interpolation_parameters ):
13031302 return "--interpolation %s[ %s ]" % (
13041303 self .inputs .interpolation ,
13051304 ", " .join (
@@ -1592,14 +1591,17 @@ class MeasureImageSimilarity(ANTSCommand):
15921591 output_spec = MeasureImageSimilarityOutputSpec
15931592
15941593 def _metric_constructor (self ):
1595- retval = '--metric {metric}["{fixed_image}","{moving_image}",{metric_weight},' "{radius_or_number_of_bins},{sampling_strategy},{sampling_percentage}]" .format (
1596- metric = self .inputs .metric ,
1597- fixed_image = self .inputs .fixed_image ,
1598- moving_image = self .inputs .moving_image ,
1599- metric_weight = self .inputs .metric_weight ,
1600- radius_or_number_of_bins = self .inputs .radius_or_number_of_bins ,
1601- sampling_strategy = self .inputs .sampling_strategy ,
1602- sampling_percentage = self .inputs .sampling_percentage ,
1594+ retval = (
1595+ '--metric {metric}["{fixed_image}","{moving_image}",{metric_weight},'
1596+ "{radius_or_number_of_bins},{sampling_strategy},{sampling_percentage}]" .format (
1597+ metric = self .inputs .metric ,
1598+ fixed_image = self .inputs .fixed_image ,
1599+ moving_image = self .inputs .moving_image ,
1600+ metric_weight = self .inputs .metric_weight ,
1601+ radius_or_number_of_bins = self .inputs .radius_or_number_of_bins ,
1602+ sampling_strategy = self .inputs .sampling_strategy ,
1603+ sampling_percentage = self .inputs .sampling_percentage ,
1604+ )
16031605 )
16041606 return retval
16051607
0 commit comments