# applying the matrix of deformable registration to another file

**URL:** https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578
**Category:** Uncategorized
**Created:** [June 25, 2025, 2:53pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578 "2025-06-25T14:53:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![blue\_sky](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blue\_sky](https://discourse.itk.org/u/blue_sky)
#### Post date: [June 25, 2025, 2:53pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578/1 "2025-06-25T14:53:09Z")

</div>

Hi everyone  
I have two DICOM CT images (CT1, CT2) (Matrix size: 512,512,111) that I want to register them with B spline deformable registration. I have also exported a RT dose file (RT2) (Matrix size:100,61,1) from the treatment planning system. I want to apply the transformation matrix of this registration to the RT dose file. But I don’t know how can I do it.  
1- Can you help me how to do this?  
2- Do I need to change the size of the RT dose file in general?

Tanks a lot

---

<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 25, 2025, 3:52pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578/2 "2025-06-25T15:52:52Z")

</div>

Hello @blue_sky,

If you don’t need to solve this via standalone code you implement, you should look into using [3D Slicer](https://www.slicer.org/). Specifically, take a look at the [registration documentation](https://slicer.readthedocs.io/en/latest/user_guide/registration.html) and [SlicerRT extension](https://slicerrt.github.io/).

---

<div class="post-metadata">

### Author: ![blue\_sky](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blue\_sky](https://discourse.itk.org/u/blue_sky)
#### Post date: [June 25, 2025, 4:19pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578/3 "2025-06-25T16:19:37Z")

</div>

> [@zivy](#):
>
> If you don’t need to solve this via standalone code you implement, you should look into using [3D Slicer](https://www.slicer.org/). Specifically, take a look at the [registration documentation](https://slicer.readthedocs.io/en/latest/user_guide/registration.html) and [SlicerRT extension](https://slicerrt.github.io/).

Thanks for your explanation. But besides using the 3D slicer, I also need to use its Python code. But I have no idea how to do it. Can you guide me how to write its code?

thanka a lot

---

<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 25, 2025, 4:58pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578/4 "2025-06-25T16:58:07Z")

</div>

Hello @blue_sky,

The relevant forum for this type of request is the [Slicer discourse](https://discourse.slicer.org/), see [this relevant discussion](https://discourse.slicer.org/t/directly-interacting-with-python-console/34455).

Generally, before asking for help, it is recommended to skim the documentation/FAQ. In this case, Slicer’s [Python FAQ](https://slicer.readthedocs.io/en/latest/developer_guide/python_faq.html#).

---

<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 25, 2025, 6:37pm UTC](https://discourse.itk.org/t/applying-the-matrix-of-deformable-registration-to-another-file/7578/5 "2025-06-25T18:37:01Z")

</div>

You could possibly write a [scripted module](https://slicer.readthedocs.io/en/latest/developer_guide/module_overview.html#scripted-modules) for Slicer, in Python. You could look at some existing [modules in Slicer](https://github.com/Slicer/Slicer/tree/main/Modules/Scripted). There are also many Slicer extensions which have scripted modules, e.g. [SlicerITKUltrasound](https://github.com/KitwareMedical/SlicerITKUltrasound/tree/pythonization).
