# Vtk point set registration

**URL:** https://discourse.vtk.org/t/vtk-point-set-registration/2599
**Category:** Support
**Created:** [February 12, 2020, 11:48pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599 "2020-02-12T23:48:48Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ShaneKirkbride](https://discourse.vtk.org/user_avatar/discourse.vtk.org/shanekirkbride/32/1392_2.png) [@ShaneKirkbride](https://discourse.vtk.org/u/ShaneKirkbride)
#### Post date: [February 12, 2020, 11:48pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/1 "2020-02-12T23:48:48Z")

</div>

Does the ICP algorithm support deformable or non-rigid meshes?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 13, 2020, 12:13am UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/2 "2020-02-13T00:13:52Z")

</div>

ICP can only do rigid registration (with optional scaling).

If you have corresponding point pairs then you can do deformable landmark registration with [vtkThinPlateSplineTransform](https://vtk.org/doc/nightly/html/classvtkThinPlateSplineTransform.html).

If you have meshes with unknown point correspondences then you can compute non-linear warping from b-spline registration of distance maps computed from closed surface meshes. We tried various approaches and this worked the best for our applications. It was [tested extensively on prostate US/MRI registration](http://perk.cs.queensu.ca/contents/open-source-image-registration-mri-trus-fusion-guided-prostate-interventions), [used successfully in clinical work](http://perk.cs.queensu.ca/contents/validation-mri-us-registration-focal-hdr-prostate-brachytherapy-treatment), and worked surprisingly well for other applications, too. All the necessary computation infrastructure is available in ITK toolkit. If you want to try if it works on your data without any programming, then you can use [3D Slicer](https://www.slicer.org)’s SegmentRegistration extension.

---

<div class="post-metadata">

### Author: ![ShaneKirkbride](https://discourse.vtk.org/user_avatar/discourse.vtk.org/shanekirkbride/32/1392_2.png) [@ShaneKirkbride](https://discourse.vtk.org/u/ShaneKirkbride)
#### Post date: [February 13, 2020, 1:50am UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/3 "2020-02-13T01:50:20Z")

</div>

@lassoan Thanks for letting me know. I’ve been looking at ITK. It seems very slow but I’m not sure if I’m implementing it correctly. I have about 30K points I need to register against.

In your experience does this algorithm take a lot of time? I was hoping it would be faster than CPD which is what I’m using now. but it does not seem like it is

Thanks,  
~Shane

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 13, 2020, 2:23am UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/4 "2020-02-13T02:23:39Z")

</div>

Number of points actually does not matter, only the resolution of the grid that you use to compute the displacement field. Deformable image registration typically takes about half a minute but if performance is critical then there are many ways to reduce the time.

What is the typical execution time for CPD? Do you find it robust enough (always converges to correct solution within predictable time)?

---

<div class="post-metadata">

### Author: ![ShaneKirkbride](https://discourse.vtk.org/user_avatar/discourse.vtk.org/shanekirkbride/32/1392_2.png) [@ShaneKirkbride](https://discourse.vtk.org/u/ShaneKirkbride)
#### Post date: [February 13, 2020, 2:00pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/5 "2020-02-13T14:00:25Z")

</div>

@lassoan CPD could take several hours depending on my dataset. It doesn’t always converge… :-/ I think I’m not setting the correct resolution grid. But I also think I’m not correctly capturing my geometry of my isoSurface.

I have a bunch of questions out on the ITK forum 🙂 if you have any suggestions on how to improve my registration. I’d love to hear them.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 13, 2020, 7:23pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/6 "2020-02-13T19:23:45Z")

</div>

> [@ShaneKirkbride](#):
>
> CPD could take several hours depending on my dataset. It doesn’t always converge…

That’s what I thought. Distance-map registration works so much better.

> [@ShaneKirkbride](#):
>
> I have a bunch of questions out on the ITK forum

Can you post the link here?

---

<div class="post-metadata">

### Author: ![ShaneKirkbride](https://discourse.vtk.org/user_avatar/discourse.vtk.org/shanekirkbride/32/1392_2.png) [@ShaneKirkbride](https://discourse.vtk.org/u/ShaneKirkbride)
#### Post date: [February 13, 2020, 7:55pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/7 "2020-02-13T19:55:48Z")

</div>

Here are two links. I’d prefer to use a GPU implementation  
[https://discourse.itk.org/t/speeding-up-point-to-point-registration/2711/2](https://discourse.itk.org/t/speeding-up-point-to-point-registration/2711/2)

I’m going to try to implement a DistanceMapImageFilter of some type now.

I don’t mind bringing the Dicom images into ITK but I do think I need VTK for some of the post processing.  
[https://discourse.itk.org/t/thresholding-for-dicom-images/2704/2](https://discourse.itk.org/t/thresholding-for-dicom-images/2704/2)

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 13, 2020, 8:09pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/8 "2020-02-13T20:09:45Z")

</div>

> [@ShaneKirkbride](#):
>
> I’m going to try to implement a DistanceMapImageFilter of some type now.

Several distance map filters are already available in VTK and ITK.

> [@ShaneKirkbride](#):
>
> I don’t mind bringing the Dicom images into ITK but I do think I need VTK for some of the post processing.

Applications typically use VTK for visualization and if needed then ITK for advanced image processing, registration, and segmentation. You can connect ITK and VTK pipelines using ITKVTKGlue.

---

<div class="post-metadata">

### Author: ![Y\_So\_Salty](https://discourse.vtk.org/user_avatar/discourse.vtk.org/y_so_salty/32/1426_2.png) [@Y\_So\_Salty](https://discourse.vtk.org/u/Y_So_Salty)
#### Post date: [February 24, 2020, 10:45pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/9 "2020-02-24T22:45:42Z")

</div>

> [@lassoan](#):
>
> If you want to try if it works on your data without any programming, then you can use [3D Slicer](https://www.slicer.org)’s SegmentRegistration extension.

I tried to use this but I am getting some errors, basically all operations of `performRegistration` using `movingVolumeNode ` and others are not set.  
I am new to slicer, this is the aprroach I am following.  
Model → segmentation Node → Segmentation registration.  
Is this wrong, or am I missing out on something?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 25, 2020, 5:37am UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/10 "2020-02-25T05:37:47Z")

</div>

Could you post these Slicer-specific questions to the [Slicer forum](https://discourse.slicer.org)? Thanks!

---

<div class="post-metadata">

### Author: ![Amin](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@Amin](https://discourse.vtk.org/u/Amin)
#### Post date: [September 30, 2021, 11:32pm UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/11 "2021-09-30T23:32:31Z")

</div>

Hi, I would appreciate it if you could share an example in Python about how to use `vtkThinPlateSplineTransform` for point-to-point registration. Does _Slicer_ use this module to apply point-to-point registration? Thanks

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [October 1, 2021, 1:41am UTC](https://discourse.vtk.org/t/vtk-point-set-registration/2599/12 "2021-10-01T01:41:09Z")

</div>

Yes, 3D Slicer uses vtkThinPlateSplineTransform in its Transforms module to warp images, segmentations, models, markups, etc.

You can try non-linear warping with a convenient user interface by using the “Fiducial registration wizard” module in SlicerIGT extension. You can check out the “U-12 Landmark registration” tutorial on the [SlicerIGT training page](http://www.slicerigt.org/wp/user-tutorial/).

There are many other, more specialized warping modules that rely on this class. For example, [Baffle Planer](https://github.com/SlicerHeart/SlicerHeart/blob/master/Docs/BafflePlanner.md) module in SlicerHeart extension is used for warping a thin (or thick) membrane to match an arbitrary-shaped surface specified by a boundary curve and surface points:

[![](https://discourse.vtk.org/uploads/default/original/2X/e/e56d7eeb418cc3b795f61d9332ce262e85685a92.jpeg "Design surface patches using new Baffle Planner module") ](https://www.youtube.com/watch?v=AigTwMYRI1Y)
