Skip to content

Commit 9faf08c

Browse files
committed
fix: updated ants example to use new parameters from ants
1 parent 93f3fd4 commit 9faf08c

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

examples/smri_ants_registration.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,29 @@
5959
reg.inputs.output_transform_prefix = 'thisTransform'
6060
reg.inputs.output_warped_image = 'INTERNAL_WARPED.nii.gz'
6161

62+
reg.inputs.output_transform_prefix = "output_"
6263
reg.inputs.transforms = ['Translation', 'Rigid', 'Affine', 'SyN']
63-
reg.inputs.transform_parameters = [(0.1,), (0.1,), (0.1,), (0.3, 3.0, 0.0)]
64-
reg.inputs.number_of_iterations = [[10000, 0, 0], [10000, 0, 0], [10000, 0, 0], [10, 0, 0]]
64+
reg.inputs.transform_parameters = [(0.1,), (0.1,), (0.1,), (0.2, 3.0, 0.0)]
65+
reg.inputs.number_of_iterations = ([[10000, 111110, 11110]]*3 +
66+
[[100, 50, 30]])
6567
reg.inputs.dimension = 3
6668
reg.inputs.write_composite_transform = True
67-
reg.inputs.collapse_output_transforms = True
68-
reg.inputs.metric = ['Mattes']*4
69-
reg.inputs.metric_weight = [1]*4 # Default (value ignored currently by ANTs)
70-
reg.inputs.radius_or_number_of_bins = [32]*4
71-
reg.inputs.sampling_strategy = ['Regular']*3 + [None]
72-
reg.inputs.sampling_percentage = [0.1]*3 + [None]
73-
reg.inputs.convergence_threshold = [1.e-8]*4
74-
reg.inputs.convergence_window_size = [20]*4
75-
reg.inputs.smoothing_sigmas = [[4,2,1]]*3 + [[2,1,0]]
76-
reg.inputs.sigma_units = ['vox']*4
77-
reg.inputs.shrink_factors = [[6,4,2]]*3 + [[4,2,1]]
78-
reg.inputs.use_estimate_learning_rate_once = [True, True, True, True]
79-
reg.inputs.use_histogram_matching = [False]*3 + [True] # This is the default
69+
reg.inputs.collapse_output_transforms = False
70+
reg.inputs.metric = ['Mattes'] * 3 + [['Mattes', 'CC']]
71+
reg.inputs.metric_weight = [1] * 3 + [[0.5, 0.5]]
72+
reg.inputs.radius_or_number_of_bins = [32] * 3 + [[32, 4]]
73+
reg.inputs.sampling_strategy = ['Regular'] * 3 + [[None, None]]
74+
reg.inputs.sampling_percentage = [0.3] * 3 + [[None, None]]
75+
reg.inputs.convergence_threshold = [1.e-8] * 3 + [-0.01]
76+
reg.inputs.convergence_window_size = [20] * 3 + [5]
77+
reg.inputs.smoothing_sigmas = [[4, 2, 1]] * 3 + [[1, 0.5, 0]]
78+
reg.inputs.sigma_units = ['vox'] * 4
79+
reg.inputs.shrink_factors = [[6, 4, 2]] + [[3, 2, 1]]*2 + [[4, 2, 1]]
80+
reg.inputs.use_estimate_learning_rate_once = [True] * 4
81+
reg.inputs.use_histogram_matching = [False] * 3 + [True]
8082
reg.inputs.initial_moving_transform_com = True
81-
reg.inputs.output_warped_image = True
82-
reg.cmdline
83+
84+
print reg.cmdline
8385

8486

8587
"""

0 commit comments

Comments
 (0)