@@ -673,6 +673,21 @@ class Registration(ANTSCommand):
673
673
--convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \
674
674
--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ fixed1.nii, NULL ] \
675
675
--winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1'
676
+
677
+ >>> # Test initialization with multiple transforms matrices (e.g., unwarp and affine transform)
678
+ >>> reg10 = copy.deepcopy(reg)
679
+ >>> reg10.inputs.initial_moving_transform = ['func_to_struct.mat', 'ants_Warp.nii.gz']
680
+ >>> reg10.inputs.invert_initial_moving_transform = [False, False]
681
+ >>> reg10.cmdline # doctest: +ALLOW_UNICODE
682
+ 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform \
683
+ [ func_to_struct.mat, 0 ] [ ants_Warp.nii.gz, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear \
684
+ --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] \
685
+ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] \
686
+ --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \
687
+ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \
688
+ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \
689
+ --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \
690
+ --write-composite-transform 1'
676
691
"""
677
692
DEF_SAMPLING_STRATEGY = 'None'
678
693
"""The default sampling strategy argument."""
@@ -878,7 +893,7 @@ def _get_initial_transform_filenames(self):
878
893
raise Exception (("ERROR: The useInverse list must have the same number "
879
894
"of entries as the transformsFileName list." ))
880
895
else :
881
- retval .append ("[ %s, 0 ] " % self .inputs .initial_moving_transform [ii ])
896
+ retval .append ("[ %s, 0 ]" % self .inputs .initial_moving_transform [ii ])
882
897
return " " .join (retval )
883
898
884
899
def _format_arg (self , opt , spec , val ):
0 commit comments