Add a rigid transform and a deformable transform together

I am trying to do a image registration that consists of two stages.
The first stage is selected to be Versor3DRigid and the second stage is selected to be Demons.
The first stage can give a transform, the second stage can give me a deformation field that can be changed to a displacement field transform by using itkDisplacementFieldTransform. I am trying to add these two transforms together by using itkCompositeTransform. But an error message is given:
no matching function for call to ‘itk::CompositeTransform<double, 3>::AddTransform(itk::SmartPointer<itk::DisplacementFieldTransform<float, 3> >&)
Is there a way to achieve this goal of adding these two transforms together?

What happens if instead of compositeTransform->AddTransform(displacementFieldTransform); you call compositeTransform->AddTransform(displacementFieldTransform.GetPointer());?

1 Like

I bypassed this problem by change the transform to a deformation field and used itk::AddImageFilter to add the deformation fields together.