"Color Scalar Bar" reworked and upgraded, now it’s called "Color Legend"

@Mik submitted a pull request that will allow displaying color legend of volumes shown slice views to be shown in 3D views as well. It’ll be available in the Slicer Preview Release within a few days.

If you enable “Synchronize with Volumes module” in Volume rendering module’s Advanced / Volume Properties section then the same color legend applies to volume rendering and slice views. However, if you use any other volume rendering preset then there is no GUI for making the volume rendering’s Scalar Color Mapping appear as a color legend, but you can achieve it by copy-pasting this Python script into the Python console in Slicer:

# Get colormap from first volume rendering property node
colorMapOfVolumeRendering = getNode('*Prop*').GetColor()

# Add color node
colorNode = slicer.mrmlScene.CreateNodeByClass("vtkMRMLProceduralColorNode")
colorNode.UnRegister(None)  # to prevent memory leaks
colorNode.SetHideFromEditors(False)
slicer.mrmlScene.AddNode(colorNode)
colorMap = colorNode.GetColorTransferFunction()
colorMap.DeepCopy(colorMapOfVolumeRendering)

# Add an empty displayable node (you can only show a color legend if it belongs to a displayable node)
displayableNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLModelNode", "volume")
displayableNode.CreateDefaultDisplayNodes()
displayNode = displayableNode.GetDisplayNode()

# Display color legend
displayNode.SetAndObserveColorNodeID(colorNode.GetID())
colorLegendDisplayNode = slicer.modules.colors.logic().AddDefaultColorLegendDisplayNode(displayableNode)

@mik if you have time you might consider adding display of color legend for volume rendering (but instead of creating a separate color node, take the colormap from the volume property node). However, I’m not sure how often users want to display color legend for volume rendering.