I am developing an application to register and display a 3D DICOM image using VTK, ITK, and QT.
I am running into some issues with the registration part.
I am using the ScaleVersor3DTransform, VersorTransformOptimizer, NormalizedCorrelationImageToImageMetric, and LinearInterpolateImageFunction for this.
The problem is that I need to lock or disable the rotation on Z axis. The only axis that can rotate are X and Y.
I tried getting the GetNumberOfParameters() from the transform and setting all its values to 1.0 (although I think the Z-rotation is the third position on the array), but that didn't seen to work.
What are my options?
You can minimize (or disable) a certain parameter by setting a very high scale for the parameter you do not want to optimize (using SetScales on the optimizer). In the case of a ScaleVersor3DTransform, no single parameter is representing the Z-rotation, so I am afraid it won't work out for your specific case.
You could consider to use a Euler3DTransform instead, for which the Z-rotation is a specific parameter of the transformation.