# \[Help wanted\] Want to registrate two images and merge them (like tutorial notebook7)

**URL:** https://discourse.itk.org/t/help-wanted-want-to-registrate-two-images-and-merge-them-like-tutorial-notebook7/5863
**Category:** Beginner Questions
**Created:** [April 11, 2023, 8:21am UTC](https://discourse.itk.org/t/help-wanted-want-to-registrate-two-images-and-merge-them-like-tutorial-notebook7/5863 "2023-04-11T08:21:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![caolonghao](https://discourse.itk.org/user_avatar/discourse.itk.org/caolonghao/32/3376_2.png) [@caolonghao](https://discourse.itk.org/u/caolonghao)
#### Post date: [April 11, 2023, 8:21am UTC](https://discourse.itk.org/t/help-wanted-want-to-registrate-two-images-and-merge-them-like-tutorial-notebook7/5863/1 "2023-04-11T08:21:15Z")

</div>

Hello, I’m new to SimpleITK. My goal is to registrate two 2D image and merge them into a bigger one. I noticed that it is similar to the function of Tutorial notebook7, the only difference is that the fixed image is not under the moving image but at the left side of it.  
I modified the code to this:

```python
minimal_overlap = np.array(
            moving_image.TransformContinuousIndexToPhysicalPoint(
                (moving_image.GetWidth() - self._min_column_overlap, -self._row_overlap)
            )
        ) - np.array(fixed_image.GetOrigin())
        maximal_overlap = np.array(
            moving_image.TransformContinuousIndexToPhysicalPoint(
                (moving_image.GetWidth() - self._max_column_overlap, self._row_overlap)
            )
        ) - np.array(fixed_image.GetOrigin())

```

and

```python
metric_sampling_percentage = 0.5
row_overlap = 0.2 * left_image.GetHeight()
min_column_overlap = 20
max_column_overlap = 0.4 * left_image.GetWidth()
dx_step_num = 15
dy_step_num = 15

```

But there are just no valid candidate.

This is the sample image.

 ![image](https://discourse.itk.org/uploads/default/original/2X/9/9fbd0cf6fb07b1af42453d67afe730361bf0e979.jpeg)

---

<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: [April 11, 2023, 12:17pm UTC](https://discourse.itk.org/t/help-wanted-want-to-registrate-two-images-and-merge-them-like-tutorial-notebook7/5863/2 "2023-04-11T12:17:18Z")

</div>

If your problem is translation-only, you should consider ITK Montage. Here is a [code example](https://github.com/InsightSoftwareConsortium/ITKMontage/blob/master/examples/SimpleMontage.py), and example of [TileConfiguration.txt](https://github.com/InsightSoftwareConsortium/ITKMontage/blob/master/examples/BlendingExplanation/TileConfiguration.txt).

---

<div class="post-metadata">

### Author: ![caolonghao](https://discourse.itk.org/user_avatar/discourse.itk.org/caolonghao/32/3376_2.png) [@caolonghao](https://discourse.itk.org/u/caolonghao)
#### Post date: [April 11, 2023, 12:27pm UTC](https://discourse.itk.org/t/help-wanted-want-to-registrate-two-images-and-merge-them-like-tutorial-notebook7/5863/3 "2023-04-11T12:27:24Z")

</div>

Thanks for your reply, it looks good. I’ll have a try next.
