# Volumertric painting is possible or not

**URL:** <https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317>\
**Category:** Support\
**Created:** [January 3, 2022, 11:24am UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317 "2022-01-03T11:24:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [January 3, 2022, 11:24am UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/1 "2022-01-03T11:24:17Z")

</div>

For a project was looking a way to add anatomic structures details (i.e. tissue histology) directly starting from a CT/MR, to be used for education, analysis and simulation using realtime 3d rendering.

In 3d Slicer you can segment your data to extract the different elements, and export them in various formats that can be used for realtime rendering.  
I have seen beautiful CR examples such as this one

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/1/518a44785b6c7a9e086a708bcd518635a99db12e.jpeg)  
that I suspect it’s “just” using the traditional PBR pipeline using surface materials.  
Meaning if you cut the model you didn’t find any detail inside.

So far to add volumetric details you can sculpt them as a volume using tools such as Freeform and next provide the volume itself some color. It’s a long process.

A better way will be using some color 3D brushes to paint directly in 3d and export 3D volumetric images.  
But searching on I didn’t find any approach like that, for sure might be not so efficient in term of data sizes (volume model + volume textures).

Wanted to ask if someone has better information than me on this topic, to understand if it’s just a bad night idea, or there is some value in it.

---

<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:** [January 3, 2022, 3:03pm UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/2 "2022-01-03T15:03:55Z")

</div>

> [@davide445](#):
>
> A better way will be using some color 3D brushes to paint directly in 3d and export 3D volumetric images.

Segmentation in Slicer is always 3D and volumetric. So instead of exporting your segmentation as models, you can use the MaskVolume feature to export them separate volumes, and then use the volume rendering to assign different transfer functions to each of these volumes. So that’s already doable easily.

Where it gets difficult is the multi-volume rendering in Slicer is not fully implemented (as far as I know). Depending on the view/angle, you will have rendering artifacts and such, but I think the more users request and demand it, more attention it will get.

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [January 3, 2022, 3:27pm UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/3 "2022-01-03T15:27:55Z")

</div>

> [@muratmaga](#):
>
> Segmentation in Slicer is always 3D and volumetric

Of course. But what about if I want to fill the volume with a tissue (just as example)? Not a single color, but a texture depicting colored details.

---

<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:** [January 3, 2022, 3:41pm UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/4 "2022-01-03T15:41:20Z")

</div>

From the cloud-like appearance of minor vessels you can tell that the image above is rendered using volume raycasting or path tracing. There is no surface extraction or segmentation and the same material is used for the entire volume: there is just a color map that makes lower intensity voxels darker red and higher intensity voxels brighter yellow; bones and vessels appear exactly the same, with the same red haze at the boundary due to partial volume effect.

I think the rendering is impressive partly because the image resolution is higher than average and because of the material/lighting model maybe a slightly more sophisticated than just a basic ambient/diffuse/specular reflective model: there seems to be some soft shadows created by screen space ambient occlusion or path tracing.

This is what you can get with a simple volume raycasting in Slicer on slightly lower resolution images:

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

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

> [@davide445](#):
>
> what about if I want to fill the volume with a tissue

Volume rendering already displays a “filled” 3D volumetric texture. If you can see this in all the semi-transparent regions or if you cut into it using the crop region.

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [January 4, 2022, 11:51am UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/5 "2022-01-04T11:51:34Z")

</div>

@lassoan clear enough. In this way you can anyway color the volume only based on a single property the density.  
My idea was if there is any standard where I will be able to load painted 3d images, with much more details such as from the longitudinal and cross section of muscle

> **[Skeletal Muscle | Muscle Tissue](https://histologyguide.com/slideview/MH-055a-skeletal-muscle/04-slide-1.html?x=6990&y=35509&z=100.0)**
>
> Histology of sarcomeres (A band, I band, H band, and Z band) in skeletal muscle.

---

<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:** [January 4, 2022, 2:36pm UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/6 "2022-01-04T14:36:32Z")

</div>

You can volume render an RGB or RGBA volume as well. In this case the provided color and opacity values are used (they are not computed from a single scalar with transfer functions).

> [@Color (RGB) volume rendering](https://discourse.slicer.org/t/color-rgb-volume-rendering/19732):
>
> In recent Slicer Preview Releases, color volume rendering has been made much easier to access. While previously an alpha channel had to be created manually for rendering color RGB volumes, now the alpha channel is created automatically (from the luminance of the image). To render an RGB volume, just load the image stack and drag-and-drop the volume from the Data module to a 3D view (or use Volume Rendering module). When a color volume is loaded then “Scalar Color Mapping” section is not display…

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [January 5, 2022, 8:05am UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/7 "2022-01-05T08:05:48Z")

</div>

@lassoan interesting. But if have an idea if there is any tool enabling to actually paint a volume RGB image. Just as example this idea

[![](https://img.youtube.com/vi/HUW49IKs1kE/maxresdefault.jpg "Bird Gamayun - Virtual reality painting (Tilt Brush)") ](https://www.youtube.com/watch?v=HUW49IKs1kE)

As far as I know i.e. Freeform it’s not able to paint volume RGB.

---

<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:** [March 13, 2022, 4:53am UTC](https://discourse.slicer.org/t/volumertric-painting-is-possible-or-not/21317/8 "2022-03-13T04:53:14Z")

</div>

Painting/sculpting segmentations in virtual reality sound like extremely tedious to me (even just holding out your arms for a few minutes takes quite a bit of effort). However, quick review (with grab to move, pinch to zoom) and touch-up (smoothing, filling holes, removing excess) may be useful and we plan to add these features.
