How to set FixedInitialTransform in itk::MultiResolutionImageRegistrationMethod

Hello,

I am using ITK to build my own multi-resolution rigid registration of 3D images. I want to pass the initial transforms of the fixed image and the moving image to the registration. How to do it? Here is my code.

#include “itkMultiResolutionImageRegistrationMethod.h”
#include “itkVersorRigid3DTransform.h”
#include “itkImage.h”

using InternalImageType = itk::Image<float, 3>;
using RegistrationType = itk::MultiResolutionImageRegistrationMethod<InternalImageType, InternalImageType>;

RegistrationType::Pointer registration = RegistrationType::New();

using TransformType = itk::VersorRigid3DTransform;
TransformType::Pointer initialTransform = TransformType::New();

//Then I update the initialTransform using my program… After that, I want to pass the updated initialTransform to the registration:

registration->SetInitialTransformParameters(initialTransform->GetParameters());

The question is I can only pass the initial transform of the moving image to the registration. How to pass the initial transform of the fixed image to the registration? In itk::ImageRegistrationMethodv4, we can simply use

registration->SetInitialTransform(initialTransform);

But how to do it using itk::MultiResolutionImageRegistrationMethod?

Thanks.
Fang

Setting fixed registration parameters might not be possible with MultiResolutionImageRegistrationMethod. But you could invert that transform and concatenate it with your initial moving transform, and set as the moving transform.

Thank you, but I don’t like the idea because I would like to keep both the initial coordinates of the Fixed image and the moving image. Any other ideas?

The registration is normally done in physical space, even with v3 registration framework.

But v4 registration framework does what you want, so look at the software guide and the example source code.

1 Like