# Retain Image Color in Volume Rendering

**URL:** <https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294>\
**Category:** Support\
**Created:** [June 30, 2020, 12:27pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294 "2020-06-30T12:27:25Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![tgterra](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tgterra](https://discourse.slicer.org/u/tgterra)\
**Post date:** [April 15, 2021, 1:36pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/21 "2021-04-15T13:36:43Z")

</div>

> [@lassoan](#):
>
> Probe volume with model

I tried to use the Probe volume with model but it didn’t work ☹ . I used the RGBA volume to Probe volume with the model (with direct color mapping) and I choose my segmented model. My goal is to try to export my segmented models with the RGB volume as texture.

Here is the link to access the .mrb file: [https://drive.google.com/drive/folders/129\_MfWNBdJIzO6D4qiiVZVZXhXQmKKmw?usp=sharing](https://drive.google.com/drive/folders/129_MfWNBdJIzO6D4qiiVZVZXhXQmKKmw?usp=sharing)

---

<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:** [April 15, 2021, 3:58pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/22 "2021-04-15T15:58:28Z")

</div>

I’ve checked the scene. The problem was that the transform was not hardened on the `rgb` volume and CLI modules, such as “Probe volume with model” do not take into account transforms that are dynamically applied to a node. You can harden a transform in Data module by right-clicking on the icon in the transform column.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/2/7299cd226472d4cf857555c0e9d27ff424121953.jpeg)

---

<div class="post-metadata">

**Author:** ![tgterra](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tgterra](https://discourse.slicer.org/u/tgterra)\
**Post date:** [April 15, 2021, 5:35pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/23 "2021-04-15T17:35:49Z")

</div>

Nice! I reach that result too! Thank you very much @lassoan 🙂

---

<div class="post-metadata">

**Author:** ![tgterra](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tgterra](https://discourse.slicer.org/u/tgterra)\
**Post date:** [April 16, 2021, 1:19pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/24 "2021-04-16T13:19:08Z")

</div>

@lassoan when I try to save this model by clicking at “Save” and select “OBJ” I get this result with MeshLab:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/3/b39ecbe2a963a18fd7fe5e3d85e914e4621d7106.png)

Also, when I duplicated the model, disable the Scalars and stay both visibilities I get this result at 3D Slicer:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/3/43242f476836a72628642f4fbd41a544539749c1.jpeg)

For me, this model is pretty good (considering the segmentation). My question is: can I export exactly this model as OBJ?

---

<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:** [April 16, 2021, 1:23pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/25 "2021-04-16T13:23:51Z")

</div>

OBJ format does not support per-vertex color, so you would need to save this model as a format that does, for example VTK, VTP, or PLY. If you must use OBJ format then you can load the per-vertex colored model into a 3D modeling software and create a texture from the per-vertex colors.

---

<div class="post-metadata">

**Author:** ![tgterra](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tgterra](https://discourse.slicer.org/u/tgterra)\
**Post date:** [April 16, 2021, 5:50pm UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/26 "2021-04-16T17:50:11Z")

</div>

@lassoan Even exporting as PLY or another format I get a model without texture:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/b/ab2ed4a4450fc8d875da72abb86b9562e2bc2a7c.jpeg)

---

<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:** [April 18, 2021, 4:49am UTC](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294/27 "2021-04-18T04:49:33Z")

</div>

You can save the RGB values in PLY by a few lines of Python script, but I’ve [submitted a pull request](https://github.com/Slicer/Slicer/pull/5600) that makes this available automatically via standard save data feature. It will be probably available in Slicer Preview Release on Monday or Tuesday.

[Previous page](https://discourse.slicer.org/t/retain-image-color-in-volume-rendering/12294.md?page=1)
