# How to use Transforms with python or same function in itk

**URL:** <https://discourse.slicer.org/t/how-to-use-transforms-with-python-or-same-function-in-itk/31162>\
**Category:** Support\
**Created:** [August 16, 2023, 6:09am UTC](https://discourse.slicer.org/t/how-to-use-transforms-with-python-or-same-function-in-itk/31162 "2023-08-16T06:09:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xinyue](https://avatars.discourse-cdn.com/v4/letter/x/ed655f/32.png) [@Xinyue](https://discourse.slicer.org/u/Xinyue)\
**Post date:** [August 16, 2023, 6:09am UTC](https://discourse.slicer.org/t/how-to-use-transforms-with-python-or-same-function-in-itk/31162/1 "2023-08-16T06:09:45Z")

</div>

Hi,

I am working on a image registration task, and currently, I try to split a deformation vector field into two dvfs so I could move the image two times.

dvf = dvf1+dvf2, dvf1 is a dvf which move all voxels in an image to same direction and same distance, which works like a “rigid registration”, to move the organ in the moving image to the same location as the fixed image. I used ITK resamplefilter to apply the dvfs, but it seems resamplefilter has some computational loss so the edge of the deformed image looks different as my expectation, I tried with 3dslicer GUI, and the result looks exactly what I want.

I am wondering if there is any documentation about Transforms module that I could read to learn more about Tranforms, and it would be great if there are any sample code to use Transforms model in python. After some reading, it seems like I cannot simply install Slicer as a package and import it in python, may I ask if this is still the case?

Thank you,  
Xinyue
