20 """ A SimpleITK example demonstrating landmark registration. """
23 import SimpleITK
as sitk
26 fixed_image =
sitk.Image(100, 100, sitk.sitkUInt8)
27 fixed_image[11:20, 11:20] = 200
30 moving_image =
sitk.Image(100, 100, sitk.sitkUInt8)
31 moving_image[51:60, 51:60] = 69
36 fixed_landmarks = [10, 10, 20, 10, 20, 20]
37 moving_landmarks = [50, 50, 60, 50, 60, 60]
42 landmark_initializer.SetFixedLandmarks(fixed_landmarks)
43 landmark_initializer.SetMovingLandmarks(moving_landmarks)
48 output_transform = landmark_initializer.Execute(transform)
50 print(output_transform)
55 moving_image, fixed_image, transform=output_transform, defaultPixelValue=150
64 out_name = sys.argv[1]
66 out_name =
"landmark_transform.tfm"