# How to display 2 volumes with transparences

**URL:** <https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378>\
**Category:** Support\
**Created:** [November 4, 2017, 10:30am UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378 "2017-11-04T10:30:26Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anto](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Anto](https://discourse.slicer.org/u/Anto)\
**Post date:** [November 4, 2017, 10:30am UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/1 "2017-11-04T10:30:26Z")

</div>

As a title I’m curious to know how to display 2 or more volume in the same scene, with transparence effect, to show internal anatomic structures

thanks

---

<div class="post-metadata">

**Author:** ![Frederic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/frederic/32/4907_2.png) [@Frederic](https://discourse.slicer.org/u/Frederic)\
**Post date:** [November 4, 2017, 10:53am UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/2 "2017-11-04T10:53:23Z")

</div>

Hi,  
In python interface:  
Perhaps by:  
slicer.modules.models.logic().AddModel(myPolyData)  
or  
slicer.modules.models.logic().AddVolume(myPolyData)

---

<div class="post-metadata">

**Author:** ![Anto](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Anto](https://discourse.slicer.org/u/Anto)\
**Post date:** [November 4, 2017, 11:50am UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/3 "2017-11-04T11:50:42Z")

</div>

Hello. Thank you for reply but I’m a beginner user and I’m able to use only a graphic interface… ☹

---

<div class="post-metadata">

**Author:** ![AndFor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/andfor/32/822_2.png) [@AndFor](https://discourse.slicer.org/u/AndFor)\
**Post date:** [November 4, 2017, 11:55am UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/4 "2017-11-04T11:55:27Z")

</div>

do you mean a result like this?

![23](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/6/a681a73a990c0483911dc670d7f66e4e2d562a6d.jpeg)

I’ve done with philips workstation, but i’m interest too to have a similar result with Slicer… I will try

---

<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 4, 2017, 2:32pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/5 "2017-11-04T14:32:51Z")

</div>

In general, anatomical images are complex enough that display them by simple blending has limited use. You can try it easily in slice views, select one volume as foreground, another one as background, and adjust the foreground visibility slider.

What works quite well (but of course somewhat more work) is to segment relevant structures from at least one of the volumes, and display those segments overlaid on the other volume. The non-segmented volume can be visualized using Volume rendering module. Segments can be made transparent in 3D views by adjusting display settings in Segmentations module.

---

<div class="post-metadata">

**Author:** ![Anto](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Anto](https://discourse.slicer.org/u/Anto)\
**Post date:** [November 4, 2017, 3:36pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/6 "2017-11-04T15:36:28Z")

</div>

I’ve 3 volume in volume rendering:

- the mail volume (dataset base)
- volume 1 segmented from main volume using mask
- volume 2 , similare to volume 1 but not sliglty different

In volume rendering I can display correctly each of them but not all together ???!!

---

<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 4, 2017, 4:19pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/7 "2017-11-04T16:19:43Z")

</div>

Yes, you can show one volume using volume rendering at a time, all the others have to be segmented. By using Segment Editor module, you can often create high-quality Segmentations quite easily.

Multiple volume rendering may be added to VTK in the near future and then we’ll enable that in Slicer as well.

---

<div class="post-metadata">

**Author:** ![AndFor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/andfor/32/822_2.png) [@AndFor](https://discourse.slicer.org/u/AndFor)\
**Post date:** [November 4, 2017, 6:57pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/8 "2017-11-04T18:57:44Z")

</div>

but we can display multiple model as here?

[http://www.spl.harvard.edu/publications/bitstream/viewbiglogo/2037/BrainAtlas-Snapshot](http://www.spl.harvard.edu/publications/bitstream/viewbiglogo/2037/BrainAtlas-Snapshot)

I need to save segmentation as model?

---

<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 4, 2017, 7:12pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/9 "2017-11-04T19:12:53Z")

</div>

> [@AndFor](#):
>
> display multiple model as here?

Yes, of course. You can adjust display parameters of all segments globally or individually for each segment - in Segmentations module Display section. If you prefer, you can also export all segments to model nodes using Export/Import section.

---

<div class="post-metadata">

**Author:** ![AndFor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/andfor/32/822_2.png) [@AndFor](https://discourse.slicer.org/u/AndFor)\
**Post date:** [November 4, 2017, 8:55pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/10 "2017-11-04T20:55:27Z")

</div>

Good, I’ve downloaded the pre-made model [http://www.spl.harvard.edu/publications/item/view/2037](http://www.spl.harvard.edu/publications/item/view/2037)

I’ve see that we can use a different opacity for simultaneus 3D models

---

<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 4, 2017, 10:06pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/11 "2017-11-04T22:06:52Z")

</div>

Note that you can also access these anatomical atlases conveniently in Data Store module (Slicer automatically downloads and caches the selected atlas and other sample data sets).

---

<div class="post-metadata">

**Author:** ![AndFor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/andfor/32/822_2.png) [@AndFor](https://discourse.slicer.org/u/AndFor)\
**Post date:** [November 4, 2017, 10:29pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/12 "2017-11-04T22:29:24Z")

</div>

![image_00022](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/3/9389e12790a4675922462cebfb66278c1d9810d0.png)

here my first segmentation 🙂  
no possible to export in png with TRASPARENT background?

---

<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 4, 2017, 11:49pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/13 "2017-11-04T23:49:46Z")

</div>

Nice work!

We haven’t added GUI for exporting a screenshot in a PNG file with transparent background, but you can easily do it:

1. Press Ctrl+3 to open Python console
2. Copy-paste “Capture 3D view into PNG file with transparent background” script from [Script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Capture)

If you need animations with transparent background then you could add these few lines to the [ScreenCapture module](https://www.slicer.org/wiki/Documentation/Nightly/Modules/ScreenCapture) (and a checkbox that enables/disables transparent background mode). To edit a module, enable Developer mode in Application Settings and click on `Edit` button at the top of the module GUI. If you managed to implement this then send us a pull request and we’ll be happy to integrate it.

---

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [December 6, 2021, 1:15pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/14 "2021-12-06T13:15:47Z")

</div>

Hey @lassoan, would it be possible to do this on the simpler Annotation Snap(Screen) Shot. I figure some logic like that would be necessary before and after the screenshot is called:

> <https://github.com/Slicer/Slicer/blob/0094e9a35bd266cc8b0e677858dabce797c9928f/Modules/Loadable/Annotations/GUI/qSlicerAnnotationModuleSnapShotDialog.cxx#L134>

Following the logic currently on the python module. Would that be desirable? Sometimes the user wants to grab a quick screenshot and the annotation screenshot is the quicker a cleaner option.  
Thanks

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [December 6, 2021, 1:38pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/15 "2021-12-06T13:38:49Z")

</div>

Since the Annotations module is currently legacy and will be removed in the future, it would be better to modify the Screen Capture module to do what you want as modifying the annotations module is something not going to be supported.

---

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [December 6, 2021, 1:56pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/16 "2021-12-06T13:56:18Z")

</div>

Thanks. I will work on simplifying the Screen Capture.

---

<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 6, 2021, 3:42pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/17 "2021-12-06T15:42:02Z")

</div>

Currently, the fastest way of copying 3D view content is the context menu (right-click menu) in the view:

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

In addition to adding a “transparent background” option to the Screen Capture module, we could also add a “Copy image with transparent background” action to the view context menu.

---

<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 28, 2022, 11:44pm UTC](https://discourse.slicer.org/t/how-to-display-2-volumes-with-transparences/1378/18 "2022-01-28T23:44:24Z")

</div>

A post was split to a new topic: [Segmentation exported to model file and imported does not preserve transparency](https://discourse.slicer.org/t/segmentation-exported-to-model-file-and-imported-does-not-preserve-transparency/21684)
