# Set Specific Lookup Table depending on volume

**URL:** <https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486>\
**Category:** Support\
**Tags:** python\
**Created:** [November 4, 2021, 8:40am UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486 "2021-11-04T08:40:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![park](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/park/32/5717_2.png) [@park](https://discourse.slicer.org/u/park)\
**Post date:** [November 4, 2021, 8:40am UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486/1 "2021-11-04T08:40:58Z")

</div>

Hi all

Whenere I read some volumes in the 3D Slicer,  
It is always pop up as Grey Lookup Table

However, I would like to read some particular type (e.g., have specific file name or header) of volumes as different Lookup Table (i.e. ColdToHotRainbow) automatically.  
(E.g. “CT.nii” → Gray, “Vector.nii”-\> ColdToHotRainbow)

Could I get any insight to figure it out?

Thank you for your reply  
TY Park

---

<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 4, 2021, 3:07pm UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486/2 "2021-11-04T15:07:36Z")

</div>

I believe you would need to add a small script to your slicerrc.py, similar to this volume rendering example.

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository/volumes.html?highlight=automatically#show-volume-rendering-automatically-when-a-volume-is-loaded](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/volumes.html?highlight=automatically#show-volume-rendering-automatically-when-a-volume-is-loaded)

---

<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 4, 2021, 5:34pm UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486/3 "2021-11-04T17:34:30Z")

</div>

If you want to play nicer with other modules (which is important if you plan to distribute your module publicly) or go beyond just customizing the color table - for example customize how the volume is displayed, customize its icon in Data module, specify custom right-click menu actions - then you can add Subject Hierarchy plugin. When a node is loaded then Slicer iterates through all registered plugins and each plugin provides a “confidence value” that it is should own that node. The plugin with the highest confidence value will get the ownership and will be used to provide icon, menu actions, method to show/hide the node, etc.

---

<div class="post-metadata">

**Author:** ![park](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/park/32/5717_2.png) [@park](https://discourse.slicer.org/u/park)\
**Post date:** [November 5, 2021, 5:05am UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486/4 "2021-11-05T05:05:00Z")

</div>

Thank you for your reply

However, I could not find where is the “slicerrc.py” and where I put this file

---

<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 5, 2021, 4:24pm UTC](https://discourse.slicer.org/t/set-specific-lookup-table-depending-on-volume/20486/5 "2021-11-05T16:24:55Z")

</div>

See detailed description of the .slicerrc.py startup file here: [Application settings — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#application-startup-file)
