# Python wrapping for 64-bit double \`itk::Mesh\` coordinates?

**URL:** https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241
**Category:** Engineering
**Created:** [August 5, 2022, 2:53pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241 "2022-08-05T14:53:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)
#### Post date: [August 5, 2022, 2:53pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241/1 "2022-08-05T14:53:42Z")

</div>

Is there a Python wrapping of `itk::Mesh` for 64-bit floating point (`double`) coordinates of its points?

In C++, an `itk::Mesh` has 32-bit `float` coordinates by default, but it can be set to 64-bit `double` by some “mesh traits”:

```
// 64-bit `double` coordinates
using MeshType = itk::Mesh<int, 2, itk::DefaultStaticMeshTraits<int, 2, 2, double>>;

```

Could something like that be made possible in Python?

```
// Possible with itk python wrappings?
mesh = itk.Mesh[itk.D, 2, itk.DefaultStaticMeshTraits[itk.D, 2, 2, itk.D]].New()

```

---

<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: [August 5, 2022, 3:20pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241/2 "2022-08-05T15:20:32Z")

</div>

@Pranjal_Sahu or @Tom_Birdsong might know. But I doubt this is possible with default Python builds (e.g. PyPI wheels).

---

<div class="post-metadata">

### Author: ![Tom\_Birdsong](https://discourse.itk.org/user_avatar/discourse.itk.org/tom_birdsong/32/1894_2.png) [@Tom\_Birdsong](https://discourse.itk.org/u/Tom_Birdsong)
#### Post date: [August 5, 2022, 3:29pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241/3 "2022-08-05T15:29:20Z")

</div>

Hi @Niels_Dekker, yes, from what I can tell your proposed implementation is the best way to accomplish this. I do not believe there is are mesh wrappings with `double` coordinates in the ITK Python wheels at the moment.

---

<div class="post-metadata">

### Author: ![Pranjal\_Sahu](https://discourse.itk.org/user_avatar/discourse.itk.org/pranjal_sahu/32/2698_2.png) [@Pranjal\_Sahu](https://discourse.itk.org/u/Pranjal_Sahu)
#### Post date: [August 5, 2022, 4:38pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241/4 "2022-08-05T16:38:17Z")

</div>

It can be done. But it’s not present.

> <https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Mesh/wrapping/itkMeshBase.wrap#L11>

Probably to keep limited number of options.

---

<div class="post-metadata">

### Author: ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)
#### Post date: [August 5, 2022, 9:12pm UTC](https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241/5 "2022-08-05T21:12:21Z")

</div>

@dzenanz @Tom_Birdsong @Pranjal_Sahu Thanks for your useful replies so far.

FYI I would find 64-bit floating point support for a Python `itk.Mesh` interesting, especially because in Python, the built-in floating point type also corresponds with 64-bit `double`: [sys — System-specific parameters and functions — Python 3.10.6 documentation](https://docs.python.org/3/library/sys.html#sys.float_info) So supporting double as mesh coordinate type would allow Python users to pass their floating point data to an `itk.Mesh` in a lossless way.
