Is it possible to register two images off of a point (not the center of the image) without translation? As in I have two images that are fixed at one point but I need to align the moving image using 3d rotation only.
I have tried this with AffineTranform, Euler3DTransform, and VersorRigid3DTransform:
image_center = post_resam.TransformIndexToPhysicalPoint((75, 250, 350))
new_transform = sitk.AffineTransform(3)
new_transform.SetCenter(image_center)
new_transform.SetTranslation((0, 0, 0))
parameters = {ânumberOfHistogramBinsâ: 50,
âSamplingPercentageâ: 0.01,
âlearningRateâ: 1,
ânumberOfIterationsâ: 150,
âconvergenceMinimumValueâ: 1e-7,
âconvergenceWindowSizeâ: 10,
âshrinkFactorsâ: [4, 2, 1],
âsmoothingSigmasâ: [2, 1, 0]}
registration_method = sitk.ImageRegistrationMethod()
registration_method.SetMetricAsMattesMutualInformation(numberOfHistogramBins=parameters[ânumberOfHistogramBinsâ])
registration_method.SetMetricSamplingStrategy(registration_method.RANDOM)
registration_method.SetMetricSamplingPercentage(parameters[âSamplingPercentageâ])
registration_method.SetInterpolator(sitk.sitkLinear)
registration_method.SetOptimizerAsGradientDescent(
learningRate=parameters[âlearningRateâ],
numberOfIterations=parameters[ânumberOfIterationsâ],
convergenceMinimumValue=parameters[âconvergenceMinimumValueâ],
convergenceWindowSize=parameters[âconvergenceWindowSizeâ])
registration_method.SetOptimizerScalesFromPhysicalShift()
registration_method.SetShrinkFactorsPerLevel(parameters[âshrinkFactorsâ])
registration_method.SetSmoothingSigmasPerLevel(parameters[âsmoothingSigmasâ])
registration_method.SmoothingSigmasAreSpecifiedInPhysicalUnitsOn()
registration_method.SetInitialTransform(new_transform, inPlace=False)
final_transform = registration_method.Execute(pre_left_sitk, post_left_sitk)
Thanks