# Tractography in PLY with colors to OBJ with material (MTL) conversion

**URL:** <https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438>\
**Category:** Support\
**Created:** [December 8, 2019, 10:00pm UTC](https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438 "2019-12-08T22:00:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gonzalo\_Rojas\_Costa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gonzalo_rojas_costa/32/5259_2.png) [@Gonzalo\_Rojas\_Costa](https://discourse.slicer.org/u/Gonzalo_Rojas_Costa)\
**Post date:** [December 8, 2019, 10:00pm UTC](https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438/1 "2019-12-08T22:00:39Z")

</div>

How can I convert tractography saved in a PLY file with colors to a OBJ/MTL file ?

---

<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:** [December 9, 2019, 4:22am UTC](https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438/2 "2019-12-09T04:22:30Z")

</div>

MeshLab can bake textures from point scalars, so if you need a one-off conversion then that may be the simplest. You can find instructions on the web, see for example [here](http://www.danielgm.net/cc/forum/viewtopic.php?t=830).

If you need to do this often or this is part of a time-constrained workflow then probably you can write a script that uses VTK filters to create texture coordinates and fill the texture image with colors taken from the PLY mesh.

Why do you need the colored model as OBJ/MTL file? For 3D printing?

If you have access to a suitable multimaterial Stratasys printer, then you may try voxel printing with [SlicerFab](https://github.com/SlicerFab/SlicerFab) extension. Voxel printing is not as widely available as standard colored surface printing but it is so much nicer. See for example how fiber tracts look with this technique:

[![](https://scx1.b-cdn.net/csz/news/800/2018/makingdatama.jpg) ](https://scx1.b-cdn.net/csz/news/800/2018/makingdatama.jpg)

(source: [https://techxplore.com/news/2018-05-multimaterial-voxel-printing-method-imaging-datasets.html](https://techxplore.com/news/2018-05-multimaterial-voxel-printing-method-imaging-datasets.html))

---

<div class="post-metadata">

**Author:** ![Gonzalo\_Rojas\_Costa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gonzalo_rojas_costa/32/5259_2.png) [@Gonzalo\_Rojas\_Costa](https://discourse.slicer.org/u/Gonzalo_Rojas_Costa)\
**Post date:** [December 9, 2019, 4:40am UTC](https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438/4 "2019-12-09T04:40:18Z")

</div>

I need the tract (PLY mesh) in OBJ/MTL for a virtual reality software that we are creating…

---

<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:** [December 9, 2019, 4:50am UTC](https://discourse.slicer.org/t/tractography-in-ply-with-colors-to-obj-with-material-mtl-conversion/9438/5 "2019-12-09T04:50:12Z")

</div>

FYI, you can [show Slicer scene in virtual reality](https://github.com/KitwareMedical/SlicerVirtualReality) with a single button click, on any OpenVR compatible headset. No need to use any third-party software or exporting or converting any data. Moreover, you are not limited to viewing some static set of fiber tracts but you can do dynamic tractography seeding, see for example this multi-user demo:

Instead of redeveloping a limited variant of this feature in a different environment, it would be so much nicer to collaborate on improving the existing implementation in Slicer. Customization and optimization of tractography visualization in virtual reality would be a good project for an upcoming Project week (in Spain in January or in Boston in June), but if you cannot come to these then we are happy to help you remotely/via this forum.
