Change MarkupsCurve color programmatically

Hello.

I’m trying to change the color of curve markups programmatically. The following snippet does not seem to work (color remains unchanged) and does not produce any error:

markupNode = getNode('MarkupsCurve')
displayNode = markupNode.GetDisplayNode()
displayNode.SetColor([0,0,0])

From the UI I can see that colors are managed through terminologies. Does this means that setting the color from the display node does not apply to this case? Any example on how to use terminologies in this context?

Thank you in advance.

Rafael.

Markups have Color and SelectedColor properties. SelectedColor is used if all control points are in “selected” state, which is the default. So, in most cases you want to use SetSelectedColor.

1 Like

Thank you @lassoan, that solves the problem!

1 Like