Set Specific Lookup Table depending on volume

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

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

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.

Thank you for your reply

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

See detailed description of the .slicerrc.py startup file here: Application settings — 3D Slicer documentation