24 parser = argparse.ArgumentParser(description=
"Compute Mean Square Between Two Images.")
25 parser.add_argument(
"input_image_1")
26 parser.add_argument(
"input_image_2")
27 args = parser.parse_args()
29 fixed_image = itk.imread(args.input_image_1, itk.F)
30 moving_image = itk.imread(args.input_image_2, itk.F)
36 metric.SetFixedImage(fixed_image)
37 metric.SetMovingImage(moving_image)
38 metric.SetFixedImageRegion(fixed_image.GetLargestPossibleRegion())
39 metric.SetTransform(transform)
40 metric.SetInterpolator(interpolator)
46 for x
in range(-10, 15, 5):
47 params.SetElement(0, x)
48 for y
in range(-10, 15, 5):
49 params.SetElement(1, y)
50 print(f
"{list(params)}: {metric.GetValue(params):.1f}")