# extracting a surface from a segmentation

**URL:** <https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816>\
**Category:** Algorithms\
**Created:** [March 30, 2018, 4:35pm UTC](https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816 "2018-03-30T16:35:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibr](https://discourse.itk.org/user_avatar/discourse.itk.org/ibr/32/468_2.png) [@ibr](https://discourse.itk.org/u/ibr)\
**Post date:** [March 30, 2018, 4:35pm UTC](https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816/1 "2018-03-30T16:35:28Z")

</div>

Hi,  
Is there a any itk filter to do this? I tried getting the edges but the surface was not good despite a good manual segmentation. By surface I mean the outer border of a 3D object (the contor). e.g. if I have a hand object, I am looking to extract the “skin” of this hand (the outside skin part if the skin is think). I am not talking about generating a model or closed surface here.  
I hope my question is clear.  
Regards!

---

<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:** [March 30, 2018, 7:24pm UTC](https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816/2 "2018-03-30T19:24:52Z")

</div>

[BinaryMask3DMeshSource](https://itk.org/Doxygen/html/classitk_1_1BinaryMask3DMeshSource.html) might be the class you are looking for. If not, see if there is anything else in [ITKMesh](https://itk.org/Doxygen/html/group__ITKMesh.html) group which might help you.

---

<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:** [April 2, 2018, 8:21pm UTC](https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816/3 "2018-04-02T20:21:14Z")

</div>

Also of interest is the [Cuberille](https://github.com/InsightSoftwareConsortium/ITKCuberille) filters and [BinaryThinningImageFilter](https://itk.org/Doxygen/html/classitk_1_1BinaryThinningImageFilter.html)

HTH,  
Matt

---

<div class="post-metadata">

**Author:** ![ibr](https://discourse.itk.org/user_avatar/discourse.itk.org/ibr/32/468_2.png) [@ibr](https://discourse.itk.org/u/ibr)\
**Post date:** [April 2, 2018, 8:45pm UTC](https://discourse.itk.org/t/extracting-a-surface-from-a-segmentation/816/4 "2018-04-02T20:45:22Z")

</div>

Thanks @dzenanz and @matt.mccormick  
Not what I need. I will try to provide an example of input and output processed manually.

BTW, these meshing tools are good for generating models:

> **[wjakob/instant-meshes](https://github.com/wjakob/instant-meshes)**
>
> Interactive field-aligned mesh generator. Contribute to wjakob/instant-meshes development by creating an account on GitHub.

  

> **[gaoxifeng/robust\_hex\_dominant\_meshing](https://github.com/gaoxifeng/robust_hex_dominant_meshing)**
>
> Quadrilateral-dominant and Hexahedral-dominant meshes generator - gaoxifeng/robust\_hex\_dominant\_meshing

Best!  
Ibraheem
