# My SliceView is only updated after scrolling the mouse

**URL:** <https://discourse.slicer.org/t/my-sliceview-is-only-updated-after-scrolling-the-mouse/25563>\
**Category:** Development\
**Tags:** python\
**Created:** [October 5, 2022, 8:17pm UTC](https://discourse.slicer.org/t/my-sliceview-is-only-updated-after-scrolling-the-mouse/25563 "2022-10-05T20:17:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://discourse.slicer.org/u/Niels)\
**Post date:** [October 5, 2022, 8:17pm UTC](https://discourse.slicer.org/t/my-sliceview-is-only-updated-after-scrolling-the-mouse/25563/1 "2022-10-05T20:17:11Z")

</div>

In my module I change areas of my volume by clicking with the mouse in one of the slice views (red/green/blue). This works fine.

But all changes are reflected in all the views, except the view that I actually click in.  
The view is updated when I scroll a tiny little step forward and backward.

Is there a python way of updating/refreshing the slice view? like a modified method that we use for volumes or a display node?

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://discourse.slicer.org/u/Niels)\
**Post date:** [October 11, 2022, 7:29pm UTC](https://discourse.slicer.org/t/my-sliceview-is-only-updated-after-scrolling-the-mouse/25563/2 "2022-10-11T19:29:05Z")

</div>

solved it, I force an update of the views using this

```
layoutManager = slicer.app.layoutManager()
for sliceViewName in layoutManager.sliceViewNames():
  sliceWidget = layoutManager.sliceWidget(sliceViewName);
  sliceLogic = sliceWidget.sliceLogic()
  sliceNode = sliceLogic.GetSliceNode()
  sliceNode.Modified()

```

---

<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:** [October 19, 2022, 6:40am UTC](https://discourse.slicer.org/t/my-sliceview-is-only-updated-after-scrolling-the-mouse/25563/3 "2022-10-19T06:40:50Z")

</div>

Slicer does not know when you are finished with your numpy array modifications. Therefore, when you are done with your changes in a volume node via numpy, you must call `slicer.util.arrayFromVolumeModified()` function, as described in the [`slicer.util.arrayFromVolume()` function documentation](https://github.com/Slicer/Slicer/blob/main/Base/Python/slicer/util.py#L1627).
