# Interpolate Bspline Transformation

**URL:** https://discourse.itk.org/t/interpolate-bspline-transformation/4214
**Category:** Algorithms
**Tags:** registration, python
**Created:** [June 16, 2021, 6:30pm UTC](https://discourse.itk.org/t/interpolate-bspline-transformation/4214 "2021-06-16T18:30:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mikhail](https://discourse.itk.org/user_avatar/discourse.itk.org/mikhail/32/2150_2.png) [@Mikhail](https://discourse.itk.org/u/Mikhail)
#### Post date: [June 16, 2021, 6:30pm UTC](https://discourse.itk.org/t/interpolate-bspline-transformation/4214/1 "2021-06-16T18:30:58Z")

</div>

I have images of same object at t0 and t1. I have a bspline transformation that can be used to obtain the image at t1 from the image at t0. I would like to obtain an image at t0 \< tx \< t1. Is there a way to modify the bspline transformation to do that?

It is very simple if the transformation is the same for all voxels, such as a combination of rotation and translation. But I don’t see how to do this when all voxels are transformed differently.

I appreacite your help!

---

<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 16, 2021, 6:54pm UTC](https://discourse.itk.org/t/interpolate-bspline-transformation/4214/2 "2021-06-16T18:54:46Z")

</div>

Hello @Mikhail,

Not sure if you are working in ITK or SimpleITK, so rough pseudocode which is relevant for both:

1. t\_x = 0.2 # some value in [0,1].
2. `original_displacement = sitk.TransformToDisplacementField(original_bspline_transformation)`.
3. `intermidiate_displacement_field = sitk.DisplacementFieldTransform(t_x* original_displacement.GetDisplacementField())`

This is simple and problematic. The problem is that we are assuming that all points are moving at a constant velocity between times t0 and t1 (they are moving at different speeds). Unless you are really lucky this will not be the case for your data where regions accelerate/decelerate between t0, t1.

That being said, all our computations are approximations of a continuous world, so this approach may just be good enough for your needs.

---

<div class="post-metadata">

### Author: ![Mikhail](https://discourse.itk.org/user_avatar/discourse.itk.org/mikhail/32/2150_2.png) [@Mikhail](https://discourse.itk.org/u/Mikhail)
#### Post date: [June 17, 2021, 8:43am UTC](https://discourse.itk.org/t/interpolate-bspline-transformation/4214/3 "2021-06-17T08:43:51Z")

</div>

Dear @zivy,

your solution is what I was looking for. Thanks!
