# Use EuclideanDistancePointMetric in python itk

**URL:** https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490
**Category:** Uncategorized
**Tags:** wrapping
**Created:** [December 19, 2018, 6:10pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490 "2018-12-19T18:10:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Roulbac](https://discourse.itk.org/user_avatar/discourse.itk.org/roulbac/32/571_2.png) [@Roulbac](https://discourse.itk.org/u/Roulbac)
#### Post date: [December 19, 2018, 6:10pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/1 "2018-12-19T18:10:02Z")

</div>

Hi all,

I need to use the EuclideanDistancePointMetric but it does not come with PyPi’s itk.  
I tried compiling itk with Python wrapping but I can’t find the build configuration that wraps that class, which belongs to Registration.Common. I work with itk 4.13.1.  
I checked registration/common/wrapping folder and I can’t find a .wrap file for my class of interest.  
Does it work if i write its .wrap file? If so, any guidelines on how to write such a .wrap file? Maybe I can contribute it to the repo if it works properly.  
If that’s not the fix, please let me know what is.

---

<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: [December 19, 2018, 7:18pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/2 "2018-12-19T19:18:16Z")

</div>

It should work if you write `.wrap` file. The usual way is to find a similar class, and use its `.wrap` file as a starting point. Contributions are welcome!

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [January 2, 2019, 8:50pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/3 "2019-01-02T20:50:25Z")

</div>

Hi @Roulbac,

It is recommended to use the awesome new [`itk.PointSetToPointSetMetricv4`](https://itk.org/Doxygen/html/classitk_1_1PointSetToPointSetMetricv4.html) classes, which are already wrapped in Python, instead of the older v3 classes.

---

<div class="post-metadata">

### Author: ![Roulbac](https://discourse.itk.org/user_avatar/discourse.itk.org/roulbac/32/571_2.png) [@Roulbac](https://discourse.itk.org/u/Roulbac)
#### Post date: [January 3, 2019, 5:47pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/4 "2019-01-03T17:47:23Z")

</div>

I tried, but it seems that there is no PointSetToPointSetRegistrationMethodv4, not even in C++ ITK.  
My goal here is to register point clouds.

---

<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: [January 3, 2019, 6:20pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/5 "2019-01-03T18:20:48Z")

</div>

The class is called `Metric`, not `Method`. Here is a [link](https://itk.org/Doxygen/html/classitk_1_1EuclideanDistancePointSetToPointSetMetricv4.html) to a concrete implementation’s documentation.

---

<div class="post-metadata">

### Author: ![Roulbac](https://discourse.itk.org/user_avatar/discourse.itk.org/roulbac/32/571_2.png) [@Roulbac](https://discourse.itk.org/u/Roulbac)
#### Post date: [January 3, 2019, 6:29pm UTC](https://discourse.itk.org/t/use-euclideandistancepointmetric-in-python-itk/1490/6 "2019-01-03T18:29:05Z")

</div>

Thanks for the quick responsiveness.  
Initially I was going to use the metric with the PointSetToPointSetRegitrationMethod [here](https://itk.org/Doxygen/html/classitk_1_1PointSetToPointSetRegistrationMethod.html).  
Isn’t that how ITK registration works? Pick a registration method, set a metric, an optimizer and an initial transform then let it run?  
I’m confused, how am I supposed to use PointSetToPointSetMetricv4 then?
