By the manual I do not understand the difference between InPlace True and False. Could you please explain? What it is adequate.
##Don’t optimize in-place, we would possibly like to run this cell multiple times.
registration_method.SetInitialTransform(initial_transform, inPlace=False)
And please confirm. The resulting transform of a registration must be applied to the moving image, first the rotation and the then translation.
inPlace=True means that initial_transform is modified by the registration, if it is False then the transform isn’t modified. Please see the documentation for details.
The resulting transform maps points from the fixed image to the moving image. Please read the Registration Overview and the Fundamental Concepts pages to gain better understanding of how transforms are applied.
I saw in the link you presented the following text:
Features of Interest
Transforms and image spaces
While the goal of registration, as defined above, refers to a single transformation and two images, the ITKv4 registration and the SimpleITK ImageRegistrationMethod provide additional flexibility in registration configuration.
From a coordinate system standpoint ITKv4 introduced the virtual image domain , making registration a symmetric process so that both images are treated similarly. As a consequence the ImageRegistrationMethod has methods for setting three transformations :
SetInitialTransform ToTo - composed with the moving initial transform, maps points from the virtual image domain to the moving image domain, modified during optimization.
SetFixedInitialTransform TfTf - maps points from the virtual image domain to the fixed image domain, never modified.
SetMovingInitialTransform TmTm- maps points from the virtual image domain to the moving image domain, never modified.
The transformation that maps points from the fixed to moving image domains is thus:
I was doing the rotation Z->Y->X instead of X->Y->Z. But there space for better results. All cases improved a lot but not yet perfect.
Some cases are good enough but others are not the best fit despite a close fit. I do not know yet if a mine problem or a convergence problem because of the images or algorithm.
In the above formula the transform is inverse. Seems that to convert the fixed image in the moving image it is needed the inverse transform. And seems the transform is from the moving to the fixed.