I’m working on an extension (in python) where I have a surface mesh with attributes that I’m colouring the mesh based on attribute value. I would like to add a colour bar/legend programmatically with the values corresponding to my colours.
Something similar to this: Change Color map and add color scale
Except through the colours module I can only seem to create a colour map for my foreground/background images and not for my vtkMRMLModelNode object.
First time posting, so I hope I’m providing sufficient detail - thanks in advance for any support!
Connor
Thank you for the help. Unfortunately I keep getting the error, even when following the full example you posted:
Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘vtkSlicerColorsModuleLogicPython.vtkSlicerColorLog’ object has no attribute ‘AddDefaultColorLegendDisplayNode’
I am running the last stable release of Slicer (4.11), do I need to be running 4.13? To make sure it wasn’t just my modelNode doing something weird, I tried this with a simple PET dataset and got the same error.