# Save segmentation as PLY file

**URL:** <https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [October 8, 2021, 3:38am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063 "2021-10-08T03:38:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [October 8, 2021, 3:38am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063/1 "2021-10-08T03:38:50Z")

</div>

Hi Andras,  
I am saving PLY file but it is still saving STL file.

Regards,  
Saima Safdar

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 8, 2021, 3:41am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063/2 "2021-10-08T03:41:03Z")

</div>

Please provide more details.

---

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [October 8, 2021, 3:43am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063/3 "2021-10-08T03:43:31Z")

</div>

I am saving the segments using

```
slicer.modules.segmentations.logic().ExportSegmentsClosedSurfaceRepresentationToFiles("/home/saima/2021_5_28/slicer work/modelFiles/", segmentationNode, None,"PLY", True, 1.0, False )

```

The function saves as stl not ply

Regards,  
saima Safdar

---

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [October 8, 2021, 3:50am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063/4 "2021-10-08T03:50:01Z")

</div>

I am saving the segments using

```auto
slicer.modules.segmentations.logic().ExportSegmentsClosedSurfaceRepresentationToFiles("/home/saima/2021_5_28/slicer work/modelFiles/", segmentationNode, None,"PLY", True, 1.0, False )

```

The function saves as stl not ply

Regards,  
saima Safdar

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 8, 2021, 3:51am UTC](https://discourse.slicer.org/t/save-segmentation-as-ply-file/20063/5 "2021-10-08T03:51:58Z")

</div>

This method supports STL and OBJ - see [documentation](http://apidocs.slicer.org/master/classvtkSlicerSegmentationsModuleLogic.html#a4b5328985b2d98cbbc93a5b2ae7fde6b). You can export to PNG by exporting the segmentation to model nodes and then save the model nodes to files.
