# Multistage Registration using itkRegistrationMethodV4

**URL:** <https://discourse.itk.org/t/multistage-registration-using-itkregistrationmethodv4/3608>\
**Category:** Algorithms\
**Tags:** registration\
**Created:** [November 11, 2020, 7:07pm UTC](https://discourse.itk.org/t/multistage-registration-using-itkregistrationmethodv4/3608 "2020-11-11T19:07:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![machadoL](https://discourse.itk.org/user_avatar/discourse.itk.org/machadol/32/662_2.png) [@machadoL](https://discourse.itk.org/u/machadoL)\
**Post date:** [November 11, 2020, 7:07pm UTC](https://discourse.itk.org/t/multistage-registration-using-itkregistrationmethodv4/3608/1 "2020-11-11T19:07:50Z")

</div>

Hello, everyone.

I am using **itkRegistrationMethodV4** to perform a **multistage registration** : 1st stage is a `3D rigid transform`, and the 2nd stage is a `BsplineTransform`.

The problem I am stucking happens when I try to connect the 1st stage obtained transform into the next stage, the `Bspline` one:  
One way is using `compositeTransform:`  
compositeTransform-\>AddTransform(deformableInitialTransform);  
compositeTransform-\>SetOnlyMostRecentTransformToOptimizeOn();  
and  
`registrationV4Object->SetInitialTransform(compositeTransform);`

Although, this looks ok it did not work. For the second stage, It outputs `(iteration, metricValue)` as follows:

> ```
> 1152921504606846977 7.09521e-317   
> 1152921504606846977 7.09521e-317   
> 1152921504606846977 7.09521e-317
> 1152921504606846977 7.09521e-317   
> 1152921504606846977 7.09521e-317
> 
> ```

Which sound non-sense.

The `ItkExamples` I found ( **deformableRegistration15.cpp** ) uses `ItkRegistrationMethod` not `ItkRegistrationMethodV4`. That changes how to set the transforms into `registrationV4Object`.

Any clues are appreciated.
