Hello,
I am trying to create a color table to display isodoses for an RT dose. I want the thresholds to be at percentages of the maximum value in the dose volume (i.e. 10%, 20%, etc). Following an example in the script repository, I have been successful in creating a custom color node:
maxDose = 100
customColorNode = slicer.vtkMRMLColorTableNode()
#
# # Define percentage intervals
thresholds = [0.2, 0.5, 0.75, 0.8, 0.85, 0.9, 0.95, 1]
colorRGB = [(263, 100, 76),
(0, 237, 255),
(46, 255, 0),
(255, 224, 0),
(255, 109, 0),
(255, 58, 0),
(26, 238, 153),
(91, 255, 73)]
customColorNode.SetTypeToUser()
customColorNode.SetNumberOfColors(len(thresholds))
customColorNode.SetName("CustomGANColorNode")
for i in range(len(thresholds)):
customColorNode.SetColor(i, colorRGB[i][0] / 255, colorRGB[i][1] / 255, colorRGB[i][2] / 255)
slicer.mrmlScene.AddNode(customColorNode)
However, I am not sure how to specify the thresholds corresponding to each colour. By default, it seems that the colors corresponding to values in increments of 10. I have gone through the ‘classvtkMRMLColorTableNode’ documentation, but haven’t found any methods that would allow me to set thresholds. Any help is appreciated.
Thanks