# How to set FixedInitialTransform in itk::MultiResolutionImageRegistrationMethod

**URL:** https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377
**Category:** Beginner Questions
**Tags:** registration
**Created:** [November 5, 2019, 3:40pm UTC](https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377 "2019-11-05T15:40:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fangc](https://discourse.itk.org/user_avatar/discourse.itk.org/fangc/32/1015_2.png) [@fangc](https://discourse.itk.org/u/fangc)
#### Post date: [November 5, 2019, 3:40pm UTC](https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377/1 "2019-11-05T15:40:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 5, 2019, 3:46pm UTC](https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377/2 "2019-11-05T15:46:21Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![fangc](https://discourse.itk.org/user_avatar/discourse.itk.org/fangc/32/1015_2.png) [@fangc](https://discourse.itk.org/u/fangc)
#### Post date: [November 5, 2019, 3:49pm UTC](https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377/3 "2019-11-05T15:49:09Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 5, 2019, 4:22pm UTC](https://discourse.itk.org/t/how-to-set-fixedinitialtransform-in-itk-multiresolutionimageregistrationmethod/2377/4 "2019-11-05T16:22:16Z")

</div>

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](https://itk.org/ITKSoftwareGuide/html/Book2/ITKSoftwareGuide-Book2ch3.html#x26-1110003.7) and the [example](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/RegistrationITKv4/MultiResImageRegistration1.cxx) source code.
