# Setting new active scalar does not always show

**URL:** https://discourse.slicer.org/t/setting-new-active-scalar-does-not-always-show/4678
**Category:** Development
**Tags:** extensions-manager
**Created:** [November 8, 2018, 10:48am UTC](https://discourse.slicer.org/t/setting-new-active-scalar-does-not-always-show/4678 "2018-11-08T10:48:56Z")
**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: [November 8, 2018, 10:48am UTC](https://discourse.slicer.org/t/setting-new-active-scalar-does-not-always-show/4678/1 "2018-11-08T10:48:56Z")

</div>

In python I change the scalar of my new model. this works fine at first, but when I regenerate the model and scalar values it does not show directly the second time. In the model UI I see the correct scalar being selected, but I have to first select another and then back to the one I prefer to make the changes have effect. The scalar values must be correct and python code to select the scalar as well, but I think I am missing something. An update maybe?

modelDisplayNode.SetActiveScalarName(“Normal”) # do. this to make the new/next scalar to show  
modelDisplayNode.SetActiveScalarName(“RGB”)

I already tried calling Modified for the scalarArray, modelNode and DisplayNode.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [November 8, 2018, 12:47pm UTC](https://discourse.slicer.org/t/setting-new-active-scalar-does-not-always-show/4678/2 "2018-11-08T12:47:07Z")

</div>

Yes, this sounds like a bug - can you adapt your code to make a short script that exactly replicates the issue (creates a model, sets the scalars, etc) to facilitate debugging?

---

<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 8, 2018, 2:15pm UTC](https://discourse.slicer.org/t/setting-new-active-scalar-does-not-always-show/4678/3 "2018-11-08T14:15:11Z")

</div>

You need to set up a few more things (enable scalar display, set range, color node, etc.) see example in [this post](https://discourse.slicer.org/t/is-there-any-way-to-draw-hundreds-of-balls-with-different-colors/572/7?u=lassoan). Let us know if you have still have issues.
