# Export volume to PLY point cloud?

**URL:** <https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801>\
**Category:** Support\
**Created:** [November 19, 2018, 1:07pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801 "2018-11-19T13:07:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan.st](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stephan.st/32/10915_2.png) [@Stephan.st](https://discourse.slicer.org/u/Stephan.st)\
**Post date:** [November 19, 2018, 1:07pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/1 "2018-11-19T13:07:50Z")

</div>

Hello everyone!

This is my first post here on the forum. I am looking for a way to export data from Slicer as a 3D point cloud, preferable in PLY format. Is there a plugin / extension that can be used for this? Otherwise I will look into coding my own…  
Kind regards,  
Stephan

---

<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:** [November 19, 2018, 1:16pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/2 "2018-11-19T13:16:51Z")

</div>

Would you like to export each voxel as a point? Whatvwould be the use case? Point cloud rendering would be probably lower quality and require more computation than volume (rectilinear grid) rendering.

If you are looking for rendering of particular structures then you need to segment the volume, for example using Segment Editor module.

What is your end goal? Rendering, processing, analysis, printing,…?

---

<div class="post-metadata">

**Author:** ![Stephan.st](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stephan.st/32/10915_2.png) [@Stephan.st](https://discourse.slicer.org/u/Stephan.st)\
**Post date:** [November 19, 2018, 2:20pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/3 "2018-11-19T14:20:13Z")

</div>

Hi Andras,

I work on DNN-based point cloud analysis tools, and would be curious to see what can be done with this type of data as input simple_smile I could develop a tool to take still image slices and project them as point clouds myself but I would need to figure out how to get the scale correct and interpret MRI scan data from scratch, so I was wondering whether this would be possible directly using Slicer.

cheers,

Stephan

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [February 25, 2021, 2:37pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/4 "2021-02-25T14:37:21Z")

</div>

> [@lassoan](#):
>
> 例是什么？点云渲染的质量可能较低，并且比体积（直线网格）渲染需要更多的计算。

Did you deal with it ?

---

<div class="post-metadata">

**Author:** ![mluerig](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mluerig/32/10682_2.png) [@mluerig](https://discourse.slicer.org/u/mluerig)\
**Post date:** [May 11, 2021, 8:23am UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/5 "2021-05-11T08:23:28Z")

</div>

I am also looking for a way to convert a volume model to a point cloud (XYZ coords), both for visualization purposes and to use for classification in a neural network ([GitHub - charlesq34/pointnet2: PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space](https://github.com/charlesq34/pointnet2))

---

<div class="post-metadata">

**Author:** ![Stephan.st](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stephan.st/32/10915_2.png) [@Stephan.st](https://discourse.slicer.org/u/Stephan.st)\
**Post date:** [May 11, 2021, 9:40am UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/6 "2021-05-11T09:40:38Z")

</div>

I think in the end I just used open3d and numpy and made point clouds by stacking pixels exported as points (like having one flat point cloud with no camera projection every Xmm (slice size)).

---

<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:** [May 11, 2021, 7:58pm UTC](https://discourse.slicer.org/t/export-volume-to-ply-point-cloud/4801/7 "2021-05-11T19:58:07Z")

</div>

Every model is a point cloud as well. You can just ignore the connectivity information between the points. You can also [get the point list as a numpy array](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.arrayFromModelPoints) and save it in any format you want.

However, if you drop the connectivity information then you lose lots of information and you can never reconstruct the original surface just from point positions. The more densely and uniformly the mesh points are distributed, the more information can be reconstructed later. So, before dropping connectivity information, you may want to remesh the model (subdivide, decimate, etc. or resample on a grid or use more sophisticated algorithms, such as ACVD).

Labelmaps seem to be much more natural, efficient, and predictable, and lossless representation of volumes, though. So I’m not sure if it is worth all the trouble of converting to a point cloud representation.
