# PLY file colors not displayed

**URL:** <https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206>\
**Category:** Development\
**Tags:** extensions-manager\
**Created:** [September 27, 2018, 10:24am UTC](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206 "2018-09-27T10:24:17Z")\
**Posts on this page:** 4\
**Page:** 2

<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 28, 2024, 5:56pm UTC](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206/21 "2024-08-28T17:56:47Z")

</div>

Are you sure this is not a data problem? Does meshlab display the obj with texture?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 28, 2024, 6:50pm UTC](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206/22 "2024-08-28T18:50:51Z")

</div>

The colors show up for the obj file on the mac’s built in viewer but it’s true they don’t show up in Slicer.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/1/910fd4fd77cb0b2b71ba1313dced3ce4de527ee5.jpeg)

From looking at the file it appears the obj file has lines like:

```auto
v -18.0948 -12.9899 -14.4861 0.664791 0.228153 0.278322

```

which are presumably x, y, z, r, g, b.

But VTK’s importer doesn’t read this kind of data:

> <https://github.com/Kitware/VTK/blob/master/IO/Geometry/vtkOBJReader.cxx#L60-L122>

If this kind of obj file is common in the wild then it’s probably not hard to extend the VTK code to read them.

---

<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 28, 2024, 7:32pm UTC](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206/23 "2024-08-28T19:32:48Z")

</div>

> [@pieper](#):
>
> If this kind of obj file is common in the wild

I think it is fairly common to bake texture to vertices to avoid external texture files and the complications arise from it. Since VTK already supports PLYs with vertex colors, it is reasonable to support the OBJ as well.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 28, 2024, 8:11pm UTC](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206/24 "2024-08-28T20:11:21Z")

</div>

Sure, I can see that it’s there in this real case. As the VTK comment says, OBJ format has many variants and they didn’t cover everything. Adding support for this variant would be a good project for someone who wants to do a little C++ project. It seems reasonable that the VTK maintainers would welcome the addition.

[Previous page](https://discourse.slicer.org/t/ply-file-colors-not-displayed/4206.md?page=1)
