# Adding a new color table to Colors, permanently

**URL:** <https://discourse.slicer.org/t/adding-a-new-color-table-to-colors-permanently/37558>\
**Category:** Support\
**Created:** [July 25, 2024, 11:24am UTC](https://discourse.slicer.org/t/adding-a-new-color-table-to-colors-permanently/37558 "2024-07-25T11:24:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phcerdan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/phcerdan/32/1559_2.png) [@phcerdan](https://discourse.slicer.org/u/phcerdan)\
**Post date:** [July 25, 2024, 11:24am UTC](https://discourse.slicer.org/t/adding-a-new-color-table-to-colors-permanently/37558/1 "2024-07-25T11:24:12Z")

</div>

I want to add a custom color table to Slicer, and store it permanently, so I can open Volumes (Label Maps) with it.

Right now I am loading it on startup using `~/.slicerrc.py`, but I wonder if there is an alternative way?

```python
ctbl_file_path = '/path/mylut.ctbl'
# Create a new color node
color_node = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLColorTableNode')

# Read the color table from the file
color_table = slicer.vtkMRMLColorTableStorageNode()
color_table.SetFileName(ctbl_file_path)
color_table.ReadData(color_node)
color_node.SetName('MyAwesomeColorTable')

```

---

<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:** [August 2, 2024, 12:33pm UTC](https://discourse.slicer.org/t/adding-a-new-color-table-to-colors-permanently/37558/2 "2024-08-02T12:33:01Z")

</div>

In the past we added similar code to certain setup steps of our modules, such as

> <https://github.com/SlicerRt/SlicerRT/blob/master/Isodose/Logic/vtkSlicerIsodoseModuleLogic.cxx#L108>

The advantage of this to your approach is that anyone using the extension will have the custom color tables without extra steps. Of course this only works if you already maintain some modules that your group uses.
