# Select color lookup table from python

**URL:** <https://discourse.slicer.org/t/select-color-lookup-table-from-python/8145>\
**Category:** Development\
**Tags:** extensions-manager, python\
**Created:** [August 23, 2019, 9:50am UTC](https://discourse.slicer.org/t/select-color-lookup-table-from-python/8145 "2019-08-23T09:50:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogertrullo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rogertrullo/32/4380_2.png) [@rogertrullo](https://discourse.slicer.org/u/rogertrullo)\
**Post date:** [August 23, 2019, 9:50am UTC](https://discourse.slicer.org/t/select-color-lookup-table-from-python/8145/1 "2019-08-23T09:50:02Z")

</div>

Hi,  
I am displaying a label image in slicer using this two lines of code

```
volumeNode = sitkUtils.PushVolumeToSlicer(anno_itk, name='Annotations', className='vtkMRMLLabelMapVolumeNode')
slicer.util.setSliceViewerLayers(background=volumeNode)

```

Now the problem is that I want to use a color lookuptable that I already defined as a txt file in the ColorFiles folder. Is there a way to do this?  
I tried this:

```
bgDisplay = volumeNode.GetDisplayNode()
bgDisplay.SetAndObserveColorNodeID('mylookuptable')

```

but it only works with some colors like green, red, etc but not with my own ones.

Thanks!

---

<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:** [August 23, 2019, 4:49pm UTC](https://discourse.slicer.org/t/select-color-lookup-table-from-python/8145/2 "2019-08-23T16:49:27Z")

</div>

“mylookuptable” does not look like a node ID. You should do something like this:

```
bgDisplay.SetAndObserveColorNodeID(myColorNode.GetID())
```
