# Image Registration of volumetric CT scans with different patients

**URL:** https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073
**Category:** Beginner Questions
**Tags:** registration, python, dicom, simpleitk
**Created:** [June 8, 2022, 6:11pm UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073 "2022-06-08T18:11:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![DushiFdo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/c68b51/32.png) [@DushiFdo](https://discourse.itk.org/u/DushiFdo)
#### Post date: [June 8, 2022, 6:11pm UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073/1 "2022-06-08T18:11:52Z")

</div>

Hello,

I know that image registration can be done when we have two images (MR/CT or image/segmentation) on the same patient.

1. Could someone please tell me if it is possible to perform image registration on different datasets/patients?
2. If yes, could you please direct me to a code example?

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [June 9, 2022, 12:31am UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073/2 "2022-06-09T00:31:05Z")

</div>

Hello @DushiFdo,

Yes it is possible, it just requires a transformation with more degrees of freedom, i.e. using affine instead of rigid or if there are local deformation using BSpline.

The [SimpleITK Jupyter notebooks repository](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks) contains notebooks illustrating registration with various transformation types.

As a side note, before embarking on an implementation you really do need to have a solid understanding of how registration works. Possibly skim through the [ITK book](https://itk.org/ItkSoftwareGuide.pdf).

---

<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: [June 9, 2022, 4:38am UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073/3 "2022-06-09T04:38:53Z")

</div>

You can also play with registration using [Slicer](https://www.slicer.org/). It has BRAINS, elastix, and ANTs registration modules.

---

<div class="post-metadata">

### Author: ![DushiFdo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/c68b51/32.png) [@DushiFdo](https://discourse.itk.org/u/DushiFdo)
#### Post date: [June 9, 2022, 5:33pm UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073/4 "2022-06-09T17:33:30Z")

</div>

Thank you @zivy and @dzenanz . In this case, how should I choose the fixed image and the moving image?

Should I select randomly a scan from one patient as the `fixed_image` and the scans from other patients (same/different dataset) as the `moving_image`? So that I have one randomly selected scan from a patient as the reference image and do co-registration with all the other patients (regardless of the dataset they belong to)?

---

<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: [June 10, 2022, 7:13am UTC](https://discourse.itk.org/t/image-registration-of-volumetric-ct-scans-with-different-patients/5073/5 "2022-06-10T07:13:24Z")

</div>

That is one approach. Another is called groupwise registration, see [MABMIS](https://www.slicer.org/wiki/Documentation/4.8/Extensions/MABMIS) as an example.
