Use python to turn on visibility for model to model distance scalars and color bars

Hello,

I am called the ModeltoModel distance module in Slicer with Python to batch run the distance calculations of several pairs of models.

Is there a way in Python automatically turn on visibility of the scalars from the model-to-model distance and also the heat map bars?

Thank you!

You need to get the display node of the model node and apply the settings you want on the display node. For example for turning on scalar visibility you can call this function:

This snippet is for showing scalar bar for volumes. I don’t know if this works for model scalars, but I’d start here
https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-color-legend-for-a-volume-node

Thank you very much! I will test this