# Model and Segment rendering issues with 4.10 (and 4.11)

**URL:** <https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685>\
**Category:** Support\
**Tags:** segmentation, slicerrt\
**Created:** [November 8, 2018, 5:15pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685 "2018-11-08T17:15:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominicrushforth](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dominicrushforth](https://discourse.slicer.org/u/dominicrushforth)\
**Post date:** [November 8, 2018, 5:15pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685/1 "2018-11-08T17:15:01Z")

</div>

I have been using the isodose module to make isodose models. It worked in 4.8 but with 4.10 the 2D isolines do not display correctly - they do not change properly as I scroll through the slices - the lines do not change shape the just start to disappear as on the red and yellow windows…

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

… If I change the size of the windows (e.g. by moving the program to a different monitor) they detatch from the images and do not align at all…

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

I have also had issues with the volume segment editor module. Even using a simple tool such as paint it does not render properly with all kinds of odd lines…

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

…and if I persevere the program freezes or crashes.

I have tried the latest nightly, I have tried unistalling and reinstalling without any additional modules etc - and I have also tried using the experimental rendering method. Nothing seems to make any difference.

Does anyone know what is going on?

---

<div class="post-metadata">

**Author:** ![dominicrushforth](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dominicrushforth](https://discourse.slicer.org/u/dominicrushforth)\
**Post date:** [November 9, 2018, 12:14pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685/2 "2018-11-09T12:14:58Z")

</div>

So it seems it was not slicer that was at fault at all…

I downloaded and installed the latest graphics drivers for my card and now everything is working as expected.

Sorry for any inconvenience.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 9, 2018, 2:11pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685/3 "2018-11-09T14:11:46Z")

</div>

Great news, thanks for reporting and also for following up!

So now both Segment Editor and Isodose work properly?

---

<div class="post-metadata">

**Author:** ![dominicrushforth](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dominicrushforth](https://discourse.slicer.org/u/dominicrushforth)\
**Post date:** [November 13, 2018, 12:42pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685/4 "2018-11-13T12:42:16Z")

</div>

Yes the the isodoses and segmentations are now working perfectly. The only thing I’ve not managed to fix is a widget I made to render a surface volume at precise dose levels using a slider.

First, in set up I create a volume display node

```
  # Display node for 3D volumes
  volRenLogic = slicer.modules.volumerendering.logic()
  volumeDisplayNode = volRenLogic.CreateVolumeRenderingDisplayNode()
  slicer.mrmlScene.AddNode(volumeDisplayNode)
  volumeDisplayNode.UnRegister(volRenLogic)
  self.threeDVolumeDisplayNode = volumeDisplayNode

```

Later, after calculating my doses, I set the parameters for the 3D display updating the display node whenever the foreNode changed

```
  # and volume render the dose
  volRenLogic = slicer.modules.volumerendering.logic()
  volRenLogic.UpdateDisplayNodeFromVolumeNode(self.threeDVolumeDisplayNode, foreNode)
  # sets the window parameters for the 3D volume where the volume is rendered
  layoutManager = slicer.app.layoutManager()
  threeDWidget = layoutManager.threeDWidget(0)
  controller = threeDWidget.threeDController()
  threeDView = threeDWidget.threeDView()
  controller.set3DAxisVisible(False)
  controller.set3DAxisLabelVisible(False)
  controller.setOrientationMarkerType(2)
  controller.setOrthographicModeEnabled(True)
  controller.spinView(True)
  threeDView.lookFromViewAxis(ctk.ctkAxesWidget.Anterior)
  threeDView.resetCamera(False, True, True)
  threeDView.resetFocalPoint()

```

I then changed the threshold of the volume using a slider bar / dose selector…

def onChangeThresholdSliderWidget(self, value):  
propNode = self.threeDVolumeDisplayNode.GetVolumePropertyNode()  
volumeProp = propNode.GetVolumeProperty()  
volRenLogic = slicer.modules.volumerendering.logic()  
max = self.volumeThresholdSliderWidget.maximum  
volRenLogic.SetThresholdToVolumeProp([0,max],[value,max], volumeProp, False, True)

this all worked beautifully in 4.8 but not in 4.10. I’m not really sure what’s going on – I can get a (I’m not sure if it’s the same) volume display node to appear if I go to volume rendering and choose the node it was created from, but my slider no longer affects it. If I play with it too much the whole thing crashes.  
I’m sure this is to do with differences in how volume rendering is now handled and I suspect that I should be doing something simpler - but I’m struggling to figure exactly what it is I need to change. Perhaps there is some documentation that I’ve missed that someone could point me towards?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 13, 2018, 2:40pm UTC](https://discourse.slicer.org/t/model-and-segment-rendering-issues-with-4-10-and-4-11/4685/5 "2018-11-13T14:40:41Z")

</div>

Volume rendering changed quite a bit internally after 4.8.1. There have been discussions about this, they will probably help. Such as this:

> [@How to set volume rendering preset using Python](https://discourse.slicer.org/t/how-to-set-volume-rendering-preset-using-python/3063/2):
>
> Hi Oliver, There have been some improvements since 4.8.1 that makes it easier for us to do this. So if you use the latest nightly, then this is what you can do: Easier setup of volume rendering (no need to create the display node and update it from the logic): volRenLogic = slicer.modules.volumerendering.logic() displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode) This is not very clean, because it uses widgets from the volume rendering module, but you can apply a shift li…
