# Volume render not working

**URL:** <https://discourse.slicer.org/t/volume-render-not-working/6283>\
**Category:** Support\
**Created:** [March 25, 2019, 7:52pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283 "2019-03-25T19:52:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 25, 2019, 7:52pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/1 "2019-03-25T19:52:47Z")

</div>

Hello, im running against this issue for the second time now, where volume render would stop working for a certain volume, while still working for the others, Reloading the volume.nrrd file from the save folder into slicer works just fine, so it seems to be a problem with the scene file. i tried hiding unhiding the volume, deleting all other hiearchy , changing volume rendering window, and transfer functions, the only way to make it work is to reload the volume from the save folder.  
I uploaded the problematic scene if anyone could figure whats wrong, Thanks!

[https://drive.google.com/open?id=1MdtcZKGNlWJU-cvdBBZ29Ltqw7RVO1qF](https://drive.google.com/open?id=1MdtcZKGNlWJU-cvdBBZ29Ltqw7RVO1qF)

---

<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 25, 2019, 8:05pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/2 "2019-03-25T20:05:35Z")

</div>

Could you please also upload the volume property (.vp) file and annotation ROI node (.acsv)?  
Probably the best is if you upload the scene as a single .mrb file (click the package icon in the save dialog).

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 25, 2019, 8:13pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/3 "2019-03-25T20:13:07Z")

</div>

I removed them to lighten up the folder since none worked, i updated the upload with the mrb file

[https://drive.google.com/open?id=1MdtcZKGNlWJU-cvdBBZ29Ltqw7RVO1qF](https://drive.google.com/open?id=1MdtcZKGNlWJU-cvdBBZ29Ltqw7RVO1qF)

---

<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 25, 2019, 8:42pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/4 "2019-03-25T20:42:44Z")

</div>

There are two volume rendering display nodes for the same volume. You can create and manage any number of volume rendering display nodes programmatically, but the user interface always shows the first one.

The problem is that the first display node is invalid (volume node is not set in it), therefore the volume renderer cannot display it.

Have you loaded/imported a scene that was created in a version older than Slicer-4.10.1?

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 25, 2019, 8:58pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/5 "2019-03-25T20:58:57Z")

</div>

Thanks for your answer, No i did only use slicer 4.10.1 for the whole work. i deleted the two volume render nodes and still no result, any way it could be fixed from the UI ?

---

<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 26, 2019, 12:02am UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/6 "2019-03-26T00:02:05Z")

</div>

What do you mean you deleted volume rendering nodes? Did you delete nodes before this double volume rendering nodes issue happened? It would be great if you could come up with a list of steps that reproduce the problem.

---

<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 27, 2019, 2:23pm UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/7 "2019-03-27T14:23:56Z")

</div>

> [@Amine](#):
>
> any way it could be fixed from the UI ?

You can copy-paste this code snippet into the Python console to restore link between volume rendering display nodes and volumes:

```auto
for vrDisplayNode in getNodesByClass("vtkMRMLVolumeRenderingDisplayNode"):
  volumeNode=vrDisplayNode.GetDisplayableNode()
  if volumeNode:
    vrDisplayNode.SetAndObserveVolumeNodeID(volumeNode.GetID())
    slicer.modules.volumerendering.logic().UpdateDisplayNodeFromVolumeNode(vrDisplayNode, volumeNode)

```

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 30, 2019, 1:31am UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/8 "2019-03-30T01:31:35Z")

</div>

Thanks and sorry for the late reply;  
I deleted the volume rendering nodes only after you suggested they could be causing interference, (to try and restore the normal connection) : i went to nodes list and removed volume rendering 1 and volume rendering 3 (not sure if this was the right thing to do)

No i did not mess with nodes before the problem happend, only touched hiearchy, volume render module, and other usual modules (segment editor, crop etc)

This issue happened after hours on a project so i do not have any specific order to reproduce the problem

However the first time it happened it was directly after activating two volume renders on two different viewports, some volumes would not show up just like in this one but also the ones that still work would appear on all viewports even if the visibility tick boxes are changed, again this was non reproducible ( and i discarded the files)  
Ps: i did not use multiple 3d view for this second time it happened

---

<div class="post-metadata">

**Author:** ![Amine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/amine/32/4844_2.png) [@Amine](https://discourse.slicer.org/u/Amine)\
**Post date:** [March 30, 2019, 1:44am UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/9 "2019-03-30T01:44:12Z")

</div>

> [@lassoan](#):
>
> for vrDisplayNode in getNodesByClass(“vtkMRMLVolumeRenderingDisplayNode”): volumeNode=vrDisplayNode.GetDisplayableNode() if volumeNode: vrDisplayNode.SetAndObserveVolumeNodeID(volumeNode.GetID()) slicer.modules.volumerendering.logic().UpdateDisplayNodeFromVolumeNode(vrDisplayNode, volumeNode)

This worked perfectly. thanks! i hope i could help finding out where did it come from.

---

<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 30, 2019, 2:19am UTC](https://discourse.slicer.org/t/volume-render-not-working/6283/10 "2019-03-30T02:19:24Z")

</div>

Thanks for the additional information. Probably this part of the code will be revisited when we switch to multi-volume rendering as default rendering method (need to get shading fixed in VTK first).
