# Non-rigid mesh registration of lung contour meshes

**URL:** https://discourse.vtk.org/t/non-rigid-mesh-registration-of-lung-contour-meshes/9472
**Category:** Support
**Created:** [September 27, 2022, 4:20pm UTC](https://discourse.vtk.org/t/non-rigid-mesh-registration-of-lung-contour-meshes/9472 "2022-09-27T16:20:37Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![marcomusy](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marcomusy/32/95_2.png) [@marcomusy](https://discourse.vtk.org/u/marcomusy)
#### Post date: [September 27, 2022, 4:50pm UTC](https://discourse.vtk.org/t/non-rigid-mesh-registration-of-lung-contour-meshes/9472/2 "2022-09-27T16:50:39Z")

</div>

You can do it with `vtkThinPlateSplineTransform`, check out:

[https://discourse.vtk.org/t/very-long-time-to-deform-fe-mesh-with-thin-plate-spline-transformation/](https://discourse.vtk.org/t/very-long-time-to-deform-fe-mesh-with-thin-plate-spline-transformation/)

```python
from vedo import *
msh = Mesh('liver.stl')
source = msh.clone().subsample(0.1)
target = source.clone().scale([1.4,0.7,1.4]).shift(0.2,0.1,0.3)
arrows = Arrows(source, target, s=0.3, c='k')
warped = msh.clone().warp(source, target).alpha(0.2)
show(msh, arrows, warped, axes=7)
#print(type(warped.transform))

```

[liver.stl](https://discourse.vtk.org/uploads/short-url/kL6tjKhNrLSWhhVCwLELa1hqXcl.stl) (550.9 KB)

 ![Screenshot from 2022-09-27 18-41-19](https://discourse.vtk.org/uploads/default/original/2X/3/39286a3d7aefbe2540b913e738fa8126a9847532.png)

---

_[View the full topic](https://discourse.vtk.org/t/non-rigid-mesh-registration-of-lung-contour-meshes/9472)._
