# Loading a color table in c++

**URL:** <https://discourse.slicer.org/t/loading-a-color-table-in-c/8580>\
**Category:** Development\
**Created:** [September 26, 2019, 12:35pm UTC](https://discourse.slicer.org/t/loading-a-color-table-in-c/8580 "2019-09-26T12:35:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbahegne](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbahegne/32/4837_2.png) [@rbahegne](https://discourse.slicer.org/u/rbahegne)\
**Post date:** [September 26, 2019, 12:35pm UTC](https://discourse.slicer.org/t/loading-a-color-table-in-c/8580/1 "2019-09-26T12:35:26Z")

</div>

Hello, it seems rather simple but i did not manage to manually load a color table in c++.

I would like also if possible to set manually the min and max.

Thanks

---

<div class="post-metadata">

**Author:** ![rbahegne](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbahegne/32/4837_2.png) [@rbahegne](https://discourse.slicer.org/u/rbahegne)\
**Post date:** [September 26, 2019, 1:19pm UTC](https://discourse.slicer.org/t/loading-a-color-table-in-c/8580/2 "2019-09-26T13:19:30Z")

</div>

Nevermind I found it :

> vtkMRMLMultiVolumeDisplayNode\* mvD = mVolumeNode-\>GetMultiVolumeDisplayNode();  
> mvD-\>AutoWindowLevelOff();  
> mvD-\>SetAndObserveColorNodeID(“vtkMRMLColorTableNodeFileColdToHotRainbow.txt”);  
> mvD-\>SetWindowLevelMinMax(35,50);
