# How to generate a surface mesh from segmentation

**URL:** https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751
**Category:** Development
**Tags:** segmentmesher, meshing
**Created:** [August 14, 2022, 10:35am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751 "2022-08-14T10:35:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![joanne40226](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joanne40226/32/14681_2.png) [@joanne40226](https://discourse.slicer.org/u/joanne40226)
#### Post date: [August 14, 2022, 10:35am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/1 "2022-08-14T10:35:26Z")

</div>

Hi, recently i’m building mesh from segmetation. However i only need the informations of the voxel/vertex on the surface. So, i’m wondering if there is a way to only generate surface mesh from a segmented 3D model? Thank you for your time.

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 14, 2022, 4:35pm UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/2 "2022-08-14T16:35:34Z")

</div>

You can right-click the segmentation in the Data module and choose Export visible segments to model node.

---

<div class="post-metadata">

### Author: ![joanne40226](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joanne40226/32/14681_2.png) [@joanne40226](https://discourse.slicer.org/u/joanne40226)
#### Post date: [August 15, 2022, 12:09am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/3 "2022-08-15T00:09:03Z")

</div>

@cpinter Thank you so much it worked!  
However can i change the exact vertex size of the surface mesh manually? thank you for your time!

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [August 15, 2022, 4:04am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/4 "2022-08-15T04:04:21Z")

</div>

Can you describe what you mean by “change the exact vertex size”? Distribution of vertices are not uniform, they tend to be smaller triangles (hence more dense) in regions of high curvature and larger ones in more smooth regions.

You can decimate (reduce the polygon count) the model using the surface toolbox.

---

<div class="post-metadata">

### Author: ![joanne40226](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joanne40226/32/14681_2.png) [@joanne40226](https://discourse.slicer.org/u/joanne40226)
#### Post date: [August 15, 2022, 4:48am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/5 "2022-08-15T04:48:28Z")

</div>

> [@muratmaga](#):
>
> Distribution of vertices are not uniform, they tend to be smaller triangles (hence more dense) in regions of high curvature and larger ones in more smooth regions.

@muratmaga thank you for the quick reply!  
so, can i set the polygon count manully? since i have plenty of data sets and i need them to have the same amount of polygon count, so i’m wondering if i can decide the polygon amount of a surface mesh. Thank you!

---

<div class="post-metadata">

### Author: ![joanne40226](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joanne40226/32/14681_2.png) [@joanne40226](https://discourse.slicer.org/u/joanne40226)
#### Post date: [August 15, 2022, 5:44am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/6 "2022-08-15T05:44:37Z")

</div>

@muratmaga  
hi, sorry for the unclearified problem.  
my problem is now that i had segment a skin surface as shown below

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/7/6704e551a36930497a2adcb5bc73ba4e206a1e5b.jpeg)  
now i want to generate mesh of the surface model.  
However, when i use the SegmentMesher, it did not done it well as shown below.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/d/ddf84fd93e75e14033f1f83d187a40878d74ebc2.png)

So i’m wondering if there is a way i can generate mesh on the surface with desired polygon count since the vertices meant to me. Thank you for your time!

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [August 15, 2022, 10:06pm UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/7 "2022-08-15T22:06:23Z")

</div>

> [@joanne40226](#):
>
> my problem is now that i had segment a skin surface as shown below

If you have segmentation like the one you show, all you need to do is to go to the export/import section of the Segmentation module and export it as a model. You can also do that from the data module by right clicking on the segmentation object and then click export as a model. That way you don’t need to use the SegmentMesher, which I believe creates volumetric meshes.

---

<div class="post-metadata">

### Author: ![joanne40226](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joanne40226/32/14681_2.png) [@joanne40226](https://discourse.slicer.org/u/joanne40226)
#### Post date: [August 17, 2022, 5:19am UTC](https://discourse.slicer.org/t/how-to-generate-a-surface-mesh-from-segmentation/24751/8 "2022-08-17T05:19:57Z")

</div>

Thank you for the reply! I think i misunderstood the concept of mesh, but i get it clear now! Thank you so much.
