@@ -354,6 +354,16 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
354
354
),
355
355
)
356
356
)
357
+ restrict_deformation = traits .List (
358
+ traits .List (traits .Enum (0 , 1 )),
359
+ desc = ("This option allows the user to restrict the optimization of "
360
+ "the displacement field, translation, rigid or affine transform "
361
+ "on a per-component basis. For example, if one wants to limit "
362
+ "the deformation or rotation of 3-D volume to the first two "
363
+ "dimensions, this is possible by specifying a weight vector of "
364
+ "'1x1x0' for a deformation field or '1x1x0x1x1x0' for a rigid "
365
+ "transformation. Low-dimensional restriction only works if "
366
+ "there are no preceding transformations." ))
357
367
# Convergence flags
358
368
number_of_iterations = traits .List (traits .List (traits .Int ()))
359
369
smoothing_sigmas = traits .List (traits .List (traits .Float ()), mandatory = True )
@@ -770,6 +780,9 @@ def _format_registration(self):
770
780
else :
771
781
histval = self .inputs .use_histogram_matching [ii ]
772
782
retval .append ('--use-histogram-matching %d' % histval )
783
+ if isdefined (self .inputs .restrict_deformation ):
784
+ retval .append ('--restrict-deformation %s' %
785
+ self ._format_xarray (self .inputs .restrict_deformation [ii ]))
773
786
return " " .join (retval )
774
787
775
788
def _get_outputfilenames (self , inverse = False ):
0 commit comments